mavis
(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. Simply run mavis in your Git repository to start the interactive commit process:
Summary extracted from the README.
mavis
(Un)Conventional Commits, your rules.
About
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.
Key Features
- 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
Install
Homebrew tap
brew install kristofferahl/tap/mavis
go install
go install github.com/kristofferahl/mavis@latest
Manual
Download binaries from release page
Usage
Simply run mavis in your Git repository to start the interactive commit process:
mavis
Keyboard Shortcuts
- Ctrl+A / Ctrl+S: Accept preview and commit
- ?: Toggle help view
- Esc / Ctrl+C: Quit without committing
Configuration
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.
Environment Variables
MAVIS_THEME: Override the theme (e.g., "charm", "dracula", "catppuccin")MAVIS_CHIP: Override the chip label shown in the UI
Debug Mode
Run with the debug flag to see additional information:
mavis --debug
AI-Powered Commits
Mavis 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.
Setup
- 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
Customization
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
How It Works
- 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)
MCP Server (AI Agent Integration)
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.
Setup
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"]
}
}
}
Available Tools
The MCP server exposes three tools:
| Tool | Arguments | Description |
|---|---|---|
prepare_commit |
path |
Returns the commit template, fields, and instructions for generating field values |
preview_commit |
path, values |
Renders a commit message from provided field values and returns an approval ID |
approve_commit |
id |
Executes the commit after user approval |
path is required and must be an absolute path to the git repository to commit in (any directory inside it works). The server resolves the repository root from it, loads your configuration for that repository, and commits there. This lets a single running server commit to any repository, not just the one it was started in.
Available Prompts
The MCP server also provides a prompt for AI agent guidance:
| Prompt | Description |
|---|---|
mavis |
Instructs the AI agent on the commit workflow: pass the repository path, call prepare_commit, then preview_commit, show the result to the user, and wait for approval before calling approve_commit |
How It Works
- The AI agent calls
prepare_commitwith the repositorypathto get your configured fields and template for that repository - It analyzes the staged changes in that repository and generates appropriate field values
- It calls
preview_commitwith the samepathto render the commit message - After showing you the preview and receiving your approval, it calls
approve_commit, which commits in that repository
The configuration is read on every prepare_commit and preview_commit call, so config changes apply without restarting the server.
This ensures your commits follow your configured conventions while letting AI agents handle the analysis and drafting