CLI tool
The AIVAX CLI operates an AIVAX account from the terminal. It covers the same products as the API, including AI Gateways, RAG collections, chat clients, Batch, Agentic Tests, web search, OCR, generations, conversations, skills, logs, and account settings, without requiring you to write HTTP requests.
The CLI is open source under the MIT license and published on npm as @aivax/cli.
When to use it #
Use the CLI when a person or an agent works with an account interactively or from scripts:
- inspecting and adjusting gateways, collections, and chat clients without opening the dashboard;
- importing documents into a collection, or transcribing a long PDF page by page into Markdown or RAG-ready JSONL;
- creating, starting, and exporting Batch jobs from local files;
- running Agentic Tests, checking consumption, or reading conversations and logs while debugging;
- giving a coding agent a compact way to operate AIVAX, since responses are optimized for agents by default.
For application code that serves end users, call the API or an OpenAI-compatible SDK directly instead.
Install #
The CLI requires Node.js 22.19 or newer.
npm install -g @aivax/cli
aivax auth loginOther package managers also work, such as pnpm add -g @aivax/cli or bun install -g @aivax/cli.
aivax auth login saves an account profile. The access key is kept in the operating system credential store. To link a profile without sharing the account login key, for example when a coding agent sets up the CLI, pass an existing API key instead:
aivax auth login --api-key <API_KEY> --profile-name <PROFILE_NAME>For scripts and CI, set the AIVAX_API_KEY environment variable instead of logging in.
What it can do #
Ask a gateway about a local file:
aivax gateways chat -m <GATEWAY_ID> "Summarize this contract" -f contract.pdf --streamSearch a collection, or transcribe a document and index it:
aivax rag search --collection <COLLECTION_ID> -q "refund policy" -k 10
aivax ocr document manual.pdf --format jsonl -o manual.jsonl
aivax rag import -c <COLLECTION_ID> -f manual.jsonlRun a Batch job from a JSONL file and export the results:
aivax batch items import -w <WORKFLOW_ID> -j <JOB_ID> -f customers.jsonl
aivax batch jobs start -w <WORKFLOW_ID> -j <JOB_ID>
aivax batch jobs export -w <WORKFLOW_ID> -j <JOB_ID> -o results.jsonlGenerate media, search the web, or check spending:
aivax generate speech -m <MODEL_ID> -t @script.txt -o narration.mp3
aivax web search -q "AI regulation news" --country US
aivax analytics balanceCall any endpoint that has no dedicated command:
aivax api get /api/v1/notifications/unread/countRun aivax --help to list every command group, and add --help to any command to see its options. aivax docs reference <ENDPOINT_NAME> shows the API reference for an endpoint without leaving the terminal.
