Crates.io | lumen |
lib.rs | lumen |
version | 1.3.0 |
source | src |
created_at | 2024-10-29 19:33:19.819092 |
updated_at | 2024-11-09 18:46:34.91067 |
description | lumen is a command-line tool that uses AI to generate commit messages, summarise git diffs or past commits, and more without requiring an API key. |
homepage | |
repository | https://github.com/jnsahaj/lumen |
max_upload_size | |
id | 1427541 |
size | 83,567 |
lumen is a command-line tool that uses AI to generate commit messages, summarise git diffs or past commits, and more without requiring an API key.
Try lumen --help
To generate a commit message for staged changes
lumen draft
The commit message can be piped to other commands
# copy the commit message to clipboard (macos and linux, respectively)
lumen draft | pbcopy
lumen draft | xclip -selection clipboard
# open the commit message in your code editor
lumen draft | code -
# directly commit with the generated message
lumen draft | git commit -F -
The AI generates more meaningful commit messages when you provide context.
lumen draft
# Output: "feat(button.tsx): Change button color to blue"
lumen draft --context "match brand guidelines"
# Output: "feat(button.tsx): Update button color to align with brand identity"
To summarise a commit, pass in its SHA-1
lumen explain HEAD
lumen explain cc50651f
To use the interactive fuzzy-finder (requires: fzf)
lumen list
To generate a summary for the current git diff
lumen explain --diff
lumen explain --diff --staged
You can ask a question about the diff (or a commit) using --query
lumen explain --diff --query "how will this change affect performance?"
lumen explain HEAD~2 --query "how can this be improved?"
AI Provider can be configured by using CLI arguments or Environment variables.
-p, --provider <PROVIDER> [env: LUMEN_AI_PROVIDER] [default: phind] [possible values: openai, phind, groq, claude, ollama]
-k, --api-key <API_KEY> [env: LUMEN_API_KEY]
-m, --model <MODEL> [env: LUMEN_AI_MODEL]
# eg: lumen -p="openai" -k="<your-api-key>" -m="gpt-4o" explain HEAD
# eg: lumen -p="openai" -k="<your-api-key>" -m="gpt-4o" draft
# eg: LUMEN_AI_PROVIDER="openai" LUMEN_API_KEY="<your-api-key>" LUMEN_AI_MODEL="gpt-4o" lumen list
Provider | API Key Required | Models |
---|---|---|
Phind phind (Default) |
No | Phind-70B |
Groq groq |
Yes (free) | llama2-70b-4096 , mixtral-8x7b-32768 (default: mixtral-8x7b-32768 ) |
OpenAI openai |
Yes | gpt-4o , gpt-4o-mini , gpt-4 , gpt-3.5-turbo (default: gpt-4o-mini ) |
Claude claude |
Yes | see list (default: claude-3-5-sonnet-20241022 ) |
Ollama ollama |
No (local) | see list (required) |
brew tap jnsahaj/lumen
brew install --formula lumen
[!IMPORTANT]
cargo
is a package manager forrust
, and is installed automatically when you installrust
. see installation guide
cargo install lumen