Usage

Use nocommit's commands and features.

nocommit makes generating commit messages effortless. Here's everything you need to know.

Generating Commits

Basic Usage

Stage your changes and run nocommit:

git add <files...>
nocommit

nocommit analyzes your staged changes and generates a commit message. You'll see an interactive menu to:

  • ✓ Commit the message
  • ✎ Edit the message
  • ↻ Regenerate a new suggestion
  • ✖ Cancel

Stage All Changes

You can stage all tracked file changes as you commit:

nocommit --all # or -a

This runs git add --update before generating the commit message.

Skip Confirmation

If you trust nocommit and want to commit immediately with the first suggestion:

nocommit --yes # or -y

This skips the interactive menu and commits directly.

Combine Flags

You can combine flags for a streamlined workflow:

nocommit -a -y  # Stage all and commit immediately

Interactive Menu

After generating a message, nocommit presents an interactive menu:

Generated commit message:
feat: add user authentication with JWT tokens
 
? What would you like to do?
 Commit
 Edit
 Regenerate
 Cancel
OptionDescription
CommitUse the message and create the commit
EditModify the message in an inline editor
RegenerateGenerate a fresh commit message
CancelExit without committing

Editing Messages

Edit opens a small text editor with the generated message. Tweak it however you like, and your changes become the new commit message.

Conventional Commits

nocommit automatically generates commit messages following the Conventional Commits specification:

<type>: <description>

Supported Types

TypeWhen to Use
featNew user-facing feature
fixBug fix
docsDocumentation only
styleFormatting, missing semi-colons
refactorCode change without new feature or fix
perfPerformance improvement
testAdding or correcting tests
buildBuild system, dependencies
ciCI configuration
choreMaintenance, config updates

Note: nocommit does not use scopes (e.g., feat(auth): add login). It generates clean messages like feat: add login for simplicity.

Smart Diff Handling

nocommit is designed to be token-efficient while maintaining accuracy:

Automatic Optimizations

  • File limiting - Analyzes up to 5 files to stay within token limits
  • Line extraction - Captures only changed lines (up to 30 per file)
  • Size constraints - Keeps total diff under 4000 characters
  • Noise filtering - Excludes lock files, build outputs, and generated files

Auto-Excluded Files

These files are automatically excluded from diff analysis:

CategoryFiles
Lock filespackage-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock
Build outputsdist/**, build/**, .next/**
Generated*.min.js, *.map, *.log
Dependenciesnode_modules/**

This ensures you get accurate commit messages without wasting tokens on irrelevant content.

All Available Flags

FlagDescription
-a, --allStage all tracked changes before generating
-y, --yesSkip confirmation and commit with first suggestion
-h, --helpShow help information
--versionShow version number

Quick Examples

# Basic commit
git add .
nocommit
 
# Stage all tracked changes and commit
nocommit --all
 
# Skip confirmation, commit immediately
nocommit --yes
 
# Stage all and commit immediately (fastest workflow)
nocommit -a -y
 
# Check version
nocommit --version
 
# Get help
nocommit --help

Workflow Tips

For Quick Commits

When you're confident in your changes and want speed:

nocommit -a -y

For Thoughtful Commits

When you want to review and potentially edit:

git add <specific-files>
nocommit
# Review → Edit if needed → Commit

For Multiple Options

If you want more suggestions to choose from, configure the generate setting:

nocommit config set generate=5
nocommit  # Now generates 5 options

Tip: Need to configure API keys, models, or other settings? Check out Configuration for setup instructions.