CodeOtter Docs

CLI, TUI & MCP server

The codeotter command line, interactive terminal UI, CI merge blocker and Model Context Protocol server.

CodeOtter has one CLI with an interactive terminal UI and scriptable review, CI, JSON and MCP modes. It needs Node 22 or later.

pnpm install --frozen-lockfile
pnpm tui

With no arguments in an interactive terminal, codeotter opens the TUI. codeotter review --json is suited to coding agents.

Commands

# Browse connected repositories using the shared local backend
node tui/codeotter.mjs tui

# Print a one-shot review with color gauges and walkthrough
node tui/codeotter.mjs review

# Review staged changes before git commit
node tui/codeotter.mjs --staged

# Review a PR and post the scorecard comment
node tui/codeotter.mjs pr 42 --post-comment

# Run in CI as a merge blocker
node tui/codeotter.mjs ci --fail-on-gate --min-score 60

# Limit a review to some paths
node tui/codeotter.mjs review --files src/cart.js,src/tax.js

# Run the Model Context Protocol server for Cursor, Claude Desktop and IDEs
node tui/codeotter.mjs mcp

ci exits with code 1 when a gate fails or the score is below --min-score, and 2 on a bad flag or unknown command.

Same engines as the web app

  • review, pr, ci and the MCP server run the installation's configured language and System One models through core/server.mjs. A configured System One model owns every score and gate; --provider / --model override the language model only. Findings go through the same self-check.
  • Smart context scans for outside callers and checks cross-file contract safety.
  • Pre-merge gates (title, description, security, complexity, tests, documentation, scope and repository guidelines) are answered by the System One model, and are absent without one.
  • Works offline with local llama.cpp / Ollama, or with hosted keys (Claude, OpenAI, MiniMax, OpenRouter).

The TUI

The default TUI groups connected repositories under expandable organizations. Selecting a repository scopes its PRs; moving between PRs updates scores, summary and full details immediately. Saved reviews appear at once, and missing reviews are calculated one by one with the web app's configured engines. The TUI does not publish comments or suggestions.

No running web server is needed. The TUI imports shared services from core/server.mjs without binding a port, building the frontend or starting scheduled automation. Forge APIs and hosted models still need network access. PocketBase is managed automatically where configured.

KeyAction
Tab / Shift+TabCycle repositories, PRs, Review and Changes
Arrows / EnterNavigate and select; expand or collapse organizations
Left / Right in detailsSwitch Review / Changes tabs
PgUp / PgDnScroll full details or changes
c / oCopy content / open the PR
g / rRefresh / recalculate the selected PR
EscReturn from Changes or stop the review queue
q / Ctrl-CQuit

Use codeotter tui --local for staged, unstaged, base or patch review, Ask, description, improvement, docs and changelog drafts, session settings, history and JSON export. Press ? for local-mode keys. It uses provider environment variables or --provider, --model, --base-url and --key, with a 35,000-character diff context. Onboarding, accounts and OAuth, model downloads and publishing controls stay in the web app.

Configuration

SettingEffect
CODEOTTER_HOMEUse an existing installation's .env, config.json, scores/, .pb, pb_data and .local. Defaults to the repository that holds core/server.mjs.
PB_URL, PR_SCORER_DATATake precedence over CODEOTTER_HOME.
CODEOTTER_DELTAPath to Delta for the Changes tab (syntax highlighting, line numbers, wrapping). Install it with winget install dandavison.delta or brew install git-delta. Nothing downloads automatically.
CODEOTTER_IMAGE=offDisable the SIXEL logo in the header.

Scores use the web app's green, amber and red thresholds, inverted for risk and blast radius. Copy as prompt copies plain text; clipboard copying uses OS tools, with OSC 52 as a fallback. Use a terminal at least 60 columns wide and 20 rows tall.

On this page