### Install Lazycommit using Go Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Install the lazycommit tool using the Go package manager. Ensure you have Go installed and configured. ```bash go install github.com/m7medvision/lazycommit@latest ``` -------------------------------- ### Prompt Configuration Example Source: https://context7.com/m7medvision/lazycommit/llms.txt Example of the prompt configuration file (~/.config/.lazycommit.prompts.yaml) which contains prompt templates and message configurations. This file is safe to share. ```yaml ``` -------------------------------- ### Provider Configuration Example Source: https://context7.com/m7medvision/lazycommit/llms.txt Example of the provider configuration file (~/.config/.lazycommit.yaml) which stores API keys and provider-specific settings. This file should be kept private. ```yaml # Provider configuration file active_provider: copilot providers: copilot: api_key: "$GITHUB_TOKEN" # Uses GitHub token from environment model: "gpt-4o" # endpoint_url: "https://api.githubcopilot.com" # Optional custom endpoint openai: api_key: "$OPENAI_API_KEY" model: "gpt-4o" # endpoint_url: "https://api.openai.com/v1" anthropic: model: "claude-haiku-4-5" # Uses Claude Code CLI - no API key needed num_suggestions: 10 gemini: model: "flash" # Uses Gemini CLI - no API key needed num_suggestions: 10 ``` -------------------------------- ### Install Commitizen cz-lazycommit Plugin (Bash) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Install the Commitizen plugin for lazycommit integration using pip or uv. This enables using `git cz` with lazycommit suggestions. ```bash pip install cz-lazycommit ``` ```bash uv tool install commitizen --with cz-lazycommit ``` -------------------------------- ### Commit with First Suggested Message Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Automatically commit using the first suggested message. This example uses `sed` to extract the first line and then `git commit`. ```bash MSG=$(lazycommit commit | sed -n '1p') [ -n "$MSG" ] && git commit -m "$MSG" ``` -------------------------------- ### Language Configuration Examples (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Set the desired language for commit messages by specifying the `language` field in your prompt configuration file. This setting applies regardless of the AI provider used. ```yaml language: Spanish ``` ```yaml language: Arabic ``` ```yaml language: English # (default) ``` -------------------------------- ### Local Ollama Setup for Inference Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure lazycommit to use a local Ollama instance for AI model inference. Ensure the `openai` provider is active for compatibility. ```yaml # Use Ollama for local inference active_provider: openai # Use openai provider for compatibility providers: openai: api_key: "ollama" # Ollama doesn't require real API keys model: "llama3.1:8b" endpoint_url: "http://localhost:11434/v1" ``` -------------------------------- ### Lazygit Custom Command for AI Commits (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Integrate lazycommit into Lazygit by adding a custom command. This example allows selecting an AI-generated commit message and then editing it before committing. ```yaml customCommands: - key: "" # ctrl + a description: "pick AI commit" command: 'git commit -m "{{.Form.Msg}}"' context: "files" prompts: - type: "menuFromCommand" title: "ai Commits" key: "Msg" command: "lazycommit commit" filter: '^(?P.+)$' valueFormat: "{{ .raw }}" labelFormat: "{{ .raw | green }}" ``` -------------------------------- ### Interactive Configuration Wizard Source: https://context7.com/m7medvision/lazycommit/llms.txt Launches an interactive wizard to set up the AI provider, API key, model, language, and custom endpoints. ```bash lazycommit config set ``` ```bash # Interactive prompts: # ? Choose a provider: [copilot, openai, anthropic, gemini] # ? Choose a language for commit messages: [English, Spanish, Other...] # ? Enter API Key for openai: sk-... # ? Choose a model: [GPT 4o (gpt-4o), GPT 4o mini (gpt-4o-mini), ...] # ? Enter custom endpoint URL (leave empty for default): ``` -------------------------------- ### Display Current Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Displays the current configuration settings, including the active provider, model, endpoint, and language. ```bash lazycommit config get ``` ```bash # Example output: # Active Provider: copilot # Model: gpt-4o # Endpoint: https://api.githubcopilot.com # Language: English ``` -------------------------------- ### Build Lazycommit from Source Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Build the lazycommit executable from its source code. This requires cloning the repository and using the Go build command. ```bash git clone https://github.com/m7medvision/lazycommit.git cd lazycommit go build -o lazycommit main.go ``` -------------------------------- ### Global Prompt Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure default language and commit message templates for lazycommit globally. ```yaml language: English # Supported: English, Spanish, Arabic, Korean, etc. system_message: "You are a helpful assistant that generates git commit messages, and pull request titles." commit_message_template: "Based on the following git diff, generate 10 conventional commit messages. Each message should be on a new line, without any numbering or bullet points:\n\n%s" pr_title_template: "Based on the following git diff, generate 10 pull request title suggestions. Each title should be on a new line, without any numbering or bullet points:\n\n%s" ``` -------------------------------- ### Lazycommit Prompt Configuration Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Configure prompt templates and message language in the `~/.config/.lazycommit.prompts.yaml` file. This file is safe to share. ```yaml language: English # commit message language (e.g., "English", "Arabic", "Korean") system_message: "You are a helpful assistant that generates git commit messages, and pull request titles." commit_message_template: "Based on the following git diff, generate 10 conventional commit messages. Each message should be on a new line, without any numbering or bullet points:\n\n%s" pr_title_template: "Based on the following git diff, generate 10 pull request title suggestions. Each title should be on a new line, without any numbering or bullet points:\n\n%s" ``` -------------------------------- ### OpenAI Models Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Specify which OpenAI model to use for AI generation. Includes options for performance, cost, and version. ```yaml # Available OpenAI models providers: openai: model: "gpt-4o" # GPT 4o - balanced performance # model: "gpt-4o-mini" # GPT 4o mini - faster, cheaper # model: "gpt-4.1" # GPT 4.1 - latest version # model: "gpt-4.1-mini" # GPT 4.1 mini # model: "gpt-4.1-nano" # GPT 4.1 nano - most economical # model: "o1" # O1 - reasoning model # model: "o3-mini" # O3 mini - fast reasoning ``` -------------------------------- ### Lazygit Integration with Commitizen Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure Lazygit to launch Commitizen with the `cz_lazycommit` plugin using a custom keybinding. ```yaml customCommands: - key: "C" command: "git cz --name cz_lazycommit commit" description: "Commit with Commitizen" context: "files" loadingText: "Opening Commitizen commit tool" output: terminal ``` -------------------------------- ### Per-Repository Prompt Configuration (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Use a `.lazycommit.prompts.yaml` file in your repository root to override global prompt settings. Fields not present will fall back to global defaults. Useful for language-specific or format-specific commit messages. ```yaml language: Korean commit_message_template: "Based on the following git diff, generate 5 conventional commit messages:\n\n%s" ``` -------------------------------- ### Interactive Language Configuration (Bash) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Use the `lazycommit config set` command to interactively configure settings, including the language for commit message generation. ```bash lazycommit config set ``` -------------------------------- ### Lazycommit Provider Configuration Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Configure AI providers, models, and API keys in the `~/.config/.lazycommit.yaml` file. This file should not be shared. ```yaml active_provider: copilot # default if a GitHub token is found providers: copilot: api_key: "$GITHUB_TOKEN" # Uses GitHub token; token is exchanged internally model: "gpt-4o" # or "openai/gpt-4o"; both accepted # endpoint_url: "https://api.githubcopilot.com" # Optional - uses default if not specified openai: api_key: "$OPENAI_API_API_KEY" model: "gpt-4o" # endpoint_url: "https://api.openai.com/v1" # Optional - uses default if not specified anthropic: model: "claude-haiku-4-5" # Uses Claude Code CLI - no API key needed num_suggestions: 10 # Number of commit suggestions to generate gemini: model: "flash" # Uses Gemini CLI - no API key needed num_suggestions: 10 # Number of commit suggestions to generate ``` -------------------------------- ### Interactive Commit Selection with fzf Source: https://context7.com/m7medvision/lazycommit/llms.txt Stages changes, then interactively selects a commit message using fzf before committing. ```bash # Stage changes, pick commit message interactively, and commit git add . lazycommit commit | fzf --prompt='Pick commit> ' | xargs -r -I {} git commit -m "{}" ``` -------------------------------- ### Interactively Pick Commit Message with fzf Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Interactively select a commit message using `fzf` and then commit. This pipes the suggestions to `fzf` for selection and then to `git commit`. ```bash git add . lazycommit commit | fzf --prompt='Pick commit> ' | xargs -r -I {} git commit -m "{}" ``` -------------------------------- ### Custom Ollama Endpoint Configuration (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Configure lazycommit to use a local Ollama instance by setting the `active_provider` to `openai` and specifying the local `endpoint_url`. Ollama does not require a real API key. ```yaml active_provider: openai providers: openai: api_key: "ollama" model: "llama3.1:8b" endpoint_url: "http://localhost:11434/v1" ``` -------------------------------- ### Global Default Prompt Configuration (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md These are the default prompt configurations used by lazycommit if not overridden by a repository-local file. They define the system message and templates for commit messages and PR titles. ```yaml system_message: "You are a helpful assistant that generates git commit messages, and pull request titles." commit_message_template: "Based on the following git diff, generate 10 conventional commit messages. Each message should be on a new line, without any numbering or bullet points:\n\n%s" pr_title_template: "Based on the following git diff, generate 10 pull request title suggestions. Each title should be on a new line, without any numbering or bullet points:\n\n%s" ``` -------------------------------- ### Lazygit Custom Command for Commitizen Integration (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Add a custom command to Lazygit to initiate a commit using Commitizen with the `cz-lazycommit` plugin, providing a dedicated option for AI-assisted commits. ```yaml - key: "C" command: "git cz --name cz_lazycommit commit" description: "Commit with Commitizen" context: "files" loadingText: "Opening Commitizen commit tool" output: terminal ``` -------------------------------- ### Gemini Models Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure lazycommit to use Gemini models via the Gemini CLI. Supports different model tiers for performance and capability. ```yaml # Gemini uses Gemini CLI - no API key required providers: gemini: model: "flash" # Gemini Flash - default # model: "flash-lite" # Gemini Flash Lite - faster # model: "pro" # Gemini Pro - more capable # model: "auto" # Auto-select model num_suggestions: 10 ``` -------------------------------- ### Anthropic Models Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure lazycommit to use Anthropic models via the Claude Code CLI. No API key is required. ```yaml # Anthropic uses Claude Code CLI - no API key required providers: anthropic: model: "claude-haiku-4-5" # Fast and efficient num_suggestions: 10 ``` -------------------------------- ### GitHub Copilot Models Configuration Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure lazycommit to use GitHub Copilot models. Requires a valid GitHub token and allows selecting specific models or auto-selection. ```yaml # GitHub Copilot models (requires valid GitHub token) providers: copilot: model: "gpt-4o" # Default # model: "auto" # Auto-select # model: "gpt-4.1" # GPT 4.1 # model: "gpt-5-mini" # GPT 5 mini ``` -------------------------------- ### Pipe First Suggestion to Git Commit Source: https://context7.com/m7medvision/lazycommit/llms.txt Retrieves the first commit message suggestion from lazycommit and uses it for a git commit. ```bash # Get the first suggestion and commit with it MSG=$(lazycommit commit | sed -n '1p') [ -n "$MSG" ] && git commit -m "$MSG" ``` -------------------------------- ### LM Studio or Custom OpenAI-Compatible Endpoint Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure lazycommit to use LM Studio or any other OpenAI-compatible endpoint for AI model inference. ```yaml # Use LM Studio or any OpenAI-compatible endpoint active_provider: openai providers: openai: api_key: "lm-studio" model: "local-model" endpoint_url: "http://localhost:1234/v1" ``` -------------------------------- ### Generate Commit Message Suggestions Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Generate commit message suggestions after staging changes. This command analyzes the staged diff and prints multiple suggestions. ```bash git add . lazycommit commit ``` -------------------------------- ### Generate Pull Request Titles Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Generate suggested pull request titles by comparing the current branch with a target branch. This command analyzes the diff and prints multiple title suggestions. ```bash lazycommit pr main ``` -------------------------------- ### Lazygit Basic Custom Command for AI Commits Source: https://context7.com/m7medvision/lazycommit/llms.txt Integrate lazycommit into Lazygit to pick AI-generated commit messages using Ctrl+A. This command directly commits the selected message. ```yaml customCommands: - key: "" # ctrl + a description: "pick AI commit" command: 'git commit -m "{{.Form.Msg}}"' context: "files" prompts: - type: "menuFromCommand" title: "ai Commits" key: "Msg" command: "lazycommit commit" filter: '^(?P.+)$' valueFormat: "{{ .raw }}" labelFormat: "{{ .raw | green }}" ``` -------------------------------- ### Generate Commit Messages Source: https://context7.com/m7medvision/lazycommit/llms.txt Stages changes and generates 10 commit message suggestions based on staged changes. Outputs one message per line for easy integration with other tools. ```bash git add . lazycommit commit ``` ```bash # Example output: # feat: add user authentication middleware # fix: resolve null pointer exception in user service # refactor: extract validation logic to separate module # docs: update API documentation for auth endpoints # chore: update dependencies to latest versions # feat: implement password reset functionality # fix: correct timezone handling in date formatter # style: format code according to project guidelines # test: add unit tests for authentication service # perf: optimize database queries for user lookup ``` -------------------------------- ### Commitizen Usage with cz-lazycommit (Bash) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md Execute a commit using Commitizen with the lazycommit plugin by running `git cz --name cz_lazycommit commit`. ```bash git cz --name cz_lazycommit commit ``` -------------------------------- ### Lazygit Custom Command for AI Commit Editing (YAML) Source: https://github.com/m7medvision/lazycommit/blob/main/README.md This Lazygit custom command allows selecting an AI commit message, saving it to `.git/COMMIT_EDITMSG`, opening it in the default editor, and then committing if the message is not empty. ```yaml - key: "" # ctrl + b description: "Pick AI commit (edit before committing)" context: "files" command: > bash -c 'msg="{{.Form.Msg}}"; echo "$msg" > .git/COMMIT_EDITMSG && ${EDITOR:-nvim} .git/COMMIT_EDITMSG && if [ -s .git/COMMIT_EDITMSG ]; then git commit -F .git/COMMIT_EDITMSG; else echo "Commit message is empty, commit aborted."; fi' prompts: - type: "menuFromCommand" title: "ai Commits" key: "Msg" command: "lazycommit commit" filter: '^(?P.+)$' valueFormat: "{{ .raw }}" labelFormat: "{{ .raw | green }}" output: terminal ``` -------------------------------- ### Lazygit Custom Command for Editing AI Commits Source: https://context7.com/m7medvision/lazycommit/llms.txt Configure Lazygit to allow editing AI-generated commit messages before committing using Ctrl+B. The message is opened in the default editor. ```yaml customCommands: - key: "" # ctrl + b description: "Pick AI commit (edit before committing)" context: "files" command: > bash -c 'msg="{{.Form.Msg}}"; echo "$msg" > .git/COMMIT_EDITMSG && ${EDITOR:-nvim} .git/COMMIT_EDITMSG && if [ -s .git/COMMIT_EDITMSG ]; then git commit -F .git/COMMIT_EDITMSG; else echo "Commit message is empty, commit aborted."; fi' prompts: - type: "menuFromCommand" title: "ai Commits" key: "Msg" command: "lazycommit commit" filter: '^(?P.+)$' valueFormat: "{{ .raw }}" labelFormat: "{{ .raw | green }}" output: terminal ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.