The CometAPI CLI is in beta. Expect small command and UX changes while the CLI interface stabilizes.
Features
- Multi-model chat with streaming and interactive REPL
- Model search and listing
- Account balance and usage statistics
- Usage log browsing with filters and CSV export
- Async task logs (Suno, Midjourney, Kling, and others)
- Multi-format output: table, JSON, YAML, CSV, Markdown
- TOML-based configuration with setup wizard
- Shell completion for Bash, Zsh, and Fish
- Agent-friendly design with structured JSON output and deterministic exit codes
Prerequisites
- Python 3.10 or later
- A CometAPI API key
Installation
Use the PyPI package page as the primary install reference, then choose one of the following methods to install the CLI:Quick start
Run the setup wizard
The interactive wizard stores your API key and optional access token in a local config file:The wizard prompts for:
- API key — required for all commands. Create one at CometAPI Console → API Keys.
- Access token — optional, needed for
account,stats,tokens,logs, andtaskscommands. Generate one at Console → Personal Settings.
Interactive chat session
Runcometapi chat without arguments to enter the multi-turn chat REPL:
| Command | Description |
|---|---|
/model | Switch the active model |
/system | Set or change the system prompt |
/clear | Clear conversation history |
/history | Show conversation history |
/save | Save conversation to a file |
/tokens | Show token usage for the session |
/help | List all REPL commands |
/exit | Exit the REPL |
Agent integration
The CLI is designed for use by AI coding agents and automation scripts:- All data commands support
--jsonfor structured, machine-readable output - Deterministic exit codes:
0(success),64(config missing),77(auth error),69(service unavailable) - Errors go to stderr, data goes to stdout
- See the full command reference for per-command options