CLI Installation & Usage

The AgentGIF CLI lets you upload, record, search, and manage terminal GIFs from your terminal. Available in 5 languages — choose the one that fits your stack.

Install

The CLI is published to all major package registries. Each implementation provides the same core commands.

LanguageInstall CommandRegistry
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

Verify the installation:

agentgif --version
agentgif --help

Authentication

Before uploading or managing GIFs, authenticate with your GitHub account:

agentgif login

This opens your browser for GitHub OAuth. After authorization, the CLI stores your API key locally at ~/.config/agentgif/config.json.

Alternatively, set your API key directly:

agentgif login --api-key YOUR_API_KEY

Get your API key from Settings → API Key.

Check your auth status:

agentgif whoami
# → @yourname (authenticated)

Upload

Upload a GIF with metadata:

agentgif upload demo.gif \
  --title "Docker Compose Up" \
  --command "docker compose up -d" \
  --tags docker,compose,containers \
  --description "Starting services with Docker Compose"

Upload Options

FlagDescription
--titleGIF title (required)
--commandThe command demonstrated
--tagsComma-separated tags
--descriptionDescription text
--castPath to asciinema v2 cast file
--shellShell used (bash, zsh, fish)
--visibilitypublic (default) or unlisted
--openOpen the GIF page in your browser after upload

Upload with Cast File

Including a cast file enables the machine-readable layer for AI agents:

agentgif upload demo.gif --cast demo.cast --title "Git Rebase" --tags git

Record with 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

Record Options

FlagDescription
--themeTerminal theme (see themes)
--outputOutput file path (default: same name as tape with .gif)
--uploadUpload immediately after recording
--titleTitle for auto-upload
--tagsTags for auto-upload

VHS must be installed separately: brew install vhs (macOS) or see the recording guide.

Search across all public GIFs:

agentgif search "docker compose"

Output shows GIF ID, title, command, and view count in a formatted table.

Search Filters

# 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

Manage GIFs

List Your GIFs

agentgif list
agentgif list --limit 50

View GIF Details

agentgif info xK9mQ2pL

Edit a GIF

agentgif edit xK9mQ2pL --title "New Title" --tags git,rebase

Delete a GIF

agentgif delete xK9mQ2pL
# → Are you sure? (y/N)

Configuration

The CLI stores configuration at ~/.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 override config file settings:

VariableDescription
AGENTGIF_API_KEYAPI key (overrides config)
AGENTGIF_API_URLAPI base URL
AGENTGIF_THEMEDefault VHS theme

Useful in CI/CD pipelines:

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