The CometAPI CLI reads settings from a TOML config file, environment variables, and command-line flags. When the same setting is available from multiple sources, the priority order is: CLI flags > config file > environment variables > defaultsDocumentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
Config file
Location:~/.config/cometapi/config.toml
Run the setup wizard to create the config file interactively:
config subcommand:
Available settings
| Config key | Environment variable | Description |
|---|---|---|
api_key | COMETAPI_KEY | API key (required for all commands) |
access_token | COMETAPI_ACCESS_TOKEN | Access token for account-level commands |
base_url | COMETAPI_BASE_URL | API base URL (default: https://api.cometapi.com/v1) |
default_model | COMETAPI_DEFAULT_MODEL | Default model for chat (fallback: gpt-5.4) |
output_format | — | Default output format: table, json, yaml, csv, or markdown |
Credentials
The CLI uses two types of credentials:API key
Required for all commands. The API key authenticates requests to the CometAPI model endpoints. Create an API key at CometAPI Console → API Keys. Set it in one of these ways:Access token
Optional. The access token is required for account-level commands:account, stats, tokens, logs, and tasks.
Generate an access token at CometAPI Console → Personal Settings.
Set it in one of these ways:
Security
The CLI applies the following security practices:- API keys and access tokens are never logged or displayed in full. Only the last 4 characters are shown in diagnostics output.
- The config file is created with restrictive permissions (
0600) — readable only by the file owner. - Credentials should never be committed to version control. Add the config file path to your
.gitignoreif applicable.
Troubleshooting
| Error | Solution |
|---|---|
API key not configured | Run cometapi init or set the COMETAPI_KEY environment variable |
Connection failed | Run cometapi doctor to diagnose connectivity |
Access token not configured | Only needed for account/stats/tokens/logs/tasks. Run cometapi init to add one |