CLI のインストールと使用方法
AgentGIF CLI を使用すると、ターミナルからターミナル GIF をアップロード、録画、検索、管理できます。5 つの言語で利用可能 — スタックに合ったものを選んでください。
インストール
CLI はすべての主要なパッケージレジストリに公開されています。各実装は同じコアコマンドを提供します。
| 言語 | インストールコマンド | レジストリ |
|---|---|---|
| Python | pip install agentgif | PyPI |
| Node.js | npm install -g @agentgif/cli | npm |
| Go | go install github.com/agentgif/cli@latest | pkg.go.dev |
| Rust | cargo install agentgif | crates.io |
| Ruby | gem install agentgif | RubyGems |
インストールを確認:
agentgif --version
agentgif --help
認証
GIF をアップロードまたは管理する前に、GitHub アカウントで認証してください:
agentgif login
これにより GitHub OAuth 用のブラウザが開きます。認証後、CLI は API キーを ~/.config/agentgif/config.json にローカル保存します。
または、API キーを直接設定することもできます:
agentgif login --api-key YOUR_API_KEY
Get your API key from Settings → API Key.
認証ステータスを確認:
agentgif whoami
# → @yourname (authenticated)
アップロード
メタデータ付きで GIF をアップロード:
agentgif upload demo.gif \
--title "Docker Compose Up" \
--command "docker compose up -d" \
--tags docker,compose,containers \
--description "Starting services with Docker Compose"
アップロードオプション
| フラグ | 説明 |
|---|---|
--title | GIF タイトル (必須) |
--command | デモされたコマンド |
--tags | カンマ区切りのタグ |
--description | 説明テキスト |
--cast | asciinema v2 キャストファイルへのパス |
--shell | 使用したシェル (bash、zsh、fish) |
--visibility | public (デフォルト) または unlisted |
--open | アップロード後にブラウザで GIF ページを開く |
キャストファイルと一緒にアップロード
キャストファイルを含めると、AI エージェント向けの機械可読レイヤーが有効になります:
agentgif upload demo.gif --cast demo.cast --title "Git Rebase" --tags git
VHS で録画
The Python CLI can record terminal sessions directly using VHS (must be installed separately).
# Record from a VHS tape file
agentgif record demo.tape --theme dracula
# Record and immediately upload
agentgif record demo.tape --upload --title "My Demo" --tags demo
録画オプション
| フラグ | 説明 |
|---|---|
--theme | Terminal theme (see themes) |
--output | 出力ファイルパス (デフォルト: テープと同じ名前に .gif を付けたもの) |
--upload | 録画後すぐにアップロード |
--title | 自動アップロード用タイトル |
--tags | 自動アップロード用タグ |
VHS must be installed separately: brew install vhs (macOS) or see the recording guide.
検索
すべての公開 GIF を検索:
agentgif search "docker compose"
出力はフォーマットされたテーブルで GIF ID、タイトル、コマンド、ビュー数を表示します。
検索フィルター
# Filter by tag
agentgif search "build" --tag docker
# Filter by shell
agentgif search "alias" --shell zsh
# Sort by views instead of relevance
agentgif search "git" --sort views
GIF を管理
自分の GIF を一覧表示
agentgif list
agentgif list --limit 50
GIF の詳細を表示
agentgif info xK9mQ2pL
GIF を編集
agentgif edit xK9mQ2pL --title "New Title" --tags git,rebase
GIF を削除
agentgif delete xK9mQ2pL
# → Are you sure? (y/N)
設定
CLI は設定を ~/.config/agentgif/config.json に保存します:
{
"api_key": "ag_xxxxxxxxxxxx",
"api_url": "https://agentgif.com/api/v1",
"default_theme": "catppuccin-mocha",
"default_shell": "zsh",
"auto_open": false
}
環境変数
環境変数は設定ファイルの設定を上書きします:
| 変数 | 説明 |
|---|---|
AGENTGIF_API_KEY | API キー (設定を上書き) |
AGENTGIF_API_URL | API ベース URL |
AGENTGIF_THEME | デフォルト VHS テーマ |
CI/CD パイプラインで役立ちます:
AGENTGIF_API_KEY=${{ secrets.AGENTGIF_KEY }} agentgif upload dist/demo.gif --title "CI Build"