mirror of
https://github.com/jnsahaj/lumen.git
synced 2025-12-23 05:36:48 +00:00
83 lines
3.7 KiB
Markdown
83 lines
3.7 KiB
Markdown
|
|
# <p align="center"><img src="https://github.com/user-attachments/assets/896f9239-134a-4428-9bb5-50ea59cdb5c3" alt="lumen" /></p>
|
|

|
|

|
|

|
|
|
|
|
|
|
|
|
|
lumen is a command-line tool that uses AI to generate summary of your git changes
|
|
|
|

|
|
|
|
# Features
|
|
- Generate summary for changes in a git commit by providing its [SHA-1](https://graphite.dev/guides/git-hash)
|
|
- Generate summary for changes in git diff (staged/unstaged)
|
|
- Fuzzy-search for the commit to generate a summary
|
|
- Pretty output formatting enabled by Markdown
|
|
- Free and unlimited - no API key required to work out of the box
|
|
- Supports multiple AI providers
|
|
|
|
# Usage
|
|
Try `lumen --help`
|
|
|
|
To summarise a commit, pass in its SHA-1
|
|
```zsh
|
|
lumen explain HEAD
|
|
# OR
|
|
lumen explain cc50651f
|
|
```
|
|
To use the interactive fuzzy-finder (requires: fzf)
|
|
```zsh
|
|
lumen list
|
|
```
|
|
To generate a summary for the current git diff
|
|
```zsh
|
|
lumen explain --diff
|
|
# OR
|
|
lumen explain --diff --staged
|
|
```
|
|
|
|
AI Provider can be configured by using CLI arguments or Environment variables.
|
|
```sh
|
|
-p, --provider <PROVIDER> [env: LUMEN_AI_PROVIDER] [default: phind] [possible values: openai, phind, groq]
|
|
-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" list
|
|
|
|
```
|
|
|
|
### Supported providers
|
|
|
|
| Provider | API Key Required | Models |
|
|
|----------------------------------------------------------------------------------------------------------------------|------------------|---------------------------------------------------------------------------------------------|
|
|
| [Phind](https://www.phind.com/agent) `phind` (Default) | No | `Phind-70B` |
|
|
| [Groq](https://groq.com/) `groq` | Yes (free) | `llama2-70b-4096`, `mixtral-8x7b-32768` (default: `mixtral-8x7b-32768`) |
|
|
| [OpenAI](https://platform.openai.com/docs/guides/text-generation/chat-completions-api) `openai` | Yes | `gpt-4o`, `gpt-4o-mini`, `gpt-4`, `gpt-3.5-turbo` (default: `gpt-4o-mini`) |
|
|
| [Claude](https://claude.ai/new) `claude` | Yes | [see list](https://docs.anthropic.com/en/docs/about-claude/models#model-names) (default: `claude-3-5-sonnet-20241022`) | |
|
|
|
|
|
|
|
|
# Installation
|
|
### Using [Homebrew](https://brew.sh/) (MacOS and Linux)
|
|
```
|
|
brew tap jnsahaj/lumen
|
|
brew install lumen --formula
|
|
```
|
|
### Using [Cargo](https://github.com/rust-lang/cargo)
|
|
|
|
> [!IMPORTANT]
|
|
> `cargo` is a package manager for `rust`,
|
|
> and is installed automatically when you install `rust`.
|
|
> see [installation guide](https://doc.rust-lang.org/cargo/getting-started/installation.html)
|
|
```
|
|
cargo install lumen
|
|
```
|
|
|
|
# Prerequisites
|
|
1. git
|
|
2. [fzf](https://github.com/junegunn/fzf) (optional): Required for `lumen list` command
|
|
3. [mdcat](https://github.com/swsnr/mdcat) (optional): Required for pretty output formatting
|