Skip to content

Usage

Review Modes

cora supports multiple review modes, each suited to a different workflow:

ModeFlagScopeBest For
Default(no flag)Tries staged first, then unpushedQuick feedback
Staged--stagedFiles in git staging areaPre-commit review
Unstaged--unstagedUnstaged working changesReview work in progress
Unpushed--unpushedCommits not yet pushedReview before push
Base Branch--base <branch>Diff against base branchPR review workflow
Commit--commit <ref>Specific commit or rangeReview specific changes
Diff File--diff-file <path>External diff fileReview patch files
bash
# Review staged changes (default)
$ cora review

# Review against a branch
$ cora review --base main

# Review a specific commit
$ cora review --commit HEAD

# Review from a diff file
$ cora review --diff-file pr.diff

# Full project scan (use cora scan)
$ cora scan .

Output Formats

cora can output results in three formats:

  • --format pretty — Human-readable terminal output (default)
  • --format json — Machine-readable JSON for CI/CD pipelines
  • --format sarif — SARIF format for GitHub Code Scanning
bash
# JSON output example
$ cora review --staged --format json

{
  "files": [
    {
      "path": "src/auth/login.ts",
      "issues": [
        {
          "line": 42,
          "severity": "warning",
          "message": "Potential SQL injection"
        }
      ]
    }
  ],
  "summary": {
    "total_files": 3,
    "total_issues": 3
  }
}

Commit Workflow

cora commit combines review, commit message generation, and commit into a single command. It runs in two modes:

HITL mode (default)

Reviews staged changes, generates a conventional commit message, then prompts:

bash
$ git add -A
$ cora commit
🔍 Reviewing staged changes (3 files, 247 lines)...
 No issues found (quality score: 9.2/10)

📝 Generated commit message:
  feat(auth): add session expiry validation

Accept commit message? [Y]es / [E]dit / [N]o › y
 Committed: feat(auth): add session expiry validation
  • Y (or Enter) — accept the message and commit
  • E — open $EDITOR to edit, then commit
  • N — abort

YOLO mode (--yolo)

Auto-commits with no prompts. Use for trusted workflows (e.g. CI, rapid iteration):

bash
$ cora commit --yolo

Flags

FlagDescription
--yoloAuto-commit without prompts
--forceCommit even if quality gate fails
--no-reviewSkip review, only generate commit message
--editAlways open $EDITOR
--streamStream LLM response in real-time
-q, --quietSuppress all output except the result

Quality gate integration

If the quality gate is enabled and returns FAIL, cora commit blocks the commit unless --force is passed:

bash
$ cora commit --force

Configuration File

The .cora.yaml file provides persistent configuration. Place it in your project root.

File roles:

FilePurpose
~/.cora/auth.tomlAPI key (secret, chmod 600)
~/.cora/config.yamlGlobal defaults (provider, model, etc.)
.cora.yamlPer-project overrides
yaml
# .cora.yaml — example
provider: zai
model: glm-5.1

focus:
  - security
  - performance

ignore:
  files:
    - "vendor/**"
    - "*.min.js"

Environment Variables

Environment variables override configuration file settings:

VariableDescriptionRequired
CORA_API_KEYAPI key for CI (overrides auth.toml)CI only
CORA_PROVIDEROverride the LLM providerNo
CORA_MODELOverride the model nameNo
CORA_BASE_URLOverride the API base URLNo
CORA_CONFIGPath to alternative config fileNo

Provider-specific keys are auto-detected: OPENAI_API_KEY, ANTHROPIC_API_KEY, GROQ_API_KEY, ZAI_API_KEY

Working with Monorepos

cora works well in monorepo setups. Use include patterns to limit review scope to specific packages:

bash
# Review only the backend package
$ cora review --staged --include "packages/backend/**"

# Exclude test and generated files
$ cora review --staged --exclude "**/*.test.ts" --exclude "**/generated/**"

Alternatively, set include/exclude patterns in .cora.yaml for persistent configuration.

Uteke Memory Integration

Cora works standalone. Install Uteke to unlock reviews that learn from your codebase history.

Three Levels

LevelCommandUteke RequiredWhat It Does
Standalonecora reviewNoAI review, zero deps
Recallcora review --memoryYesRecall project patterns before review
Learningcora review --memory --learnYesRecall + save findings after review

Install Both

bash
curl -fsSL https://raw.githubusercontent.com/codecoradev/cora-cli/main/install-bundle.sh | sh

Usage

bash
# Review with memory recall
cora review --staged --memory

# Review + save to memory (reviews improve over time)
cora review --staged --memory --learn

# Works with all review modes
cora review --base main --memory --learn
cora commit --memory  # Note: --memory only on review, not commit

How It Works

  1. Before review, Cora calls uteke recall to find relevant memories (past findings, code patterns)
  2. These memories are injected into the LLM prompt as context
  3. After review (with --learn), findings are saved to Uteke via uteke remember
  4. Next review benefits from accumulated knowledge

Cora auto-detects Uteke on PATH. If not installed, memory features are silently disabled.

Exit Codes

cora uses standard exit codes for scripting and CI integration:

CodeMeaningCI Behavior
0No issues foundPass
1Issues foundFail (warning/error)
2Quality gate failed or review blockedFail (threshold exceeded)
3Authentication errorFail (missing API key)

MCP Server

cora includes a built-in MCP server for AI coding agent integration.

bash
# Start MCP server (JSON-RPC 2.0 over stdio)
cora mcp

See Configuration → MCP Server for setup guides for Claude Code, Cursor, and other agents.

Tech Debt Tracking

cora automatically tracks review findings over time, letting you answer "is our codebase getting better or worse?"

bash
# Show debt report
$ cora debt

# Show trend graph over review history
$ cora debt --trend

# Machine-readable output for CI dashboards
$ cora debt --json

# Shields.io badge JSON (embed in README)
$ cora debt --badge

# Estimated fix time
$ cora debt --estimate

# Filter by date or git tag
$ cora debt --since 2026-06-01
$ cora debt --since v0.4.5

# Filter by branch
$ cora debt --branch develop

Snapshots are saved to .cora/history/ after each review. Configure in .cora.yaml:

yaml
debt:
  enabled: true           # default
  history_dir: .cora/history
  retention_days: 90

Quality score ranges from 0 (worst) to 10 (best). Each finding reduces the score:

  • Critical: -2.0
  • Major: -1.0
  • Minor: -0.3
  • Info: -0.1

Trend indicators: ▼ improving (fewer findings), ► stable, ▲ worsening (more findings).

Tips

  • Use cora review with no flags for the fastest pre-commit feedback
  • Combine --format json with --base main in CI pipelines
  • Use cora scan . --incremental for large codebases — only changed files are analyzed
  • Use --quiet for minimal output and --severity to filter by severity level
  • Use cora auth login to store API keys securely instead of environment variables

Released under the MIT License.