### Install and Configure AICommit2 CLI (Quick Start) Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Provides a rapid guide to globally installing AICommit2, setting up an API key for an AI provider like OpenAI, and using the tool within a Git repository to generate commit messages. ```sh # Install globally npm install -g aicommit2 # Set up at least one AI provider aicommit2 config set OPENAI.key= # Use in your git repository git add . aicommit2 ``` -------------------------------- ### Install project dependencies with pnpm Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md This command installs all required project dependencies using the pnpm package manager, ensuring the project has all necessary modules. ```sh pnpm i ``` -------------------------------- ### Install AICommit2 with Nix Package Manager Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Provides commands for installing AICommit2 temporarily or permanently using the Nix package manager, leveraging its flake for easy setup and management within a Nix environment. ```sh # Install temporarily in your current shell nix run github:tak-bro/aicommit2 # Install permanently to your profile nix profile install github:tak-bro/aicommit2 # Use the shorter alias nix run github:tak-bro/aic2 -- --help ``` -------------------------------- ### Install AICommit2 from Source Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Outlines the steps to clone the AICommit2 repository, build the project, and install it globally from the source code, useful for development, custom modifications, or specific build environments. ```sh git clone https://github.com/tak-bro/aicommit2.git cd aicommit2 npm run build npm install -g . ``` -------------------------------- ### Example Configurations for OpenAI API-Compatible Services in INI Format Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/compatible.md This snippet provides various example configurations in INI format for different OpenAI API-compatible services, including Together AI, Gemini, Ollama, and OpenRouter. It illustrates how to set `compatible`, `key`, `url`, `path`, `model`, and `envKey` for each provider. ```ini [TOGETHER] compatible=true key= url=https://api.together.xyz/v1 model=meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo [GEMINI_COMPATIBILITY] compatible=true key= url=https://generativelanguage.googleapis.com path=/v1beta/openai/ model=gemini-1.5-flash [OLLAMA_COMPATIBILITY] compatible=true key=ollama url=http://localhost:11434/v1 model=llama3.2 [OR_DEEPSEEK_R1] compatible=true url=https://openrouter.ai/api/v1 envKey=OPENROUTER_API_KEY model=deepseek/deepseek-r1:free [OR_QWEN3_235B_A22B] compatible=true url=https://openrouter.ai/api/v1 envKey=OPENROUTER_API_KEY model=qwen/qwen3-235b-a22b:free ``` -------------------------------- ### Manage aicommit2 Configurations via Command Line Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Shows how to read, set, and delete configuration settings using `aicommit2 config get`, `aicommit2 config set`, and `aicommit2 config del` commands. Includes examples for general, specific, and array-like settings. ```sh # Get all configurations aicommit2 config get # Get specific configuration aicommit2 config get OPENAI aicommit2 config get GEMINI.key # Set configurations aicommit2 config set OPENAI.generate=3 GEMINI.temperature=0.5 # Delete a configuration setting or section aicommit2 config del OPENAI.key aicommit2 config del GEMINI aicommit2 config del timeout ``` -------------------------------- ### Run project tests Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md These commands show how to run the project's tests. The first includes an OpenAI API key for full functionality testing, while the second runs tests that do not require the key. ```sh OPENAI_KEY= pnpm test ``` ```sh pnpm test ``` -------------------------------- ### Install Node.js version with nvm Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md This command uses nvm to install the Node.js version specified in the project's .nvmrc file, ensuring compatibility for development. ```sh nvm i ``` -------------------------------- ### Run project in development watch mode Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md Starts the build process in watch mode, automatically rebuilding the package on file changes for continuous development and immediate feedback. ```sh pnpm build -w ``` -------------------------------- ### Build the project package Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md Executes the build script defined in package.json to compile and bundle the project using pkgroll, preparing it for distribution or local execution. ```sh pnpm build ``` -------------------------------- ### Publish current branch to GitHub for testing Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md Uses `git-publish` to publish the current branch to a `npm/*` branch on the GitHub repository, making it available for installation and testing in other projects. ```sh $ pnpm dlx git-publish ✔ Successfully published branch! Install with command: → npm i 'tak-bro/aicommit2#npm/develop' ``` -------------------------------- ### Example Custom Template for AI Commit Message Generation Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Illustrates a sample custom template demonstrating how placeholders are integrated to guide the AI in generating commit messages. It also includes specific guidelines for the AI to follow regarding message style and content, ensuring desired output quality. ```template Generate a {type} commit message in {locale}. The message should not exceed {maxLength} characters. Please provide {generate} messages. Remember to follow these guidelines: 1. Use the imperative mood 2. Be concise and clear 3. Explain the 'why' behind the change ``` -------------------------------- ### Ollama Authentication Methods Examples Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This table illustrates various authentication methods supported by Ollama, detailing the corresponding values for `OLLAMA.auth` and `OLLAMA.key`. It provides examples for Bearer, Basic, JWT, OAuth 2.0, and HMAC-SHA256 authentication. ```APIDOC Authentication Method: Bearer OLLAMA.auth: Bearer OLLAMA.key: Authentication Method: Basic OLLAMA.auth: Basic OLLAMA.key: Authentication Method: JWT OLLAMA.auth: Bearer OLLAMA.key: Authentication Method: OAuth 2.0 OLLAMA.auth: Bearer OLLAMA.key: Authentication Method: HMAC-SHA256 OLLAMA.auth: HMAC OLLAMA.key: ``` -------------------------------- ### Manual Installation of aicommit2 Git Hook Script Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This snippet provides the content for manually setting up the `prepare-commit-msg` Git hook for aicommit2. Place this script in `.git/hooks/prepare-commit-msg` to enable aicommit2 to run in hook mode. ```sh #!/bin/sh # your-other-hook "$@" aicommit2 --hook-mode "$@" ``` -------------------------------- ### Run published GitHub branch locally Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md Executes the package directly from the published GitHub branch using `pnpm dlx`, allowing for local testing of changes made in a fork or branch. ```sh $ pnpm dlx 'tak-bro/aicommit2#npm/develop' # same as running `npx aicommit2` ``` -------------------------------- ### Run aicommit2 with API Keys from Environment Variables Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Provides an example of running the `aicommit2` command while simultaneously setting multiple API keys via environment variables, demonstrating their precedence over configuration file settings. ```sh OPENAI_API_KEY="your-openai-key" ANTHROPIC_API_KEY="your-anthropic-key" aicommit2 ``` -------------------------------- ### Install AICommit2 Globally via npm Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Details the command to install the AICommit2 CLI tool globally using npm, making it accessible from any directory in the system. This is the primary installation method for Node.js environments. ```sh npm install -g aicommit2 ``` -------------------------------- ### Run compiled package locally Source: https://github.com/tak-bro/aicommit2/blob/main/CONTRIBUTING.md These commands demonstrate how to execute the bundled CLI script locally. The first is for UNIX-like environments, directly running the executable. The second uses Node.js, suitable for non-UNIX environments. ```sh ./dist/cli.mjs ``` ```sh node ./dist/cli.mjs ``` -------------------------------- ### OpenAI API-Compatible Service Configuration Settings Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/compatible.md This section documents the available settings for configuring OpenAI API-compatible services. It details each setting's description, whether it is required, and its default value, providing a comprehensive reference for setup. ```APIDOC Setting: compatible Description: Enable OpenAI API compatibility mode Required: ✓ (must be true) Default: false Setting: url Description: Base URL of the API endpoint Required: ✓ Default: - Setting: path Description: API path for chat completions Required: Default: - Setting: key Description: API key for authentication Required: ✓ Default: - Setting: envKey Description: Custom environment variable name for the API key Required: Default: - Setting: model Description: Model identifier to use Required: ✓ Default: - ``` -------------------------------- ### Basic CLI Usage for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This example shows the fundamental way to use aicommit2 from the command line. After staging your changes with `git add`, simply run `aicommit2` to generate and apply an AI-suggested commit message. ```sh git add aicommit2 ``` -------------------------------- ### Configure Perplexity AI Basic Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/perplexity.md This snippet demonstrates how to set the essential Perplexity API key and default model using the `aicommit2 config set` command for a basic setup. ```sh aicommit2 config set PERPLEXITY.key="your-api-key" aicommit2 config set PERPLEXITY.model="sonar-pro" ``` -------------------------------- ### Example of aicommit2 CLI with Multiple Options Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This example demonstrates how to combine several `aicommit2` command-line options in a single invocation. It configures the locale, stages all changes, sets the commit type, generates multiple messages, copies to clipboard, and excludes specific file types from AI analysis. ```sh aicommit2 --locale "jp" --all --type "conventional" --generate 3 --clipboard --exclude "*.json" --exclude "*.ts" ``` -------------------------------- ### Configure Basic Mistral API Settings Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/mistral.md This snippet demonstrates how to set the essential API key and model for Mistral using `aicommit2`'s configuration command. It's a quick way to get started with the Mistral integration. ```sh aicommit2 config set MISTRAL.key="your-api-key" aicommit2 config set MISTRAL.model="codestral-latest" ``` -------------------------------- ### Configure Anthropic API Key and Model (Basic) Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/anthropic.md Demonstrates the fundamental commands to set the Anthropic API key and a default model using `aicommit2 config set`. This is the minimum required setup to use Anthropic services. ```sh aicommit2 config set ANTHROPIC.key="your-api-key" aicommit2 config set ANTHROPIC.model="claude-3-5-haiku-20241022" ``` -------------------------------- ### Automatic Installation of aicommit2 Git Hook Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This command automatically installs the `aicommit2` Git hook within the current Git repository. It configures aicommit2 to run as part of the `prepare-commit-msg` hook, streamlining the commit message generation process. ```sh aicommit2 hook install ``` -------------------------------- ### Check Installed Version of aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Displays the current version of the aicommit2 tool installed on the system. This command is useful for verifying the installed software version before considering an upgrade to the latest release. ```sh aicommit2 --version ``` -------------------------------- ### Run Ollama with a Specific Model Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This command starts the Ollama server and loads a specified large language model, such as `llama3.2`, `codellama`, or `deepseek-coder`. It's the initial step to make a model available for use. ```shell ollama run llama3.2 # model you want use. ex) codellama, deepseek-coder ``` -------------------------------- ### Configure aicommit2 Settings via INI Configuration File Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Illustrates the structure and syntax for configuring `aicommit2` using a `config.ini` file. It includes examples for general settings, model-specific parameters, and handling array-like values such as multiple models. ```ini # General Settings logging=true generate=2 temperature=1.0 # Model-Specific Settings [OPENAI] key="" temperature=0.8 generate=1 model="gpt-4o,gpt-3.5-turbo" systemPromptPath="" [GEMINI] key="" generate=5 includeBody=true model="gemini-pro,gemini-flash" [OLLAMA] temperature=0.7 model[]=llama3.2 model[]=codestral ``` -------------------------------- ### Execute aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This command runs aicommit2 after it has been configured. Ensure Ollama version 0.1.33+ and aicommit2 version 1.9.5+ are installed for multi-model support. ```shell aicommit2 ``` -------------------------------- ### Upgrade aicommit2 Global Installation via npm Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Updates the globally installed aicommit2 package to its latest available version using the npm package manager. This ensures users benefit from the newest features, bug fixes, and performance improvements. ```sh npm update -g aicommit2 ``` -------------------------------- ### Set Specific Groq Model for aicommit2 Configuration Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/groq.md Provides an example of how to explicitly configure the `GROQ.model` setting to 'llama-3.3-70b-versatile' using the `aicommit2 config set` command, overriding the default model. ```sh aicommit2 config set GROQ.model="llama-3.3-70b-versatile" ``` -------------------------------- ### Get Current aicommit2 Configuration File Path Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Demonstrates how to use the `aicommit2 config path` command to display the location of the currently loaded configuration file, following the XDG Base Directory Specification. ```sh aicommit2 config path ``` -------------------------------- ### Set Specific Anthropic Model via Command Line Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/anthropic.md Provides a command-line example for explicitly setting the Anthropic model to be used. This allows users to switch between different supported Claude models. ```sh aicommit2 config set ANTHROPIC.model="claude-3-5-sonnet-20240620" ``` -------------------------------- ### Launch Ollama Server with Model Limit Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This command launches the Ollama server, setting the maximum number of models that can be loaded simultaneously using the OLLAMA_MAX_LOADED_MODELS environment variable. For example, setting it to 3 allows up to three models to be loaded. ```shell OLLAMA_MAX_LOADED_MODELS=3 ollama serve ``` -------------------------------- ### Mistral API Configuration Settings Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/mistral.md This section provides a reference for available configuration settings for the Mistral API. It lists parameters like API key and model, along with their descriptions and default values, guiding users on how to customize their Mistral integration. ```APIDOC Mistral Configuration: key: Type: string Description: The Mistral API key. Sign up and subscribe in Mistral Console (https://console.mistral.ai/). Default: - model: Type: string Description: The model to use for Mistral API calls. Default: pixtral-12b-2409 Supported Values: - codestral-latest - mistral-large-latest - pixtral-large-latest - ministral-8b-latest - mistral-small-latest - mistral-embed - mistral-moderation-latest ``` -------------------------------- ### Add aicommit2 to VSCode Devcontainer Features Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This snippet demonstrates how to integrate aicommit2 into a VSCode Devcontainer setup. By adding the specified feature to your `devcontainer.json` file, aicommit2 will be automatically available within your development container environment. ```json { "features": { "ghcr.io/kvokka/features/aicommit2:1": {} } } ``` -------------------------------- ### aicommit2 CLI Usage with Git Commit Flags Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Illustrates how aicommit2 can forward unknown flags directly to the underlying `git commit` command. This specific example uses the `--all` (or `-a`) flag to automatically stage all changes in tracked files before generating the commit message. ```sh aicommit2 --all # or -a ``` -------------------------------- ### Required JSON Output Format for AI Commit Messages Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Specifies the mandatory JSON array format for AI-generated commit messages, which is always appended to custom prompts. It defines the 'subject', 'body', and 'footer' keys and provides an example to ensure consistent parsing and data structure. ```text Lastly, Provide your response as a JSON array containing exactly {generate} object, each with the following keys: - "subject": The main commit message using the {type} style. It should be a concise summary of the changes. - "body": An optional detailed explanation of the changes. If not needed, use an empty string. - "footer": An optional footer for metadata like BREAKING CHANGES. If not needed, use an empty string. The array must always contain {generate} element, no more and no less. Example response format: [ { "subject": "fix: fix bug in user authentication process", "body": "- Update login function to handle edge cases\n- Add additional error logging for debugging", "footer": "" } ] Ensure you generate exactly {generate} commit message, even if it requires creating slightly varied versions for similar changes. The response should be valid JSON that can be parsed without errors. ``` ```json [ { "subject": "fix: fix bug in user authentication process", "body": "- Update login function to handle edge cases\n- Add additional error logging for debugging", "footer": "" } ] ``` -------------------------------- ### Set up AICommit2 Nix Development Environment Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Explains how to enter a development shell with all necessary dependencies for AICommit2 using Nix, facilitating contributions or deeper exploration of the project's source code and functionality. ```sh nix develop github:tak-bro/aicommit2 ``` -------------------------------- ### Configure Groq Basic API Key and Model for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/groq.md Demonstrates how to set the fundamental Groq API key and preferred model using simple `aicommit2 config set` commands, essential for initial integration. ```sh aicommit2 config set GROQ.key="your-api-key" aicommit2 config set GROQ.model="gemma2-9b-it" ``` -------------------------------- ### Groq API Configuration Settings Reference for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/groq.md Comprehensive documentation of Groq API configuration settings available in aicommit2, detailing parameters like `key` and `model`, their descriptions, default values, and a complete list of supported models. ```APIDOC Settings Table: | Setting | Description | Default | | ------- | ----------- | ------- | | `key` | API key | - | | `model` | Model to use| `llama-3.3-70b-versatile` | Detailed Configuration: GROQ.key: Description: The Groq API key. If you don't have one, please sign up and get the API key in Groq Console. Link: https://console.groq.com GROQ.model: Default: `llama-3.3-70b-versatile` Supported Models: - `allam-2-7b` - `compound-beta` - `compound-beta-mini` - `deepseek-r1-distill-llama-70b` - `distil-whisper-large-v3-en` - `gemma2-9b-it` - `llama-3.1-8b-instant` - `llama-3.3-70b-versatile` - `llama-guard-3-8b` - `llama3-70b-8192` - `llama3-8b-8192` - `meta-llama/llama-4-maverick-17b-128e-instruct` - `meta-llama/llama-4-scout-17b-16e-instruct` - `mistral-saba-24b` - `playai-tts` - `playai-tts-arabic` - `qwen-qwq-32b` - `whisper-large-v3` - `whisper-large-v3-turbo` ``` -------------------------------- ### Configure AICommit2 API Keys Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Explains how to set up API keys for various AI providers using the 'aicommit2 config set' command, which is essential for the tool's operation. At least one key must be configured for AI services to function. ```sh aicommit2 config set OPENAI.key= aicommit2 config set ANTHROPIC.key= # ... (similar commands for other providers) ``` -------------------------------- ### aicommit2 General Settings Compatibility by AI Model Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This table outlines which general configuration settings are supported by various AI models within aicommit2. It helps users understand the available options for each specific AI provider. ```APIDOC Available General Settings by Model: - OpenAI: timeout, temperature, maxTokens, topP - Anthropic Claude: timeout, temperature, maxTokens, topP - Gemini: temperature, maxTokens, topP - Mistral AI: timeout, temperature, maxTokens, topP - Codestral: timeout, temperature, maxTokens, topP - Cohere: timeout, temperature, maxTokens, topP - Groq: timeout, temperature, maxTokens, topP - Perplexity: timeout, temperature, maxTokens, topP - DeepSeek: timeout, temperature, maxTokens, topP - Ollama: timeout, temperature, topP - OpenAI API-Compatible: timeout, temperature, maxTokens, topP All AI support the following options in General Settings: - systemPrompt - systemPromptPath - codeReview - codeReviewPromptPath - exclude - type - locale - generate - logging - includeBody - maxLength ``` -------------------------------- ### Configure aicommit2 for Ollama Host, Model, and Context Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md These commands configure `aicommit2` to connect to the Ollama server, specify the model to use, and set the context window size (`numCtx`). A higher `numCtx` value like `4096` is recommended for better performance. ```sh aicommit2 config set OLLAMA.host= aicommit2 config set OLLAMA.model= aicommit2 config set OLLAMA.numCtx=4096 ``` -------------------------------- ### aicommit2 OpenAI Provider Configuration Settings Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/openai.md Detailed documentation for configuring the OpenAI provider within aicommit2, including descriptions, default values, and usage notes for each setting. ```APIDOC Settings: key: Description: API key Default: - model: Description: Model to use Default: gpt-4o-mini url: Description: API endpoint URL Default: https://api.openai.com path: Description: API path Default: /v1/chat/completions proxy: Description: Proxy settings Default: - Detailed Configuration: OPENAI.key: Description: The OpenAI API key. You can retrieve it from OpenAI API Keys page. OPENAI.model: Default: gpt-4o-mini Description: The Chat Completions (/v1/chat/completions) model to use. Consult the list of models available in the OpenAI Documentation. OPENAI.url: Default: https://api.openai.com Description: The OpenAI URL. Both https and http protocols supported. It allows to run local OpenAI-compatible server. OPENAI.path: Default: /v1/chat/completions Description: The OpenAI Path. OPENAI.topP: Default: 0.9 Description: The `top_p` parameter selects tokens whose combined probability meets a threshold. Please see detail. Note: If `topP` is less than 0, it does not deliver the `top_p` parameter to the request. ``` -------------------------------- ### Configure Together AI with aicommit2 CLI Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/compatible.md This snippet demonstrates how to configure Together AI as an OpenAI API-compatible service using the `aicommit2` command-line interface. It shows the necessary commands to enable compatibility mode, set the API URL, path, model, and API key. ```sh aicommit2 config set TOGETHER.compatible=true aicommit2 config set TOGETHER.url=https://api.together.xyz aicommit2 config set TOGETHER.path=/v1 aicommit2 config set TOGETHER.model=meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo aicommit2 config set TOGETHER.key="your-api-key" ``` -------------------------------- ### Configure aicommit2 AI Model Parameters Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This command demonstrates how to set various configuration options for aicommit2, including the number of generations, topP, maxTokens, and temperature. It also shows how to configure API keys and specific model settings for different AI providers like OpenAI, Anthropic, Mistral, and Ollama. ```sh aicommit2 config set \ generate=2 \ topP=0.8 \ maxTokens=1024 \ temperature=0.7 \ OPENAI.key="sk-..." OPENAI.model="gpt-4o" OPENAI.temperature=0.5 \ ANTHROPIC.key="sk-..." ANTHROPIC.model="claude-3-haiku" ANTHROPIC.maxTokens=2000 \ MISTRAL.key="your-key" MISTRAL.model="codestral-latest" \ OLLAMA.model="llama3.2" OLLAMA.numCtx=4096 OLLAMA.watchMode=true ``` -------------------------------- ### aicommit2 Application Logging Configuration (Winston) Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Details the configuration options for aicommit2's general application logging system, powered by Winston. It explains `logLevel`, `logFilePath`, and `exceptionLogFilePath` settings, including their descriptions, default values, and supported levels for controlling log verbosity and file locations. ```APIDOC Application Logging (Winston) Configuration: logLevel: Description: Specifies the minimum level for logs to be recorded. Messages with a level equal to or higher than the configured logLevel will be captured. Default: info Supported Levels: error, warn, info, http, verbose, debug, silly logFilePath: Description: Defines the path to the main application log file. This setting supports date patterns (e.g., %DATE%) to automatically rotate log files daily. Default: logs/aicommit2-%DATE%.log (relative to the application's state directory, typically ~/.local/state/aicommit2/logs on Linux or ~/Library/Application Support/aicommit2/logs on macOS). exceptionLogFilePath: Description: Specifies the path to a dedicated log file for recording exceptions. Similar to logFilePath, it supports date patterns for daily rotation. Default: logs/exceptions-%DATE%.log (relative to the application's state directory, typically ~/.local/state/aicommit2/logs on Linux or ~/Library/Application Support/aicommit2/logs on macOS). ``` -------------------------------- ### Configure Custom System Prompt Text Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Shows how to set a custom system prompt directly via the configuration, which takes precedence over a system prompt file path. This allows users to define the AI's initial instructions. ```shell aicommit2 config set systemPrompt="Generate git commit message." ``` -------------------------------- ### Gemini Configuration Settings API Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/gemini.md Detailed reference for available configuration settings for Gemini API integration with `aicommit2`, including descriptions, default values, supported models, and unsupported options. ```APIDOC Settings: key: Description: API key Default: - model: Description: Model to use Default: gemini-2.0-flash Supported Models: - gemini-2.5-flash-preview-04-17 - gemini-2.5-flash-preview-05-20 - gemini-2.5-pro-preview-05-06 - gemini-2.0-flash - gemini-2.0-flash-lite - gemini-2.0-flash-preview-image-generation - gemini-1.5-pro - gemini-1.5-flash - gemini-1.5-flash-8b Unsupported Options: - timeout ``` -------------------------------- ### Configure General Settings for AI Models Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Demonstrates how to apply general settings to specific AI models using the `aicommit2 config set` command, allowing per-model customization of parameters like locale, commit type, and body inclusion. ```shell aicommit2 config set OPENAI.locale="jp" aicommit2 config set CODESTRAL.type="gitmoji" aicommit2 config set GEMINI.includeBody=true ``` -------------------------------- ### Configure OpenAI Basic Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/openai.md Sets the essential OpenAI API key and model for aicommit2 using the `config set` command. ```sh aicommit2 config set OPENAI.key="your-api-key" aicommit2 config set OPENAI.model="gpt-4o" ``` -------------------------------- ### Configure Basic Gemini API Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/gemini.md Sets the essential Gemini API key and model using `aicommit2` for basic integration. ```sh aicommit2 config set GEMINI.key="your-api-key" aicommit2 config set GEMINI.model="gemini-2.0-flash" ``` -------------------------------- ### aicommit2 CLI Options Reference Source: https://github.com/tak-bro/aicommit2/blob/main/README.md A comprehensive reference for all available command-line options for the `aicommit2` CLI tool. Each option controls a specific aspect of the AI commit message generation process, including locale, staging behavior, message format, and output handling. ```APIDOC CLI Options: - --locale (-l): Locale to use for the generated commit messages (default: en) - --all (-a): Automatically stage changes in tracked files for the commit (default: false) - --type (-t): Git commit message format (conventional, gitmoji) (default: conventional) - --confirm (-y): Skip confirmation when committing after message generation (default: false) - --clipboard (-c): Copy the selected message to the clipboard (disables commit) (default: false) - --generate (-g): Number of messages to generate (default: 1) - --exclude (-x): Files to exclude from AI analysis - --hook-mode: Run as a Git hook, typically used with prepare-commit-msg hook (default: false) - --pre-commit: Run in pre-commit framework mode (default: false) ``` -------------------------------- ### Anthropic API Configuration Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/anthropic.md Comprehensive documentation of the available configuration settings for the Anthropic API within aicommit2. It details the `key` and `model` parameters, including their descriptions, default values, and a list of all supported Anthropic Claude models. ```APIDOC ANTHROPIC.key: Description: The Anthropic API key. To get started with Anthropic Claude, request access to their API at anthropic.com/earlyaccess. Default: - ANTHROPIC.model: Description: The specific Anthropic model to use for AI operations. Default: claude-3-5-haiku-20241022 Supported Models: - claude-opus-4-20250514 - claude-sonnet-4-20250514 - claude-3-7-sonnet-20250219 - claude-3-5-sonnet-20241022 - claude-3-5-haiku-20241022 - claude-3-opus-20240229 - claude-3-sonnet-20240229 - claude-3-haiku-20240307 ``` -------------------------------- ### Configure AI Service API Keys with Environment Variables Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Illustrates how to set API keys for various AI services (OpenAI, Anthropic, Google, Mistral AI, Cohere, Groq, Perplexity, Deepseek) using environment variables. This method is useful for CI/CD or avoiding storing keys in config files. ```bash # OpenAI OPENAI_API_KEY="your-openai-key" # Anthropic ANTHROPIC_API_KEY="your-anthropic-key" # Google GEMINI_API_KEY="your-gemini-key" # Mistral AI MISTRAL_API_KEY="your-mistral-key" CODESTRAL_API_KEY="your-codestral-key" # Other Providers COHERE_API_KEY="your-cohere-key" GROQ_API_KEY="your-groq-key" PERPLEXITY_API_KEY="your-perplexity-key" DEEPSEEK_API_KEY="your-deepseek-key" ``` -------------------------------- ### Ollama Configuration Settings Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This table provides a comprehensive reference for various Ollama configuration settings available in `aicommit2`. It details each setting's purpose, default value, and impact on model behavior, such as context length and output limits. ```APIDOC Setting: model Description: Model(s) to use (comma-separated list) Default: - Setting: host Description: Ollama host URL Default: http://localhost:11434 Setting: auth Description: Authentication type Default: Bearer Setting: key Description: Authentication key Default: - Setting: numCtx Description: The maximum number of tokens the model can process at once Default: 2048 Setting: maxTokens Description: The maximum number of output tokens (maps to num_predict) Default: -1 (infinite generation) ``` -------------------------------- ### Cohere API Configuration Settings Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/cohere.md Details the available configuration settings for integrating Cohere with aicommit2, including the API key, model selection, and a list of supported models. ```APIDOC Cohere Configuration Settings: COHERE.key: Description: The Cohere API key. If you don't have one, please sign up and get the API key in Cohere Dashboard (https://dashboard.cohere.com/). Default: - COHERE.model: Description: The model to use for Cohere API calls. Default: command Supported Models: - command-r7b-12-2024 - command-r-plus-08-2024 - command-r-plus-04-2024 - command-r-plus - command-r-08-2024 - command-r-03-2024 - command-r - command - command-nightly - command-light - command-light-nightly - c4ai-aya-expanse-8b - c4ai-aya-expanse-32b ``` -------------------------------- ### Advanced aicommit2 Ollama Configuration Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/ollama.md This command demonstrates how to set multiple advanced Ollama parameters simultaneously, including the model, context window, temperature, locale, generation count, top-p sampling, and maximum output tokens. These settings allow fine-tuning of the model's behavior. ```sh aicommit2 config set OLLAMA.model="codellama" \ OLLAMA.numCtx=4096 \ OLLAMA.temperature=0.7 \ OLLAMA.locale="en" \ OLLAMA.generate=3 \ OLLAMA.topP=0.9 \ OLLAMA.maxTokens=4000 ``` -------------------------------- ### Configure Groq Advanced API Parameters for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/groq.md Illustrates setting multiple Groq API parameters, including key, model, temperature, max tokens, locale, generation count, and top-P, to fine-tune AI behavior within aicommit2. ```sh aicommit2 config set GROQ.key="your-api-key" \ GROQ.model="gemma2-9b-it" \ GROQ.temperature=0.7 \ GROQ.maxTokens=4000 \ GROQ.locale="en" \ GROQ.generate=3 \ GROQ.topP=0.9 ``` -------------------------------- ### Configure Perplexity AI Advanced Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/perplexity.md This snippet shows how to configure advanced parameters for Perplexity AI, including API key, model, temperature, max tokens, locale, generate count, and topP, using a single `aicommit2 config set` command. ```sh aicommit2 config set PERPLEXITY.key="your-api-key" \ PERPLEXITY.model="sonar-pro" \ PERPLEXITY.temperature=0.7 \ PERPLEXITY.maxTokens=4000 \ PERPLEXITY.locale="en" \ PERPLEXITY.generate=3 \ PERPLEXITY.topP=0.9 ``` -------------------------------- ### Integrate aicommit2 with pre-commit Framework Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This YAML configuration snippet shows how to integrate aicommit2 into your `.pre-commit-config.yaml` file. It defines a local hook that runs `aicommit2` in `--pre-commit` mode, ensuring compatibility and proper execution within the pre-commit framework. ```yaml repos: - repo: local hooks: - id: aicommit2 name: AI Commit Message Generator entry: aicommit2 --pre-commit language: node stages: [prepare-commit-msg] always_run: true ``` -------------------------------- ### Perplexity AI Configuration Settings Reference Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/perplexity.md This section provides a reference for available configuration settings for Perplexity AI within aicommit2, including descriptions, default values, and supported models. ```APIDOC Settings: key: API key (Default: -) model: Model to use (Default: sonar) PERPLEXITY.key: Description: The Perplexity API key. Sign up at Perplexity to obtain one. PERPLEXITY.model: Default: sonar Supported Models: - sonar-pro - sonar - llama-3.1-sonar-small-128k-online - llama-3.1-sonar-large-128k-online - llama-3.1-sonar-huge-128k-online Note: Models are subject to change. ``` -------------------------------- ### Integrate AICommit2 into Nix Flake Project Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Shows how to add AICommit2 as an input to a Nix flake and include it in system or home packages, enabling its use within a Nix-managed project environment and ensuring reproducible builds. ```nix { # flake.nix configuration file inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; aicommit2.url = "github:tak-bro/aicommit2"; }; # Rest of your flake.nix file } # Somewhere where you define your packages {pkgs, inputs, ...}:{ environment.systemPackages = [inputs.aicommit2.packages.x86_64-linux.default]; # Or home packages home.packages = [inputs.aicommit2.packages.x86_64-linux.default]; } ``` -------------------------------- ### Configure Deepseek API Key and Model (Basic) Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/deepseek.md This snippet demonstrates the basic configuration for Deepseek, setting the API key and the default chat model using `aicommit2`. ```sh aicommit2 config set DEEPSEEK.key="your-api-key" aicommit2 config set DEEPSEEK.model="deepseek-chat" ``` -------------------------------- ### Specify Custom System Prompt File Path Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Demonstrates how to configure a path to a custom system prompt template file. Paths can be absolute or relative to the configuration file, enabling external management of prompt content. ```shell aicommit2 config set systemPromptPath="/path/to/user/prompt.txt" ``` -------------------------------- ### Configure Custom Prompt Templates for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/README.md This command demonstrates how to set a custom prompt template file path for aicommit2 using the `systemPromptPath` option. It shows both a global setting and an override for a specific AI service (OpenAI), allowing tailored prompt structures for commit message generation. ```sh aicommit2 config set systemPromptPath="/path/to/user/prompt.txt" aicommit2 config set OPENAI.systemPromptPath="/path/to/another-prompt.txt" ``` -------------------------------- ### Configure OpenAI Advanced Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/openai.md Sets multiple advanced OpenAI parameters including API key, model, temperature, max tokens, locale, generate count, and topP for fine-grained control. ```sh aicommit2 config set OPENAI.key="your-api-key" \ OPENAI.model="gpt-4o" \ OPENAI.temperature=0.7 \ OPENAI.maxTokens=4000 \ OPENAI.locale="en" \ OPENAI.generate=3 \ OPENAI.topP=0.9 ``` -------------------------------- ### Instruct ChatGPT to act as Git CLI Source: https://github.com/tak-bro/aicommit2/blob/main/tests/fixtures/README.md This prompt configures ChatGPT to simulate a git command-line interface, allowing it to generate random git diffs based on subsequent user input specifying the type of change. ```Natural Language I want you to act as a git cli I will give you the type of content and you will generate a random git diff based on that ``` -------------------------------- ### Configure Basic Cohere API Settings for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/cohere.md Sets the essential API key and default model for Cohere integration with aicommit2. This is the minimum configuration required to use Cohere. ```sh aicommit2 config set COHERE.key="your-api-key" aicommit2 config set COHERE.model="command" ``` -------------------------------- ### Configure Deepseek with Advanced Settings Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/deepseek.md This snippet shows how to configure Deepseek with additional parameters like temperature, max tokens, locale, generate count, and topP, providing more control over the model's behavior. ```sh aicommit2 config set DEEPSEEK.key="your-api-key" \ DEEPSEEK.model="deepseek-chat" \ DEEPSEEK.temperature=0.7 \ DEEPSEEK.maxTokens=4000 \ DEEPSEEK.locale="en" \ DEEPSEEK.generate=3 \ DEEPSEEK.topP=0.9 ``` -------------------------------- ### Configure aicommit2 Settings via Command-Line Arguments Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Shows how to override or set `aicommit2` configuration parameters directly through command-line arguments, including specifying multiple models using a comma-separated format. Command-line arguments have the highest precedence. ```sh aicommit2 --OPENAI.locale="jp" --GEMINI.temperature="0.5" --OPENAI.model="gpt-4o,gpt-3.5-turbo" ``` -------------------------------- ### Make Manual Git Hook Executable for aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/README.md After manually creating or editing the `prepare-commit-msg` Git hook file, this command is necessary to make it executable. This ensures the Git hook system can properly invoke the aicommit2 script. ```sh chmod +x .git/hooks/prepare-commit-msg ``` -------------------------------- ### Configure Advanced Gemini API Settings with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/gemini.md Sets comprehensive Gemini API parameters including key, model, temperature, max tokens, locale, generate count, and topP for fine-tuned control. ```sh aicommit2 config set GEMINI.key="your-api-key" \ GEMINI.model="gemini-2.0-flash" \ GEMINI.temperature=0.7 \ GEMINI.maxTokens=4000 \ GEMINI.locale="en" \ GEMINI.generate=3 \ GEMINI.topP=0.9 ``` -------------------------------- ### Use AICommit2 in a Git Repository Source: https://github.com/tak-bro/aicommit2/blob/main/README.md Demonstrates the basic workflow for using AICommit2 within a Git repository, involving staging files and then running the 'aicommit2' command to generate commit messages based on the staged changes. ```sh git add aicommit2 ``` -------------------------------- ### Set Perplexity AI Model with aicommit2 Source: https://github.com/tak-bro/aicommit2/blob/main/docs/providers/perplexity.md This snippet demonstrates how to specifically set the Perplexity AI model using the `aicommit2 config set` command. ```sh aicommit2 config set PERPLEXITY.model="sonar-pro" ```