Skip to content

Lawlf/lumis-commit

Repository files navigation

Lumis Commit

Multi-provider commit message generator for git. CLI plus VSCode extension. Designed to work with the Claude subscription (default), the Anthropic API, or any provider that lands in future releases.

Part of the Lumis family of developer tools (Lumis Commit, Lumis Voice when released, more to come).

What it does

  • Reads git diff --cached (falls back to working-tree changes when nothing is staged).
  • Filters out lockfiles, build output, generated migrations, and binaries.
  • Sends a Conventional Commits prompt to the configured provider.
  • Prints the result to stdout (CLI) or populates the Source Control input (VSCode).

Why

  • Subscription support. The default claude-cli provider invokes the local claude binary, so users with a Claude plan generate commits without per-call API charges.
  • Huge diffs do not crash. Diffs travel via stdin, never via process arguments. When the prompt exceeds the input token budget, the pipeline summarizes per file in parallel and composes a smaller prompt for the final call.
  • Auto-stage fallback. When nothing is staged, Lumis uses the working tree (matches the GitHub Copilot UX). Disable with --no-auto-stage or lumis.autoStage = false.
  • Clean architecture. Hexagonal core with IProvider and IGitAdapter ports. Result-typed errors. Adding a new provider is one new file plus a factory entry.

Install

git clone https://github.com/Lawlf/lumis-commit.git
cd lumis
pnpm install
pnpm -r build
cd packages/cli
pnpm link --global   # makes `lumis` available globally

The CLI binary is now at ~/.local/bin/lumis (or wherever pnpm puts global links).

For the claude-cli provider, also install Claude Code and run claude login once.

CLI usage

git add .
lumis                           # uses settings from env / defaults
lumis --provider claude-api     # override provider per-invocation
lumis --no-auto-stage           # fail with EmptyDiff when nothing is staged
lumis --no-fallback             # skip huge-diff summarization; fail if prompt is too big
lumis -C /path/to/repo          # operate on a different repo

VSCode extension

The extension wraps the CLI with three entry points (sparkle button on the Source Control panel, command palette, Cmd+Alt+G / Ctrl+Alt+G). See packages/vscode/README.md.

Configuration

Var Default Purpose
LUMIS_PROVIDER claude-api claude-api or claude-cli.
LUMIS_PRESET conventional conventional (Conventional Commits) or free.
LUMIS_LANGUAGE auto Output language: auto, pt-br, en.
LUMIS_INPUT_TOKEN_LIMIT 250000 Threshold above which the huge-diff fallback engages.
ANTHROPIC_API_KEY required for claude-api API key.
LUMIS_CLAUDE_API_MODEL claude-sonnet-4-6 Model used by the claude-api provider.
LUMIS_MODEL unset Backward-compat alias for LUMIS_CLAUDE_API_MODEL.
LUMIS_CLAUDE_CLI_MODEL haiku Model used by the claude-cli provider.
LUMIS_CLAUDE_CLI_BINARY claude Path to the claude binary.
LUMIS_CLAUDE_CLI_TIMEOUT_MS 60000 Subprocess timeout for claude-cli.
LUMIS_CLAUDE_CLI_EFFORT low Effort level for claude-cli (low, medium, high, xhigh, max). low disables extended thinking.
LUMIS_FALLBACK_MAX_CONCURRENCY 8 Parallel summary calls when fallback engages.
LUMIS_FALLBACK_MAX_FILES 100 File count above which priority truncation engages.
LUMIS_FALLBACK_TOP_K 50 Files retained when priority truncation runs.
LUMIS_FALLBACK_SUMMARY_TOKENS 200 maxOutputTokens per summary call.

CLI flags (--provider, --no-fallback, --no-auto-stage, -C) override env vars per invocation.

Performance and limitations

Latency depends mostly on which provider you pick.

  • claude-api provider. Direct HTTP call to api.anthropic.com. Typical commits land in 2 to 4 seconds. Each call counts against your API key billing.
  • claude-cli provider. Spawns claude --print for every invocation. Typical commits take 6 to 10 seconds. Most of that time is Claude Code CLI startup (loading hooks, plugins, MCP, skills, settings, OAuth keychain), not model inference. The subscription has no equivalent of the API key, so the wrapper cost is unavoidable.

We investigated several speed optimizations and ruled them out:

  • --effort low is already on by default; it disables extended thinking but does not reduce CLI startup.
  • --bare and CLAUDE_CODE_SIMPLE=1 skip the heavy initialization, but they force ANTHROPIC_API_KEY auth, which defeats the subscription path.
  • @anthropic-ai/claude-agent-sdk exposes a startup() pre-warm helper, but pre-warmed instances are single-use, and reusing the same claude --print process across queries causes conversation context to bleed between commits.
  • Pool-of-one warm sessions overlap spawn cost with user idle time, but the per-query floor stays around 5 to 6 seconds because of Claude Code CLI overhead.

If you need consistent sub-3-second commits today, use claude-api with an API key. The claude-cli path is the right choice when you prefer flat-fee billing under your Claude plan.

The huge-diff fallback adds proportional latency: each retained file gets one summary call, capped at concurrency 8. A 100-file change processes in roughly the time of one summary call plus the final compose call.

Status

Current release: v0.5.

Released:

  • v0.1: MVP, Anthropic API only, single one-shot prompt.
  • v0.2: Huge-diff fallback (parallel summarization, priority truncation, retry, degraded summaries).
  • v0.3: claude-cli provider for Claude subscription, runtime provider selection.
  • v0.4: VSCode extension shell with three entry points and six settings.
  • v0.5: --effort low default plus auto-stage fallback to working-tree changes.

Planned:

  • OpenRouter HTTP adapter.
  • Gemini CLI subprocess adapter.
  • Codex CLI subprocess adapter.
  • Repo-style learning from git log.
  • Marketplace publish.

License and contributions

Lumis is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See the LICENSE file at the repository root for the full text.

What this means in practice:

  • You may use, modify, and redistribute Lumis for any purpose, including commercial use.
  • If you distribute Lumis or a derivative work (binary, source, fork, repackaged extension, or as part of a larger project), the entire derivative must remain licensed under AGPL-3.0-or-later, with full source code available to recipients.
  • If you run a modified version of Lumis as a network service (for example, a hosted commit-message API built on top of it), you must offer the modified source code to the users of that service.
  • You may not remove or alter the copyright notice in LICENSE and the source files. Original authorship must be preserved in any fork, redistribution, or derivative.

Contributions are welcome via pull request. By submitting a contribution, you agree that your changes will be released under the same AGPL-3.0-or-later terms as the rest of the project.

Copyright (c) 2026 Lawlf and contributors. All rights reserved.

About

Multi-provider commit message generator (CLI + VSCode extension)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors