การติดตั้งและการใช้งาน CLI

AgentGIF CLI ให้คุณอัปโหลด บันทึก ค้นหา และจัดการ terminal GIFs จาก terminal ของคุณ มีให้บริการใน 5 ภาษา — เลือกแบบที่เหมาะกับ stack ของคุณ

ติดตั้ง

CLI เผยแพร่ไปยัง package registries หลักทั้งหมด การใช้งานแต่ละแบบให้คำสั่งหลักเดียวกัน

ภาษาคำสั่งติดตั้งRegistry
Pythonpip install agentgifPyPI
Node.jsnpm install -g @agentgif/clinpm
Gogo install github.com/agentgif/cli@latestpkg.go.dev
Rustcargo install agentgifcrates.io
Rubygem install agentgifRubyGems

ตรวจสอบการติดตั้ง:

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
--shellShell ที่ใช้ (bash, zsh, fish)
--visibilitypublic (ค่าเริ่มต้น) หรือ 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คำอธิบาย
--themeTerminal 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_KEYAPI key (แทนที่ config)
AGENTGIF_API_URLAPI base URL
AGENTGIF_THEMEธีม VHS เริ่มต้น

มีประโยชน์ใน CI/CD pipelines:

AGENTGIF_API_KEY=${{ secrets.AGENTGIF_KEY }} agentgif upload dist/demo.gif --title "CI Build"