Getting Started
Install the CLI
Section titled “Install the CLI”npm install -g @code-bearings/cliOr run directly without installing:
npx @code-bearings/cli analyzeIndex Your Project
Section titled “Index Your Project”Navigate to any TypeScript project with a tsconfig.json and run:
code-bearings analyzeThis creates a .code-bearings/bearings.db SQLite database containing your project’s code graph: files, symbols, edges, modules, and metrics.
Explore the Graph
Section titled “Explore the Graph”# List all detected modulescode-bearings modules
# Deep-dive into a specific modulecode-bearings module auth
# Inspect a specific functioncode-bearings function generateChangeBrief
# See the full system mapcode-bearings overviewReview Your Changes
Section titled “Review Your Changes”# Review staged + unstaged changescode-bearings review
# Review staged changes onlycode-bearings review --staged
# Compare branchescode-bearings compare main feature-branch
# Generate an HTML reportcode-bearings review --format html -o review.htmlUse Purpose Modes
Section titled “Use Purpose Modes”# Default: canonical change briefcode-bearings review --mode general
# Failure hypotheses and blind spotscode-bearings review --mode bug-hunter
# Syntax translations and before/after explanationscode-bearings review --mode learning
# Module roles and boundary healthcode-bearings review --mode architecture
# Guided questions for unfamiliar codecode-bearings review --mode explorationVS Code Extension
Section titled “VS Code Extension”Install “Code Bearings” from the VS Code extensions panel, then:
- Open the Command Palette (
Ctrl+Shift+P) - Run Code Bearings: Analyze Project
- Run Code Bearings: Review Changes
The extension provides hover tooltips, CodeLens annotations, gutter decorations, and an interactive review panel — all fed from the same canonical graph as the CLI.
CI Integration
Section titled “CI Integration”code-bearings ci --fail-on-risk high --out ./review-artifactsGenerates Markdown, JSON, HTML, and compact text review artifacts. Exits non-zero if risk exceeds the threshold.