JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q63564F
  • License ISC

CLI code review tool powered by OpenRouter

Package Exports

  • @jardo5/lgtm
  • @jardo5/lgtm/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jardo5/lgtm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LGTM

Automated code review from your terminal. Point it at a git diff, pick your models, get comments with severity ratings.

██       ██████  ████████ ███    ███
██      ██          ██    ████  ████
██      ██   ███    ██    ██ ████ ██
██      ██    ██    ██    ██  ██  ██
███████  ██████     ██    ██      ██

Install

npm

npm install -g lgtm

From source

git clone <repo-url>
cd lgtm
npm install
npm run build
npm link

Or use the install script, which checks for dependencies first:

curl -fsSL <repo-url>/raw/main/install.sh | bash

Linux dependencies

LGTM stores your API key using your system's secret service. On Linux, you need secret-tool (from libsecret):

# Arch/CachyOS
sudo pacman -S libsecret

# Debian/Ubuntu
sudo apt install libsecret-tools

# Fedora
sudo dnf install libsecret

On macOS, Keychain is used automatically. On Windows, a config file fallback is used.

Usage

lgtm [options]

Run lgtm inside any git repository. On first run, you'll be prompted for an OpenRouter API key.

Flags

Flag Description
--help Show help
--version Show version
--verbose Debug logging
--no-fetch Skip git fetch
--base <ref> Set base reference
--head <ref> Set head reference

Examples

# Interactive — pick branches in the TUI
lgtm

# Diff two branches directly
lgtm --base main --head feature/auth

# Review without fetching remote
lgtm --no-fetch

How it works

  1. You select a base and head ref (branches, tags, commits, or staged changes)
  2. LGTM generates the diff and splits it into chunks
  3. Each configured agent sends the diff to its assigned model via OpenRouter
  4. Models stream back comments with file, line number, severity (1-5), and explanation
  5. A dedup agent consolidates overlapping comments across models
  6. Results are grouped by file with severity ratings: Info, Suggestion, Issue, Warning, Critical

Multi-model review

Configure multiple agents, each with a different model. Run openrouter/auto alongside specific models to get varied perspectives on the same diff. The dedup pass removes duplicates so you don't read the same comment three times.

Cost tracking

Token usage and cost are tracked per session. Free models show $0.00. Cost is displayed on the results screen after review completes.

Keyboard shortcuts

Welcome screen

Key Action
h Help
q Quit
Any key Continue

Launch screen

Key Action
Tab Cycle sections
/ Search in branch picker
s Start review
a Add agent
f Fetch remote
h History
Esc Back / close
Ctrl+Q Quit

Results screen

Key Action
Up/Down Navigate files
Esc Back to launch

Configuration

API key

Stored securely — macOS Keychain, Linux secret-tool, or an encrypted config file fallback. Never stored in .env or plaintext config.

Models

Any model available on OpenRouter works. The model picker shows all available models with pricing info. Default for new agents: openrouter/auto.

Requirements

  • Node.js 18+
  • Git
  • An OpenRouter API key
  • A terminal with mouse support (most modern terminals)

Development

# Run in dev mode
bun run src/index.tsx

# Build
npm run build

# Type check
npm run typecheck

# Lint
npm run lint

# Format
npm run format

# Run tests
npm run test

# Full validation (typecheck + lint + test + format)
npm run check

Project structure

src/
  components/    UI screens and widgets (OpenTUI/React)
  services/      Business logic (git, review, storage, cost)
  config/        Model configuration
  state/         React context state management
  theme/         Colors and styling (Dracula palette)
  types/         TypeScript type definitions

License

ISC