@tarin/lgtm-cli
v3.0.1
Published
LGTM CLI — AI code review + CI/CD security from your terminal. By DevsBazaar (Tarin Agarwal).
Maintainers
Readme
LGTM CLI
AI code review + CI/CD security, from your terminal.
The official CLI for LGTM (Looks Good To Meow) — review code, manage repos, trigger security scans, mint API tokens, and inspect analytics from the command line. JSON output everywhere, real-time agent progress, and structured error codes for scripting.
$ npm install -g @tarin/lgtm-cli
$ lgtm loginWhat you get
lgtm review— review your local diff or a GitHub PR with the same 6-agent pipeline + synthesizer as the dashboard. Real-time progress via SSE.lgtm pr— list, view, trigger, or open reviews on existing GitHub PRs.lgtm security— full LGTM Security surface: enroll repos, view audit log, set per-rule policy, mint API tokens for the runtime watchdog GitHub Action.lgtm repo— connect, index, configure, list, and inspect repos. Per-repo auto-review, focus areas, and provider overrides.lgtm config— manage AI provider keys (OpenAI / Anthropic / Gemini) and default model.lgtm doctor— diagnose setup problems with a single command.lgtm notifications/lgtm analytics— read-only insight into reviews and findings.--jsonon every read command — pipe intojq, scripts, or CI.- Shell completion —
lgtm completion bash|zsh|fish. - Auto-update notice — passive once-a-day check.
Quickstart
# 1. Install
npm install -g @tarin/lgtm-cli
# 2. Log in (opens your browser)
lgtm login
# 3. Verify everything is wired up
lgtm doctor
# 4. Add an AI provider key
lgtm config set-key --provider openai --key sk-...
# 5. Connect your current repo + build the context index
cd /path/to/your/repo
lgtm repo connect
lgtm repo index
# 6. Run your first review
lgtm reviewCommands
Auth
| Command | Description |
|---|---|
| lgtm login [--api-url <url>] | OAuth via GitHub. Pass --api-url for staging. |
| lgtm logout [-y] | Clear the local session. |
| lgtm whoami [--json] | Show user, plan, usage, AI config, token expiry. |
| lgtm doctor [--json] | Run all setup checks and report what's broken. |
Code review
| Command | Description |
|---|---|
| lgtm review | Review local uncommitted diff against the detected default branch. |
| lgtm review --staged | Review only the staged diff. |
| lgtm review --base develop | Compare against an arbitrary base ref. |
| lgtm review --pr 42 | Trigger + stream a review on PR #42. |
| lgtm review --json | Emit machine-readable JSON. |
| lgtm pr list [--mine] [--repo X] [--status reviewing] | List PRs reviewed by LGTM. |
| lgtm pr view <num> | Show a PR's review (verdict, summary, agent breakdown). |
| lgtm pr review <num> | Alias for lgtm review --pr. |
| lgtm pr open <num> | Open the PR's report in your browser. |
LGTM Security
| Command | Description |
|---|---|
| lgtm security enroll [--repo X] | Enroll a repo in LGTM Security. |
| lgtm security list | List enrolled repos with open-finding counts. |
| lgtm security status [--repo X] | Show a repo's enrollment + posture. |
| lgtm security scan [--repo X] | Trigger a manual scan. |
| lgtm security audit [--open] [--severity high] [--rule-id ...] [--pr 42] [--query "..."] | Filter the audit log. |
| lgtm security resolve <id> --resolution fixed\|muted\|false-positive | Resolve an audit entry. |
| lgtm security policy show | Display per-rule policy. |
| lgtm security policy set <rule> <block\|warn\|off> | Override a rule's action. |
| lgtm security tokens list | List API tokens. |
| lgtm security tokens create [name] [--expires-in-days N] | Mint a token for the watchdog Action. |
| lgtm security tokens revoke <id> | Revoke a token. |
| lgtm security open | Open the LGTM Security dashboard page. |
Repo
| Command | Description |
|---|---|
| lgtm repo connect [--repo X] | Install GitHub App + connect a repo. |
| lgtm repo status [--repo X] | Show installation, connection, index, and config state. |
| lgtm repo list | Table of all connected repos with index status + provider override. |
| lgtm repo disconnect [-y] [--repo X] | Remove from LGTM. |
| lgtm repo index [--repo X] | Rebuild the tree-sitter context index. |
| lgtm repo settings [--auto-review true] [--focus-areas bugs,security] [--provider openai] [--model gpt-5.4] [--pr-chat true] | View or update per-repo settings. |
| lgtm repo sync [--repo X] | Re-sync PRs from GitHub. |
| lgtm repo open [--repo X] | Open the repo's dashboard page. |
Config
| Command | Description |
|---|---|
| lgtm config set-key --provider openai\|gemini\|anthropic --key <KEY> | Save and validate a provider key. |
| lgtm config set-model --provider X [--model Y] | Set default model (interactive if model omitted). |
| lgtm config show | Show current configuration with masked keys. |
| lgtm config remove-key --provider X | Remove a saved key. |
Analytics & notifications
| Command | Description |
|---|---|
| lgtm analytics overview [--range 7d\|30d\|90d\|all] [--repo X] | Totals, verdict distribution, severity breakdown. |
| lgtm analytics top-issues [--range R] [--repo X] | Most common findings. |
| lgtm analytics trends [--range R] [--repo X] | Time series (PRs/week, review time, severity). |
| lgtm notifications list [--unread] [--limit N] | Read in-app notifications. |
| lgtm notifications read <id> | Mark one as read. |
| lgtm notifications read-all | Mark every notification as read. |
Open
| Target | Opens |
|---|---|
| lgtm open (default dashboard) | /dashboard |
| lgtm open repos | /dashboard/repos |
| lgtm open security | /dashboard/security |
| lgtm open settings | /dashboard/settings |
| lgtm open analytics | /dashboard/analytics |
| lgtm open pricing | /dashboard/pricing |
| lgtm open docs | Public docs site |
Shell completion
# Bash
lgtm completion bash > ~/.lgtm.bash && echo "source ~/.lgtm.bash" >> ~/.bashrc
# Zsh
lgtm completion zsh > ~/.lgtm.zsh && echo "source ~/.lgtm.zsh" >> ~/.zshrc
# Fish
lgtm completion fish > ~/.config/fish/completions/lgtm.fishJSON output
Every read command (and most writes) accepts --json. Errors emit structured JSON to stderr with a stable code field. Example:
$ lgtm whoami --json | jq '.billing.reviewsRemaining'
50
$ lgtm pr list --json --status reviewing | jq '.prs[] | .prNumber'
$ lgtm doctor --json | jq '.summary'
{
"total": 9,
"pass": 9,
"warn": 0,
"fail": 0,
"skip": 0,
"healthy": true
}Error codes (stable across versions): not_logged_in, no_repo, not_connected, not_indexed, not_configured, billing_limit, rate_limited, invalid_input, server_error, network_error, auth_expired, not_found, conflict, permission_denied, unknown.
Configuration
The CLI stores its config in ~/.lgtm/:
config.json— login token, API URL, expiry. Created bylgtm login..env(optional) — environment-variable overrides loaded at every command. Useful forLGTM_API_URL.
You can also pass --api-url to lgtm login to target a staging server.
Development
# Build
npm install
npm run build
# Run unit + integration tests
npm test
# Run the built CLI directly
node bin/lgtm.js --helpRequirements
- Node 18+
- git
- A GitHub account with the LGTM GitHub App installed on at least one repo
- An API key from OpenAI (today) or Gemini / Anthropic (coming soon)
Links
- Website: https://looksgoodtomeow.in
- Docs: https://looksgoodtomeow.in/docs
- GitHub App: https://github.com/apps/tarin-lgtm/installations/new
- Issues / support: [email protected]
