Skip to content

Command Reference

Griffen Fargo edited this page Oct 15, 2025 · 2 revisions

Complete reference for all coco commands with detailed options and examples.

coco commit

Generates commit messages based on staged changes with intelligent commitlint integration.

coco
# or 
coco commit

Basic Options

# Interactive mode - opens editor for review and editing
coco -i, --interactive

# Verbose output - shows detailed processing information
coco --verbose

# Help - display command help
coco --help

Commit Enhancement Options

# Add content to the end of the generated commit message
coco --append "Resolves #128"

# Automatically append Jira/Linear ticket ID from branch name
coco -t, --append-ticket

# Add extra context to guide commit generation
coco -a, --additional "Resolves UX bug with sign up button"

# Include previous commits for context (specify number)
coco -p, --with-previous-commits 3

Conventional Commits Options

# Force conventional commits mode
coco -c, --conventional

# Include/exclude branch name in context (default: true)
coco --include-branch-name
coco --no-include-branch-name

Processing Options

# Ignore specific files (can be used multiple times)
coco --ignored-files "*.lock" --ignored-files "dist/*"

# Ignore file extensions (can be used multiple times)  
coco --ignored-extensions ".map" --ignored-extensions ".min.js"

# Use basic git status instead of full diff (faster for large changes)
coco --no-diff

# Open commit message in editor before proceeding
coco --open-in-editor

Examples

# Basic conventional commit
coco --conventional
# Output: feat: add user authentication system

# With scope and context
coco --conventional -a "fixes login timeout"
# Output: fix(auth): resolve login timeout issue

# With additional context and ticket
coco --conventional --additional "Resolves login issues" --append-ticket
# Output: feat(auth): add OAuth2 integration
#         
#         Implement OAuth2 flow with Google and GitHub providers.
#         Resolves login issues
#         
#         Part of **PROJ-123**

coco changelog

Creates changelogs from commit history.

# Basic changelog for current branch
coco changelog

# Interactive mode
coco changelog -i, --interactive

Range Selection Options

# Specific commit range (HEAD references)
coco changelog -r HEAD~5:HEAD

# Specific commit range (commit hashes)  
coco changelog -r abc1234:def5678

# Compare against target branch
coco changelog -b main, --branch main

# Compare against a tag
coco changelog -t 3.0.0, --tag 3.0.0

# All commits since last tag
coco changelog --since-last-tag

--branch, --tag, and --since-last-tag cannot be combined in the same run.

Content Options

# Include diff for each commit in analysis
coco changelog --with-diff

# Generate changelog based only on branch diff
coco changelog --only-diff

# Include author attribution
coco changelog --author

# Add extra context to guide generation
coco changelog -a "Focus on user-facing changes"

coco recap

Summarize changes across different time periods.

# Summarize current working directory changes
coco recap

# Interactive mode
coco recap -i, --interactive

Time Period Options

# Yesterday's changes
coco recap --yesterday

# Last week's changes  
coco recap --last-week, --week

# Last month's changes
coco recap --last-month, --month

# Changes since last git tag
coco recap --last-tag, --tag

# Current branch changes
coco recap --current-branch

coco review

Perform AI-powered code review on your changes.

# Review current working directory changes
coco review

# Interactive mode
coco review -i, --interactive

# Review specific branch
coco review -b feature-branch, --branch feature-branch

coco init

Interactive setup wizard for configuring coco.

# Setup wizard (will prompt for scope)
coco init

# Configure for current project only
coco init --scope project

# Configure globally for current user
coco init --scope global

Global Options

These options work with all commands:

# Verbose output for debugging
--verbose

# Interactive mode (where supported)
-i, --interactive

# Display help
--help

# Display version
--version

Common Workflows

Daily Development

# Make changes
git add .

# Generate and review commit
coco -i

Team Workflow with Validation

# Stage changes
git add .

# Generate conventional commit with ticket
coco --conventional --append-ticket -i

Release Workflow

# Generate changelog for release
coco changelog --since-last-tag

# Create release commit
git add .
coco --conventional -a "Release version 1.2.0"

Code Review Workflow

# Review changes before committing
coco review

# Generate commit after review
coco --conventional -i

Output Modes

Stdout Mode (Default)

# Generate message to stdout
coco

# Use with git commit
git commit -m "$(coco)"

# Pipe to git commit
coco | git commit -F -

Interactive Mode

# Review and edit before committing
coco -i

# Set as default in config
{
  "mode": "interactive"
}

Configuration Integration

All commands respect your configuration settings:

# Use project config
coco commit  # Uses .coco.config.json settings

# Override with environment variables
COCO_MODE=interactive coco commit

# Override with command line flags
coco --conventional --interactive commit

For complete configuration options, see the Configuration Overview.

Clone this wiki locally