Install
Homebrew
brew install sparepartslabs/tap/spareparts-cliThis is the one that needs no decisions. The formula carries all three model
vendors, so sp works with whichever key you have set, and it brings its own
Python rather than touching the one you develop against.
pip
sp needs Python 3.11 or newer.
pip install "spareparts-cli[anthropic]" # or [openai], or [gemini], or [all]Pick the extra for the vendor you actually call. No vendor SDK is a base
dependency, so a bare pip install spareparts-cli gives you a command line
with no model behind it, and the first run says so and names the extra that
fixes it.
Either way you get an sp on your path:
sp --helpThe dependencies are otherwise deliberately thin. Everything the terminal rendering needs is in the standard library: a command line people install to try one subcommand should not drag in a UI toolkit.
From a clone
For changing it rather than using it:
git clone git@github.com:sparepartslabs/spareparts-cli.git
cd spareparts-cli
pip install -e ".[dev]"Vendors
No vendor is the assumed one. On pip each SDK is an extra, so you install the client for the vendor you actually call and nothing else. Homebrew has no extras to offer, so that formula carries all three and lets your keys decide.
| Vendor | Extra | Key | Default model | Typical run |
|---|---|---|---|---|
anthropic |
[anthropic] |
ANTHROPIC_API_KEY |
claude-opus-5 |
around 55s |
openai |
[openai] |
OPENAI_API_KEY |
gpt-5.5 |
around 65s |
gemini |
[gemini] |
GEMINI_API_KEY or GOOGLE_API_KEY |
gemini-pro-latest |
around 115s |
Set the key for the vendor you use:
export ANTHROPIC_API_KEY=sk-ant-...Name no vendor and sp uses whichever key is set. With more than one set it
picks in the order above, which is a tie-break rather than a ranking; name
provider: in .github/lgtm.yml to decide it
yourself. With none set it names all three variables rather than one, and a
vendor whose SDK is missing names the extra that installs it.
The timings are from live runs against a 32KB diff. Generation is three model calls, so expect it to take a moment. This is a thing you run before a merge, not on every commit.
The default models were chosen by listing each vendor's models with a live key,
not from memory. Anthropic and OpenAI pin, because a default that changes
underneath a quiz changes what the quiz asks. Gemini uses the tracking alias
because the vendor currently publishes no plain gemini-3.x-pro, only -image
variants, so pinning a pro model there would mean pinning to 2.5 indefinitely.
Two vendors are better than one
sp lgtm writes a question with one call, then asks a second call to refute it.
A candidate that cannot be refuted survives; everything else is dropped.
Both calls going to the same model is the weak version of that check. A model asked to find fault with its own reasoning mostly does not. If you have keys for two vendors, split them:
sp lgtm --provider anthropic --verifier openaiThat is the strongest arrangement available, and it is why the provider layer
exists rather than a bare --model flag. It costs one extra vendor's tokens and
nothing else: the verifier sees the question and the diff, never the proposer's
reasoning. It costs almost no extra wall clock either, since proposing and
verifying are sequential either way.
Set it once in .github/lgtm.yml and every run in
that repository uses it.