Skip to content

aigateway-sh/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aigateway-cli — aig

Official command-line tool for AIgateway — one API key, every model, every modality. Installs the aig binary.

npm i -g aigateway-cli     # or: npx aigateway-cli init
aig init                   # prompts for key, writes .env, scaffolds a starter file

Node 18+. Zero runtime dependencies. ESM-only.

Commands

aig init                          Sign in, save a key, drop it in .env, scaffold starter code
aig call <model> <prompt>         One-shot chat call (streams to stdout)
aig models [--modality <m>]       Print the live model catalog (--json for JSON output)
aig jobs video|music|3d …         Submit async generation jobs; get / cancel by id
aig mcp tools|call <name> [args]  Inspect the MCP server or invoke a tool from the shell
aig usage [--by tag|sub]          Month-to-date cost attribution
aig replay <request-id> <model>   Re-run a past request on a new model
aig eval run <dataset> <models>   Run an eval across candidate models
aig eval winner <eval-id>         Print winning model + metrics
aig sub-account create <name>     Mint a scoped key + spend cap
aig sub-account list
aig tail                          Tail live traffic (last 100 requests, then watch)

Examples

# First call after `aig init`
aig call moonshot/kimi-k2.6 "explain edge inference in 50 words"

# List the catalog
aig models --modality text
aig models --json > catalog.json

# Mint a per-customer key
aig sub-account create acme-corp --cap 50000 --rpm 300 --tag acme

# Run an eval
aig eval run prompts.jsonl anthropic/claude-opus-4.7,openai/gpt-5.4,moonshot/kimi-k2.6

# Tail live traffic, filter to errors
aig tail --filter status=error

# Inspect MCP without booting an agent
aig mcp tools
aig mcp call list_models

Configuration

Config lives at ~/.config/aigateway/config.json (mode 0600).

Source Wins
AIGATEWAY_API_KEY env var highest
~/.config/aigateway/config.json fallback
# Override per call
AIGATEWAY_API_KEY=sk-aig-other aig models

# Override base URL (for self-hosted deploys)
AIGATEWAY_BASE_URL=https://aig.internal aig models

aig init is idempotent. Re-running it asks before overwriting. Pass --key sk-aig-... for non-interactive setup (CI):

AIGATEWAY_API_KEY=sk-aig-... aig init --no-scaffold

Related packages

  • Python SDKaigateway-py
  • Node SDKaigateway-js
  • MCP serverhttps://api.aigateway.sh/mcp · inspector at /mcp/inspect

Source, issues, examples

License

MIT © AIgateway

About

aigateway-cli — the aig command-line tool for AIgateway. One API, every model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors