github-gist について
GitHub Gist Publisher は、ローカルファイルを GitHub Gist として公開するスキルです。通常は `gh` CLI を使い、トークンによる API アクセスにも対応します。公開を指定しない場合は、非公開リストの Gist を作成します。
主な機能
- 01非公開または公開 Gist の作成
- 02説明とファイル名の設定
- 03URL のみを出力
- 04公開した Gist をブラウザーで表示
- 05`gh` CLI または API の利用
活用シーン
- 01セッションログの共有
- 02Markdown ノートの公開
- 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 を作成します(デフォルトはシークレット/非公開です) |
-d, --description | Gist の説明 |
-f, --filename | ファイル名を上書きします |
--url-only | URL のみを出力します |
--open | ブラウザーで開きます |
--api | gh CLI の代わりに API を強制的に使用します |
出力
{
"url": "https://gist.github.com/user/abc123",
"id": "abc123",
"public": false,
"filename": "file.md"
}
例
このスキルで公開されたセッションログ:https://gist.github.com/glebis/3faaae6b907123929220e81add51a567
コメント
Markdown 対応