Instalasi & Penggunaan CLI
CLI AgentGIF memungkinkan Anda mengunggah, merekam, mencari, dan mengelola GIF terminal dari terminal Anda. Tersedia dalam 5 bahasa pemrograman — pilih yang sesuai dengan stack Anda.
Instalasi
CLI diterbitkan ke semua registri paket utama. Setiap implementasi menyediakan perintah inti yang sama.
| Bahasa | Perintah Instalasi | Registri |
|---|---|---|
| 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 |
Verifikasi instalasi:
agentgif --version
agentgif --help
Autentikasi
Sebelum mengunggah atau mengelola GIF, autentikasi dengan akun GitHub Anda:
agentgif login
Ini membuka browser Anda untuk GitHub OAuth. Setelah otorisasi, CLI menyimpan API key Anda secara lokal di ~/.config/agentgif/config.json.
Atau, atur API key Anda secara langsung:
agentgif login --api-key YOUR_API_KEY
Get your API key from Settings → API Key.
Periksa status autentikasi Anda:
agentgif whoami
# → @yourname (authenticated)
Unggah
Unggah GIF dengan metadata:
agentgif upload demo.gif \
--title "Docker Compose Up" \
--command "docker compose up -d" \
--tags docker,compose,containers \
--description "Starting services with Docker Compose"
Opsi Unggah
| Flag | Deskripsi |
|---|---|
--title | Judul GIF (wajib) |
--command | Perintah yang didemonstrasikan |
--tags | Tag yang dipisahkan koma |
--description | Teks deskripsi |
--cast | Jalur ke file cast asciinema v2 |
--shell | Shell yang digunakan (bash, zsh, fish) |
--visibility | public (default) atau unlisted |
--open | Buka halaman GIF di browser Anda setelah unggah |
Unggah dengan File Cast
Menyertakan file cast mengaktifkan lapisan yang dapat dibaca mesin untuk agen AI:
agentgif upload demo.gif --cast demo.cast --title "Git Rebase" --tags git
Rekam dengan 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
Opsi Rekam
| Flag | Deskripsi |
|---|---|
--theme | Terminal theme (see themes) |
--output | Jalur file output (default: nama yang sama dengan tape dengan .gif) |
--upload | Unggah segera setelah perekaman |
--title | Judul untuk unggah otomatis |
--tags | Tag untuk unggah otomatis |
VHS must be installed separately: brew install vhs (macOS) or see the recording guide.
Cari
Cari di semua GIF publik:
agentgif search "docker compose"
Output menampilkan ID GIF, judul, perintah, dan jumlah penayangan dalam tabel terformat.
Filter Pencarian
# 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
Kelola GIF
Daftar GIF Anda
agentgif list
agentgif list --limit 50
Lihat Detail GIF
agentgif info xK9mQ2pL
Edit GIF
agentgif edit xK9mQ2pL --title "New Title" --tags git,rebase
Hapus GIF
agentgif delete xK9mQ2pL
# → Are you sure? (y/N)
Konfigurasi
CLI menyimpan konfigurasi di ~/.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
}
Variabel Lingkungan
Variabel lingkungan menimpa pengaturan file konfigurasi:
| Variabel | Deskripsi |
|---|---|
AGENTGIF_API_KEY | API key (menimpa konfigurasi) |
AGENTGIF_API_URL | URL dasar API |
AGENTGIF_THEME | Tema VHS default |
Berguna dalam pipeline CI/CD:
AGENTGIF_API_KEY=${{ secrets.AGENTGIF_KEY }} agentgif upload dist/demo.gif --title "CI Build"