Skip to content

Instantly share code, notes, and snippets.

Last active May 14, 2021 00:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// Menu: Create gist from clipboard
// Description: Creates a new GitHub Gist with the contents of your current clipboard
// Author: Gregor Martynus
// Twitter: @gr2m
const { Octokit } = await npm("scriptkit-octokit");
const octokit = new Octokit({
auth: {
scopes: ["gist"],
// copy the content from the current clipboard
const content = await paste();
if (!content) {
console.log("clipboard is empty");
const { data } = await{
description: "Created using",
public: false,
files: {
"clipboard.txt": { content },
await copy(data.html_url);
console.log("Gist created at %s", data.html_url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment