@zyoralabs/zai-cli
v0.1.1
Published
Z-AI gateway CLI — one key for every LLM. Chat, arena, models, keys, logs and spend from your terminal.
Maintainers
Readme
@zyora/zai-cli
Terminal client for the Z-AI gateway.
Install
npm i -g @zyora/zai-cli
# or run directly
npx @zyora/zai-cli --helpQuick start
zai config set baseUrl https://zai.zyoralabs.com/v1 # or http://127.0.0.1:8011/v1 for local
zai login # paste your zk_live_… key
zai whoami
zai models
zai chat -m openai/gpt-5.4-mini "Explain SSE in one sentence."
zai arena -m openai/gpt-5.4 -m anthropic/claude-sonnet-4-6 -m gemini/gemini-3.5-flash \
"Write a haiku about gateways."Commands
| Command | What it does |
| ------------------------------------ | ----------------------------------------------- |
| zai login [--key …] [--base-url …] | Save + verify API key |
| zai logout | Remove ~/.zai/config.json |
| zai whoami | Show gateway / key / status |
| zai models [-f filter] [--json] | List models accessible to your key |
| zai chat [prompt…] [-m …] [-i] | Single-turn (streams) or interactive REPL |
| zai arena [prompt…] -m a -m b … | Fan one prompt to N models in parallel |
| zai config show \| set <k> <v> | Read or update CLI config |
| zai keys \| logs \| cost | Deep-link into the web console (v0.1) |
Env
| Variable | Notes |
| -------------------- | ----------------------------------------------------- |
| ZAI_API_KEY | Overrides stored key |
| ZAI_BASE_URL | Overrides gateway URL |
| ZAI_CONSOLE_URL | Overrides console URL for deep-links |
| ZAI_DEFAULT_MODEL | Default model when -m is omitted |
Examples
# Pipe stdin
git diff | zai chat "Review this diff"
# Interactive REPL
zai chat -i -m anthropic/claude-sonnet-4-6 -s "You are a senior code reviewer."
# Side-by-side, JSON for scripting
zai arena -m openai/gpt-5.4-mini -m gemini/gemini-3.5-flash --json "Hi" | jqBuild from source
cd products/zai/cli
npm install
npm run build
node dist/index.js --help
# or
npm run dev -- --help