Skip to content

Installation

The CLI provides command-line access to the Codecosts API.

The CLI is a workspace package. Run it from the monorepo root:

Terminal window
bun run cli <command>

The CLI stores its config at ~/.config/codecosts/config.json:

{
"serverUrl": "http://localhost:3501",
"apiKey": "sk_abc123..."
}
FieldDefaultDescription
serverUrlhttp://localhost:3501API server URL
apiKey(none)API key from login

Before using authenticated commands, log in:

Terminal window
bun run cli login

This opens your browser for sign-in, creates an API key, and saves it to the config file.

For headless/CI environments, pass an API key directly:

Terminal window
bun run cli login --api-key sk_your_api_key
Terminal window
bun run cli status
Server: http://localhost:3501
API key: set
Config: /Users/you/.config/codecosts/config.json