Skip to content

Getting Started

Terminal window
npm install -g @code-bearings/cli

Or run directly without installing:

Terminal window
npx @code-bearings/cli analyze

Navigate to any TypeScript project with a tsconfig.json and run:

Terminal window
code-bearings analyze

This creates a .code-bearings/bearings.db SQLite database containing your project’s code graph: files, symbols, edges, modules, and metrics.

Terminal window
# List all detected modules
code-bearings modules
# Deep-dive into a specific module
code-bearings module auth
# Inspect a specific function
code-bearings function generateChangeBrief
# See the full system map
code-bearings overview
Terminal window
# Review staged + unstaged changes
code-bearings review
# Review staged changes only
code-bearings review --staged
# Compare branches
code-bearings compare main feature-branch
# Generate an HTML report
code-bearings review --format html -o review.html
Terminal window
# Default: canonical change brief
code-bearings review --mode general
# Failure hypotheses and blind spots
code-bearings review --mode bug-hunter
# Syntax translations and before/after explanations
code-bearings review --mode learning
# Module roles and boundary health
code-bearings review --mode architecture
# Guided questions for unfamiliar code
code-bearings review --mode exploration

Install “Code Bearings” from the VS Code extensions panel, then:

  1. Open the Command Palette (Ctrl+Shift+P)
  2. Run Code Bearings: Analyze Project
  3. 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.

Terminal window
code-bearings ci --fail-on-risk high --out ./review-artifacts

Generates Markdown, JSON, HTML, and compact text review artifacts. Exits non-zero if risk exceeds the threshold.