关于 github-gist
GitHub Gist Publisher 是一款将本地文件发布为 GitHub Gist 的技能。默认使用 `gh` 命令行工具,也支持令牌 API 访问;除非指定公开,否则创建未列出的 Gist。
主要功能
- 01发布为未列出或公开 Gist
- 02设置描述和文件名
- 03仅输出链接
- 04在浏览器中打开已发布的 Gist
- 05使用 `gh` 命令行工具或 API
适用场景
- 01分享会话日志
- 02发布 Markdown 笔记
- 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, --description | Gist 描述 |
-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