การติดตั้งและการใช้งาน CLI
AgentGIF CLI ให้คุณอัปโหลด บันทึก ค้นหา และจัดการ terminal GIFs จาก terminal ของคุณ มีให้บริการใน 5 ภาษา — เลือกแบบที่เหมาะกับ stack ของคุณ
ติดตั้ง
CLI เผยแพร่ไปยัง package registries หลักทั้งหมด การใช้งานแต่ละแบบให้คำสั่งหลักเดียวกัน
| ภาษา | คำสั่งติดตั้ง | Registry |
|---|---|---|
| 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
การยืนยันตัวตน
ก่อนอัปโหลดหรือจัดการ GIFs ยืนยันตัวตนด้วยบัญชี GitHub ของคุณ:
agentgif login
จะเปิดเบราว์เซอร์สำหรับ GitHub OAuth หลังการอนุญาต CLI จัดเก็บ API key ของคุณในเครื่องที่ ~/.config/agentgif/config.json
หรือตั้งค่า API key โดยตรง:
agentgif login --api-key YOUR_API_KEY
Get your API key from Settings → API Key.
ตรวจสอบสถานะการยืนยันตัวตน:
agentgif whoami
# → @yourname (authenticated)
อัปโหลด
อัปโหลด GIF พร้อม metadata:
agentgif upload demo.gif \
--title "Docker Compose Up" \
--command "docker compose up -d" \
--tags docker,compose,containers \
--description "Starting services with Docker Compose"
ตัวเลือกการอัปโหลด
| Flag | คำอธิบาย |
|---|---|
--title | ชื่อ GIF (บังคับ) |
--command | คำสั่งที่สาธิต |
--tags | แท็กคั่นด้วยเครื่องหมายจุลภาค |
--description | ข้อความคำอธิบาย |
--cast | เส้นทางไปยังไฟล์ asciinema v2 cast |
--shell | Shell ที่ใช้ (bash, zsh, fish) |
--visibility | public (ค่าเริ่มต้น) หรือ unlisted |
--open | เปิดหน้า GIF ในเบราว์เซอร์หลังการอัปโหลด |
อัปโหลดพร้อมไฟล์ Cast
การรวมไฟล์ cast จะเปิดใช้งานชั้นที่เครื่องอ่านได้สำหรับ AI agents:
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
ตัวเลือกการบันทึก
| Flag | คำอธิบาย |
|---|---|
--theme | Terminal theme (see themes) |
--output | เส้นทางไฟล์ output (ค่าเริ่มต้น: ชื่อเดียวกับ tape พร้อม .gif) |
--upload | อัปโหลดทันทีหลังการบันทึก |
--title | ชื่อสำหรับการอัปโหลดอัตโนมัติ |
--tags | แท็กสำหรับการอัปโหลดอัตโนมัติ |
VHS must be installed separately: brew install vhs (macOS) or see the recording guide.
ค้นหา
ค้นหาใน GIFs สาธารณะทั้งหมด:
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
จัดการ GIFs
รายการ GIFs ของคุณ
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
}
Environment Variables
Environment variables จะแทนที่การตั้งค่าในไฟล์ config:
| ตัวแปร | คำอธิบาย |
|---|---|
AGENTGIF_API_KEY | API key (แทนที่ config) |
AGENTGIF_API_URL | API base URL |
AGENTGIF_THEME | ธีม VHS เริ่มต้น |
มีประโยชน์ใน CI/CD pipelines:
AGENTGIF_API_KEY=${{ secrets.AGENTGIF_KEY }} agentgif upload dist/demo.gif --title "CI Build"