create-gist-from-clipboard
by Gregor Martynus
Creates a new GitHub Gist with the contents of your current clipboard
// Menu: Create gist from clipboard// Description: Creates a new GitHub Gist with the contents of your current clipboard// Author: Gregor Martynus// Twitter: @gr2m// https://github.com/gr2m/scriptkit-octokit/const { Octokit } = await npm("scriptkit-octokit");const octokit = new Octokit({auth: {scopes: ["gist"],},});// copy the content from the current clipboardconst content = await paste();if (!content) {console.log("clipboard is empty");exit();}const { data } = await octokit.rest.gists.create({description: "Created using https://github.com/johnlindquist/kit/discussions/266",public: false,files: {"clipboard.txt": { content },},});await copy(data.html_url);console.log("Gist created at %s", data.html_url);
// Shortcut: command option g