mcpField
G
github-gist

github-gist

github.com/glebis生产力401242 次安装1 天前更新
代码仓库

关于 github-gist

GitHub Gist Publisher 是一款将本地文件发布为 GitHub Gist 的技能。默认使用 `gh` 命令行工具,也支持令牌 API 访问;除非指定公开,否则创建未列出的 Gist。

主要功能

  1. 01发布为未列出或公开 Gist
  2. 02设置描述和文件名
  3. 03仅输出链接
  4. 04在浏览器中打开已发布的 Gist
  5. 05使用 `gh` 命令行工具或 API

适用场景

  1. 01分享会话日志
  2. 02发布 Markdown 笔记
  3. 03创建公开文件片段

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/glebis/claude-skills --skill github-gist

安装后在 Claude Code 中输入/github-gist确认已加载。

附带文件.claude-plugin/plugin.jsonscripts/publish_gist.py

详细介绍

GitHub Gist 发布器

将任意文件发布为 GitHub Gist,便于分享。

前置条件

默认使用 gh CLI。请确保已完成身份验证:

gh auth status
# If not authenticated: gh auth login

备用方式:设置具有 gist 权限范围的 GITHUB_GIST_TOKEN 环境变量。

用法

# Publish file as secret (unlisted) gist - DEFAULT
python3 scripts/publish_gist.py /path/to/file.md

# Publish as public gist (visible in your profile)
python3 scripts/publish_gist.py /path/to/file.md --public

# Custom description
python3 scripts/publish_gist.py /path/to/file.md -d "My awesome note"

# Override filename in gist
python3 scripts/publish_gist.py /path/to/file.md -f "readme.md"

# From stdin
echo "Hello" | python3 scripts/publish_gist.py - -f "hello.txt"

# Just get URL
python3 scripts/publish_gist.py /path/to/file.md --url-only

# Create and open in browser
python3 scripts/publish_gist.py /path/to/file.md --open

选项

标志描述
--public创建公开 gist(默认创建私密/未列出的 gist)
-d, --descriptionGist 描述
-f, --filename覆盖文件名
--url-only仅输出 URL
--open在浏览器中打开
--api强制使用 API,而非 gh CLI

输出

{
  "url": "https://gist.github.com/user/abc123",
  "id": "abc123",
  "public": false,
  "filename": "file.md"
}

示例

使用此技能发布的会话日志:https://gist.github.com/glebis/3faaae6b907123929220e81add51a567

评论

支持 Markdown