Luna generates concise commit messages using the OpenRouter API, letting you bring your own key and pick any supported model.
- Interactive file picker: choose which changed files to stage, right from the TUI
- Per-file commits: one commit for each selected file
- OpenRouter-powered: AI summaries from file diffs, using the model you choose
- Conventional prefixes: adds prefix if missing
- AI-picked emojis: with
-e, the model chooses a gitmoji-style emoji that matches the commit's intent - Length control: target < 60 chars, configurable max (default 72)
- Smart filtering: ignores common binaries and images
- Lists every changed file via
git status --porcelain(modified, staged, untracked), minus ignored files - You pick which files to include:
↑/↓to move,spaceto select,ato select all,enterto confirm - Stages the selected files (
git add), then processes them one by one - Sends each file's diff to the configured OpenRouter model
- If
-eis active, the model prefixes the message with a matching emoji; if the response lacks a known prefix, one is randomly selected from:chore:,refactor:,feat:,fix:,docs:,test:,etc.. - Truncates to
maxCommitLengthand commits withgit commit -m <message> -- <file>
- Windows
- Git installed and available in PATH
- OpenRouter API key (
https://openrouter.ai/keys) - A Nerd Font set as your terminal font, so the interface icons render correctly
- Copy
bin/Luna.exeto a directory, e.g.C:\Users\user\Luna - Add that folder to system PATH:
- Press
Win + R, runsysdm.cpl, open "Environment Variables" - Edit
Pathvariable → "New" → paste folder path - Save and reopen terminal
- Press
$ go build -o ./bin/Luna.exe main.goOr use the helper script:
$ ./build.shLuna reads configuration from project and global files:
- Project:
.lunacfg(in repository root or nearest parent) - Global:
.lunarc(in user home directory)
Priority:
- API key and model: Global → Project → Default
- Other settings: Project → Default
Default settings (from code):
ignoredPatterns:*.exe,*.dll,*.png,*.jpg,*.jpeg,*.gif,*.bincommitPrefixes:chore:,refactor:,feat:,fix:,docs:,test:maxCommitLength:72defaultEmoji:false
$ Luna apikey YOUR_OPENROUTER_KEY
$ Luna model openai/gpt-4o-miniThis saves the key and model in your global .lunarc. Reopen terminal after setting. Browse available models at openrouter.ai/models.
Run Luna inside a Git repository with any changes (staged, unstaged or untracked) — you'll pick which files to stage from the TUI.
help|h: Show helpcommit|c: Generate and commit per-file messagesapikey <YOUR_KEY>|k <YOUR_KEY>: Set API keymodel <MODEL_ID>|m <MODEL_ID>: Set OpenRouter modelconfig|cfgwith subcommands:init: Create.lunacfgin current directoryshow: Print merged configurationedit: Placeholder (not implemented yet)
$ Luna commit # or Luna cUse ↑/↓ to move, space to select files, a to select all, enter to stage and commit them.
$ Luna c -e # enable emojis in messagesGenerating commit for file: src/main.go
Committed src/main.go with message:
🚀 feat: add user authentication system
Generating commit for file: README.md
Committed README.md with message:
📝 docs: update installation instructions
- Luna skips common binary/image files
- If model returns empty response, fallback is
update <file> - Supported prefixes:
feat:,fix:,docs:,refactor:,test:,chore: maxCommitLengthis enforced (default 72)
- Error:
Set API key using 'luna apikey' first- Run
Luna apikey YOUR_KEYand reopen terminal
- Run
- Error:
Set model using 'luna model' first- Run
Luna model MODEL_ID(see openrouter.ai/models)
- Run
- Error running Git commands
- Ensure you're in a Git repository and Git is installed
- No changes found
- Nothing shows up in
git status; modify or create a file first
- Nothing shows up in
- API key not working
- Verify key is valid and the selected model is accessible on your OpenRouter account
Made with ❤️ by hax — version 1.3 (Beta)