Kokonut Commit is a small CLI for working with Git hooks and basic action setup flows. The current command set focuses on four areas:
This package is published as a GitHub Action and also exposes a CLI binary named
kokonut-commit.
npm install -g kokonut-commit-actionIf you are using it inside this repository, you can also run the bundled CLI directly from the project workspace.
Install the default hook in the current repository:
kokonut-commit hook setStore and read values from .kokonutrc files.
kokonut-commit config set <key> <value>
kokonut-commit config set <key> <value> --global
kokonut-commit config get <key>
kokonut-commit config listExamples:
kokonut-commit config set provider openai
kokonut-commit config set apiUrl https://api.example.com/v1 --global
kokonut-commit config get provider
kokonut-commit config listcfg is accepted as a shorthand alias for config.
kokonut-commit cfg set provider ollama
kokonut-commit cfg listSave the provider and API credentials in the local .kokonutrc file.
kokonut-commit setup --provider <provider> --api-key <key> [--api-url <url>]Examples:
kokonut-commit setup --provider openai --api-key sk-your-key
kokonut-commit setup --provider ollama --api-key local-token --api-url http://localhost:11434/api/modelsInteractive behavior:
- Running
kokonut-commit setupwithout flags launches an interactive wizard. - The wizard asks whether to save credentials globally; answer
yto store them in~/.kokonutrc. - You can also pass
--globalwith the non-interactive form to save directly to the global config.
List models for the configured provider.
kokonut-commit modelsExamples of supported configuration sources:
kokonut-commit config set provider openai
kokonut-commit config set apiKey sk-your-key
kokonut-commit modelsKOKONUT_PROVIDER=ollama KOKONUT_API_URL=http://localhost:11434/api/models kokonut-commit modelsIf no API key or custom API URL is configured, the CLI prints a setup hint and exits successfully.
When run interactively (stdout attached to a TTY), kokonut-commit models
will prompt to enter and save an API key if none is configured.
Manage the prepare-commit-msg hook.
kokonut-commit hook set
kokonut-commit hook unsetDefault repository hook examples:
kokonut-commit hook set
kokonut-commit hook unsetCustom hook directory examples:
kokonut-commit hook set --usr .git/custom-hooks
kokonut-commit hook unset --usr .git/custom-hooksAbsolute custom hook directory examples:
kokonut-commit hook set --usr C:\\Users\\you\\kokonut-commit-hooks
kokonut-commit hook unset --usr C:\\Users\\you\\kokonut-commit-hooksGlobal hook examples:
kokonut-commit hook set --global
kokonut-commit hook unset --globalBehavior notes:
--usrresolves relative paths from the current working directory.--globalstores the hook under your home directory and updates the Git global hooks path when possible.hook setandhook unsetare repository-scoped unless--globalor--usris provided.- By default
hook setwill try to create a symlink to the packaged CLI (dist/cli.js) inside.git/hooks/prepare-commit-msg. On systems where symlink creation is not permitted it falls back to writing a small stub that invokesscripts/prepare-commit-msg.cjs.
Kokonut Commit reads configuration from these locations:
- Local:
.kokonutrcin the current repository - Global:
~/.kokonutrc
Local values override global values when both exist.
Set up a repository with OpenAI credentials and install the local hook:
kokonut-commit setup --provider openai --api-key sk-your-key
kokonut-commit hook setUse a shared hook directory in the repository:
kokonut-commit hook set --usr .git/shared-hooks
git config --local core.hooksPath .git/shared-hooksInstall the hook globally for your user profile:
kokonut-commit hook set --globalInspect the current configuration:
kokonut-commit config listKokonut Commit supports the following AI providers for commit message generation:
| Index | Provider | API Endpoint | API Token Environment |
|---|---|---|---|
| 0 | Google Gemini | generativelanguage.googleapis.com |
KOKONUT_API_KEY |
| 1 | OpenAI | api.openai.com |
KOKONUT_API_KEY |
| 2 | Anthropic Claude | api.anthropic.com |
KOKONUT_API_KEY |
| 3 | Mistral Le Chat | api.mistral.ai |
KOKONUT_API_KEY |
| 4 | Deepseek | api.deepseek.com |
KOKONUT_API_KEY |
| 5 | Grok | api.x.ai |
KOKONUT_API_KEY |
| 6 | Hugging Face | api-inference.huggingface.co |
KOKONUT_API_KEY |
When used as a GitHub Action, select exactly one provider with the matching boolean input:
| Provider | Input flag |
|---|---|
| Google Gemini | isGoogleGemini |
| OpenAI ChatGPT | isOpenAIChatGPT |
| Anthropic Claude | isAnthropicClaude |
| Mistral Le Chat | isMistralLeChat |
| Deepseek | isDeepseek |
| Grok | isGrok |
| Hugging Face | isHuggingFace |
Configure the provider and API key:
# Using CLI
kokonut-commit config set provider 1 # OpenAI
kokonut-commit config set apiKey sk-your-api-key
# Using environment variables
export KOKONUT_PROVIDER=1
export KOKONUT_API_KEY=sk-your-api-keyEach provider offers different models. The CLI automatically selects a reasonable default:
- Google Gemini:
gemini-pro - OpenAI:
gpt-3.5-turboorgpt-4 - Anthropic Claude:
claude-2orclaude-3 - Mistral:
mistral-tiny - Deepseek:
deepseek-chat - Grok:
grok-beta - Hugging Face:
mistralai/Mistral-7B-Instruct-v0.2
Kokonut Commit includes sensible defaults for maximum AI customization:
{
"version": "0.0.0",
"provider": 1,
"temperature": 0.7,
"topP": 0.9,
"topK": 40,
"maxTokens": 65536,
"frequencyPenalty": 0,
"presencePenalty": 0,
"stopSequences": [],
"prefix": "",
"includeEmojis": true
}The config system uses semantic versioning aligned with project releases. Currently, all configurations use v0.0.0.
Current Version (v0.0.0) Defaults:
All parameters include full AI model customization for all 7 providers:
{
"version": "0.0.0",
"provider": 1,
"temperature": 0.7,
"topP": 0.9,
"topK": 40,
"convergence": 0.5,
"maxTokens": 256,
"frequencyPenalty": 0,
"presencePenalty": 0,
"prefix": "",
"includeEmojis": true
}Key Points:
- Your configuration is automatically validated when loaded
- Missing values are filled with sensible defaults
- Invalid configurations trigger validation warnings
- All 7 AI providers support the complete parameter set
- Future versions will support automatic migrations if needed
Configuration values are validated for all parameters:
Sampling Parameters:
provider: Integer 0-6 (selects AI provider)temperature: Float 0-2 (controls response randomness/creativity)topP: Float 0-1 (nucleus sampling - probability threshold)topK: Integer 0-100 (top-k sampling - number of candidates)convergence: Float 0-1 (convergence threshold for response stopping)
Token & Penalty Parameters:
maxTokens: Integer 1-4096 (maximum response length in tokens)frequencyPenalty: Float -2 to 2 (penalizes repeated tokens)presencePenalty: Float -2 to 2 (penalizes new topics)
Formatting Parameters:
prefix: String (added to all commit messages)includeEmojis: Boolean (add commit type emoji)
Examples of setting advanced parameters:
# Via CLI config set
kokonut-commit config set temperature 0.5
kokonut-commit config set topK 50
kokonut-commit config set maxTokens 512
kokonut-commit config set frequencyPenalty 0.5
# Via setup with flags
kokonut-commit setup --provider 2 --api-key sk-key \
--temperature 0.6 --top-k 40 --max-tokens 256- Run hook commands from the repository root when you want the default local behavior.
- The CLI prints clear usage help when a required argument is missing.
- The
dist/folder is generated fromsrc/and should stay in sync with the TypeScript source. - All 7 AI providers support the complete configuration parameter set for maximum customization.
- Configuration parameters are provider-agnostic - use the same config for any provider.