CLI Overview
The Clarx CLI scores any codebase against the AI-First Standard locally and in CI.
Clarx CLI
The CLI is the primary way to run Clarx analysis. It scores a local codebase against the AI-First Standard, outputs a human-readable report, and exits with a non-zero code when thresholds are not met.
Install
npm install -g @clarxai/cli
# or run without installing
npx @clarxai/cli score .The package installs a clarx binary.
Quick start
# Score the current directory
clarx score
# Score with JSON output
clarx score --format json
# Score and fail CI if overall score is below 70
clarx score --min-score 70
# Generate a starter manifest
clarx init
# Explain a specific rule
clarx explain C2In a terminal, clarx score opens the interactive TUI by default. Use --ui text for a plain readline prompt, or --format json|markdown|sarif for machine-readable output.
Output
In TTY mode, the default is the interactive dashboard. With --ui text or in CI, the report is human-readable plain text:
clarx v0.1 · scoring 275 files…
Discoverability 85
Boundary Clarity 90
Context Efficiency 60 ⚠
Operational Guidance 50 ⚠
Edit Safety 80
AI-readiness 72 / 100 (confidence: medium)
How easily an AI agent can navigate and safely edit this repo —
not a measure of code quality, security, or correctness.
Warnings (4):
C2 3 files exceed 400 lines:
apps/api/src/routes/auth.ts (847 lines)
packages/ui/src/tokens.ts (512 lines)
apps/web/src/pages/dashboard.tsx (601 lines)
O2 Guidance file does not declare generated directories
O3 Guidance file does not declare verification commands
O4 Guidance file does not declare where common changes belong
Recommendations (2):
C4 High fan-in files not declared in manifest:
packages/ui/src/tokens.ts (imported by 23 files)
E4 Package boundaries not enforced by tooling
Run `clarx explain <rule>` for guidance on any rule.In the TUI, press Enter on an issue to open a formatted detail view with the same guidance.
Formats
| Flag | Output |
|---|---|
--format text (default) | Human-readable terminal report |
--format json | Machine-readable JSON for dashboards and CI |
--format markdown | Markdown summary for PR comments |
--format sarif | SARIF for GitHub Code Scanning and editor annotations |
Exit codes
| Code | Meaning |
|---|---|
0 | Analysis complete, score at or above threshold |
1 | Analysis complete, score below threshold |
2 | Hard failure detected |
3 | Analysis error (could not read repo) |