Applications
Inspect the applications available to the authenticated organization.
- Most commands accept `default` as the application id when the organization has only one application.
The official command-line interface for the Kolega.dev public API. Use it to authenticate, run scans, triage findings, trigger autofixes, and open pull requests without leaving the terminal.
The CLI exposes the same public API capabilities that are documented in the web reference, but optimized for terminal workflows and automation. It supports device-flow login, API-key auth, scan execution, finding review, AI fix generation, pull request creation, and quota inspection.
It is published on npm as @kolegaai/cli and installs a kolega binary.
Install the CLI globally from npm. The published package requires Node.js 22 or newer.
A typical first session is: authenticate, list applications, start a scan, then check remaining quota. The CLI supports default as the application id when your organization has only one application.
Device flow is the recommended interactive login method. For CI or headless automation, use an API token directly with --token or KOLEGA_TOKEN.
~/.config/kolega/config.json with file mode 0600.kolega auth status shows the redacted token source and current period information.kolega auth logout removes the stored credential.Commands are organized around the same resource groups as the public API: applications, scans, findings, fixes, and quota.
Inspect the applications available to the authenticated organization.
Trigger security scans, inspect scan batches, and tail progress from the terminal.
List findings, inspect a single finding, or update its lifecycle status.
Create AI remediation runs, watch progress, inspect diffs, and open pull requests.
Check current-period balances for scans, PRs, and application slots.
Every command supports --json, which emits the raw API response shape for scripting and CI pipelines.
| Flag | Env var | Description |
|---|---|---|
| --api-url <url> | KOLEGA_API_URL | Override the default API base URL (`https://api.kolega.dev`). |
| --json | - | Emit raw JSON for scripting instead of formatted terminal output. |
| - | KOLEGA_TOKEN | Provide an API token directly; it takes precedence over stored config. |
| - | NO_COLOR | Disable colored CLI output. |
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Generic error |
| 2 | User interrupted (Ctrl+C) |
| 3 | Quota exhausted |
| 4 | Not authenticated |
| 5 | API error |
The CLI repo includes generated OpenAPI types, a Commander-based entry point, per-resource command modules, and a thin API client around the public API. Use the GitHub repo for source and issue tracking.
npm run generate-types fetches the OpenAPI schema and regenerates TypeScript types.src/cli.ts in the CLI repo.src/commands/ in the CLI repo.