Configuration

Configure nocommit for your workflow.

nocommit is designed to work great out of the box, but it's also highly configurable. Here's how to tailor nocommit to your workflow.

Configuration Storage

nocommit stores config via conf, which puts settings wherever your OS expects them. You can manage everything through nocommit's commands—no need to touch the file directly.

Reading Configuration Values

To retrieve a specific configuration option:

nocommit config get <key>

For example, to retrieve the model:

nocommit config get model

To view all configuration values at once:

nocommit config get

This displays all current settings, with API keys partially masked for security.

Setting Configuration Values

To set a configuration option:

nocommit config set <key>=<value>

For example, to set the API key:

nocommit config set GEMINI_API_KEY=<your-api-key>

Available Options

GEMINI_API_KEY

Required

The Google Gemini API key. You can get one for free from Google AI Studio.

nocommit config set GEMINI_API_KEY=<your token>

model

Default: gemini-2.5-flash

The Gemini model to use for generating commit messages.

nocommit config set model=gemini-2.0-flash

generate

Default: 3

The number of commit messages to generate to pick from. Must be between 1 and 5.

nocommit config set generate=5

Note: Higher values use more tokens as the AI generates more results.

maxLength

Default: 72

The maximum character length of the generated commit message. Must be between 20 and 500.

nocommit config set maxLength=100

Tip: The default of 72 characters follows the widely-accepted git commit message convention for subject lines.

timeout

Default: 30000 (30 seconds)

The timeout for network requests to the Gemini API in milliseconds. Must be between 5000 and 120000.

nocommit config set timeout=60000 # 60s

Configuration Summary

OptionDefaultRangeDescription
GEMINI_API_KEYYour Google Gemini API key (required)
modelgemini-2.5-flashGemini model to use
maxLength7220–500Max commit message length
timeout300005000–120000API timeout in milliseconds
generate31–5Number of suggestions to generate

Example Configuration

Here's a typical setup for a developer who wants longer commit messages and more options:

# Set your API key
nocommit config set GEMINI_API_KEY=your_api_key_here
 
# Allow longer commit messages
nocommit config set maxLength=100
 
# Generate 5 suggestions to choose from
nocommit config set generate=5
 
# Increase timeout for slow connections
nocommit config set timeout=60000

Verify Your Configuration

After setting up, verify everything is configured correctly:

nocommit config get

You should see output like:

Current configuration:
  GEMINI_API_KEY: AIza...xyz
  model: gemini-2.5-flash
  maxLength: 72
  timeout: 30000
  generate: 3