Configure the CometAPI CLI: config file location, available settings, credential management, environment variables, and security practices.
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 > defaults
Location: ~/.config/cometapi/config.tomlRun the setup wizard to create the config file interactively:
cometapi init
Or manage individual settings with the config subcommand:
# View current configurationcometapi config show# Set a valuecometapi config set api_key "$COMETAPI_KEY"# Remove a valuecometapi config unset api_key# Show the config file pathcometapi config path
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:
read -rsp "CometAPI API key: " COMETAPI_KEYprintf '\n'export COMETAPI_KEY
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:
export COMETAPI_ACCESS_TOKEN="your-access-token"
cometapi config set access_token your-access-token