(Un)Conventional Commits, your rules.
Mavis is a terminal-first tool for writing structured Git commits — Conventional Commits, your rules.
You define the fields, formatting rules, and message template, so commits follow your convention rather than a fixed spec. Interactive TUI with live preview, AI-assisted defaults, and an MCP server for committing straight from agents like Claude Code.
- Interactive UI: Split-screen with form inputs and live commit message preview
- AI-Powered Suggestions: Generate commit message field defaults using OpenAI
- MCP Server: Integrate with AI agents like Claude Code via Model Context Protocol
- Customizable Templates: Format commit messages using a flexible template system
- Configurable Fields: Define the structure of your commit messages
- Multiple Themes: Choose from themes like charm, dracula, catppuccin, and more
- Configuration System: YAML-based with support for conditional configurations
- Environment Variable Overrides: Customize behavior via environment variables
brew install kristofferahl/tap/mavisgo install github.com/kristofferahl/mavis@latestDownload binaries from release page
Simply run mavis in your Git repository to start the interactive commit process:
mavis- Ctrl+A / Ctrl+S: Accept preview and commit
- ?: Toggle help view
- Esc / Ctrl+C: Quit without committing
Mavis automatically creates a default configuration file at ~/.config/mavis/config.yaml on first run. You can customize this file to change themes, fields, and commit message templates.
MAVIS_THEME: Override the theme (e.g., "charm", "dracula", "catppuccin")MAVIS_CHIP: Override the chip label shown in the UI
Run with the debug flag to see additional information:
mavis --debugMavis can generate intelligent commit message suggestions using OpenAI's GPT models. When enabled, it analyzes your git diff and suggests appropriate values for your commit message fields.
- Get an OpenAI API key: Sign up at OpenAI and create an API key
- Set the environment variable:
export OPENAI_API_KEY="your-api-key-here"
- Run mavis with --ai or enable it in your config - AI suggestions will be automatically generated based on your staged changes
You can customize the AI behavior in your configuration file:
ai:
enabled: true
provider: "openai"
custom_prompt: "Focus on business impact and use imperative mood."
openai:
model: "gpt-4.1-mini"
max_completion_tokens: 500
temperature: 0.2- Analyzes your staged git changes (diff)
- Considers the current branch name for better context
- Uses GPT-4 Mini for cost-effective, accurate suggestions
- Generates default values for all configured commit message fields
- Respects your existing field configuration and templates
- Works with any custom fields you've defined in your config
- Designed to support multiple AI providers (currently supports OpenAI)
Mavis includes an MCP (Model Context Protocol) server that allows AI agents like Claude Code, Kiro, and others to create commits using your mavis configuration.
Add the following to your project's .mcp.json file:
{
"mcpServers": {
"mavis": {
"command": "mavis",
"args": ["mcp"]
}
}
}Or if running from source:
{
"mcpServers": {
"mavis": {
"command": "go",
"args": ["run", ".", "mcp"]
}
}
}The MCP server exposes three tools:
| Tool | Description |
|---|---|
prepare_commit |
Returns the commit template, fields, and instructions for generating field values |
preview_commit |
Renders a commit message from provided field values and returns an approval ID |
approve_commit |
Executes the commit after user approval |
The MCP server also provides a prompt for AI agent guidance:
| Prompt | Description |
|---|---|
mavis |
Instructs the AI agent on the commit workflow: call prepare_commit, then preview_commit, show the result to the user, and wait for approval before calling approve_commit |
- The AI agent calls
prepare_committo get your configured fields and template - It analyzes staged changes and generates appropriate field values
- It calls
preview_committo render the commit message - After showing you the preview and receiving your approval, it calls
approve_commit
This ensures your commits follow your configured conventions while letting AI agents handle the analysis and drafting
