Clarx

Commands

Full reference for all Clarx CLI commands.

Commands

clarx score

Score a codebase against the AI-First Standard.

clarx score [path] [options]

Arguments:

ArgumentDescriptionDefault
pathDirectory to analyzeCurrent directory

Options:

FlagDescriptionDefault
--formatOutput format: text, json, markdown (alias md), sariftext
--min-scoreExit code 1 if overall score is below this valuenone
--min-pillar-scoreExit code 1 if any pillar score is below this valuenone
--ignoreComma-separated glob patterns to excludenone
--verboseInclude passing rules in outputfalse
--uiInteractive UI: tui or text. ink is accepted as an alias for tuitui in TTY, text otherwise
--watch, -wRe-run analysis on file changes (pairs with --ui tui)false
--copy-allCopy all failing rules and fixes to clipboardfalse

UI notes:

  • In a TTY, --ui tui opens the interactive dashboard (default).
  • --format json, markdown, or sarif always uses plain output — the TUI is skipped.
  • --ui text uses a readline-style prompt instead of the dashboard.

Exit codes:

CodeMeaning
0Analysis complete, all thresholds passed
1Score or pillar threshold not met
2Hard failure rules triggered
3Analysis 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 --verbose

See 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:

  1. Scans packages/, apps/, libs/, and services/ for workspace directories
  2. Pre-fills common generated globs (.next, dist, .source, coverage, node_modules, etc.)
  3. Adds detected .next or dist paths when present
  4. Writes clarx-manifest.json with placeholder workspace purpose strings and default verificationCommands

After writing, it prints next steps for filling in workspace descriptions, verification commands, and commonTasks.

Options:

FlagDescription
--dry-runPrint the manifest without writing it
--overwriteOverwrite 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 explain

Options:

FlagDescription
--copyCopy the fix guidance to the clipboard after printing

Examples:

clarx explain C2
clarx explain O1 --copy
clarx explain B1

Output 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]
SubcommandDescription
status (default)Show whether telemetry is enabled
onEnable telemetry
offDisable 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.