@kitlangton/lgtm
v0.3.0
Published
Auto-approve selected contributors' pull requests with whimsical AI reviews
Readme
LGTM
Tiny Bun CLI process that discovers contributors in the current GitHub repo, lets you choose who to auto-approve, and then keeps polling for their open pull requests with overly literary review bodies.
How it works
- You run
lgtminside a local git checkout. - LGTM resolves the repo from
git remote origin. - It asks GitHub who the contributors are and lets you multi-select the people to auto-approve.
- It saves that per-repo config to
~/.config/lgtm/config.json. - It polls GitHub every 60 seconds on a fixed Effect schedule.
- For each matching open PR, it skips PRs you already approved, then runs
gh pr review --approvewith a generated review body. - Draft PRs get
Looks <random G-word> To Me! (EVEN THOUGH IT'S STILL A DRAFT, GREAT JOB @author!)plus a haiku. - Ready PRs get
Looks <random G-word> To Me!plus a sonnet. - The poem is generated by
opencode run -m opencode/kimi-k2.5from the PR title and description. - On macOS,
lgtm background ...manages a per-repolaunchdagent for daemon-style watching.
Architecture
src/services/lgtm.tsis the main orchestration service.src/services/background.tsmanageslaunchdagents for background mode on macOS.src/services/github.ts,src/services/repo.ts,src/services/config-store.ts,src/services/prompt.ts, andsrc/services/logger.tsare Effect services with layers.src/models.tsdefines schema-backed runtime models used to decode config and GitHub JSON.src/errors.tsdefines tagged Effect errors for shell, config, prompt, and decode failures.src/services/lgtm.test.tscovers the main orchestration paths with mocked layers.
What it does
- Detects the current repo from your local git checkout
- Uses
ghauth for the current GitHub user - Lists contributors and prompts for who to auto-approve
- Polls GitHub for open PRs authored by those contributors
- Approves matching PRs with a generated haiku or sonnet review body
- Can install and manage a background watcher per repo on macOS
- Stores config in
~/.config/lgtm/config.json
Run
bun run startOr after publishing to npm:
bunx @kitlangton/lgtmRun it from inside the repository you want to watch.
Options
bun run start --setup # reconfigure current repo
bun run start --once # poll once and exit
bun run start background start
bun run start background status
bun run start background logs
bun run start background list
bun run start --helpPublished CLI equivalents:
lgtm background start
lgtm background stop
lgtm background restart
lgtm background status
lgtm background logs
lgtm background list
lgtm background uninstallInstall
bun install -g @kitlangton/lgtm
lgtmNotes
- Requires
gh auth login - Requires
opencodewith access toopencode/kimi-k2.5 - Polls every 60 seconds
backgrounduseslaunchdunder the hood on macOS, includinglist,status, andlogs- Approves drafts too
- Skips PRs you already approved
- Falls back to a templated poem if OpenCode generation fails
- Prints colored status updates as it polls
bun run checkruns typecheck + tests
