Commands
Full reference for all Clarx CLI commands.
Commands
clarx score
Score a codebase against the AI-First Standard.
clarx score [path] [options]Arguments:
| Argument | Description | Default |
|---|---|---|
path | Directory to analyze | Current directory |
Options:
| Flag | Description | Default |
|---|---|---|
--format | Output format: text, json, markdown (alias md), sarif | text |
--min-score | Exit code 1 if overall score is below this value | none |
--min-pillar-score | Exit code 1 if any pillar score is below this value | none |
--ignore | Comma-separated glob patterns to exclude | none |
--verbose | Include passing rules in output | false |
--ui | Interactive UI: tui or text. ink is accepted as an alias for tui | tui in TTY, text otherwise |
--watch, -w | Re-run analysis on file changes (pairs with --ui tui) | false |
--copy-all | Copy all failing rules and fixes to clipboard | false |
UI notes:
- In a TTY,
--ui tuiopens the interactive dashboard (default). --format json,markdown, orsarifalways uses plain output — the TUI is skipped.--ui textuses a readline-style prompt instead of the dashboard.
Exit codes:
| Code | Meaning |
|---|---|
0 | Analysis complete, all thresholds passed |
1 | Score or pillar threshold not met |
2 | Hard failure rules triggered |
3 | Analysis error or unknown command |
Examples:
# Score current directory (TUI in terminal)
clarx score
# Plain text mode
clarx score --ui text
# CI gate: fail if score < 70
clarx score --min-score 70
# JSON output for programmatic use
clarx score --format json > clarx-report.json
# SARIF for GitHub Code Scanning
clarx score --format sarif > clarx.sarif
# Watch mode with TUI
clarx score --watch
# Fail if any pillar drops below 60
clarx score --min-pillar-score 60
# Show passing rules too
clarx score --verboseSee Interactive TUI for keyboard shortcuts and detail view behavior.
clarx init
Generate a starter clarx-manifest.json based on the current repo structure.
clarx init [path]The command:
- Scans
packages/,apps/,libs/, andservices/for workspace directories - Pre-fills common generated globs (
.next,dist,.source,coverage,node_modules, etc.) - Adds detected
.nextordistpaths when present - Writes
clarx-manifest.jsonwith placeholder workspace purpose strings and defaultverificationCommands
After writing, it prints next steps for filling in workspace descriptions, verification commands, and commonTasks.
Options:
| Flag | Description |
|---|---|
--dry-run | Print the manifest without writing it |
--overwrite | Overwrite an existing manifest |
clarx explain
Print the full description, rationale, and remediation guidance for a rule.
clarx explain <rule-id> [--copy]Run without a rule id to print a measurement-scope overview — what Clarx measures, what it explicitly does not measure (code quality, security, correctness, test coverage), and the full rule list by pillar:
clarx explainOptions:
| Flag | Description |
|---|---|
--copy | Copy the fix guidance to the clipboard after printing |
Examples:
clarx explain C2
clarx explain O1 --copy
clarx explain B1Output includes:
- Rule description
- Why it matters for AI navigability
- How to fix it
- Manifest declarations where applicable
In the TUI, Enter on an issue or typing a rule ID opens the same content in the detail view.
clarx telemetry
Manage anonymous usage telemetry.
clarx telemetry [on|off|status]| Subcommand | Description |
|---|---|
status (default) | Show whether telemetry is enabled |
on | Enable telemetry |
off | Disable telemetry |
Telemetry sends rule interaction events and aggregate score signals — never code, file paths, or repo names. Set NO_CLARX_TELEMETRY=1 or DO_NOT_TRACK=1 to disable via environment.