Installation
The CLI provides command-line access to the Codecosts API.
Install
Section titled “Install”The CLI is a workspace package. Run it from the monorepo root:
bun run cli <command>Configuration
Section titled “Configuration”The CLI stores its config at ~/.config/codecosts/config.json:
{ "serverUrl": "http://localhost:3501", "apiKey": "sk_abc123..."}| Field | Default | Description |
|---|---|---|
serverUrl | http://localhost:3501 | API server URL |
apiKey | (none) | API key from login |
Authenticate
Section titled “Authenticate”Before using authenticated commands, log in:
bun run cli loginThis 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:
bun run cli login --api-key sk_your_api_keyCheck auth status
Section titled “Check auth status”bun run cli statusServer: http://localhost:3501API key: setConfig: /Users/you/.config/codecosts/config.json