Skip to main content
The wit ai command provides AI-powered features for your development workflow, including natural language commands, automatic commit message generation, code review, and conflict resolution assistance.

Overview

Commands

chat / ask

Interact with the AI assistant using natural language.

Examples


commit

Generate an AI-powered commit message and optionally create the commit.

Options

Examples

Commit Message Format

The AI generates conventional commit messages following best practices:
Supported prefixes:
  • feat: - New feature
  • fix: - Bug fix
  • refactor: - Code refactoring
  • docs: - Documentation changes
  • test: - Adding/updating tests
  • chore: - Maintenance tasks
  • perf: - Performance improvements
  • style: - Formatting, whitespace

review

Get an AI-powered code review of your changes.

Options

Examples

What the AI Reviews

The AI analyzes your code changes for:
  1. Potential bugs or issues - Logic errors, edge cases
  2. Security concerns - Injection vulnerabilities, exposed secrets
  3. Code quality - Readability, maintainability
  4. Best practices - Design patterns, conventions

Example Output


explain

Get an AI explanation of a commit or range of commits.

Arguments

Examples

Example Output


resolve

Get AI assistance for resolving merge conflicts.

Arguments

Examples

Example Output


status

Check the AI configuration and availability.

Example Output


Configuration

API Keys

The AI features require an API key from a supported provider:

Model Selection

Override the default model:

Workflow Examples

Feature Development with AI

Handling Merge Conflicts

Quick Status Check


Best Practices

Always review AI-generated content before committing or merging. The AI provides suggestions, not absolute answers.
More specific questions get better answers:
Preview commit messages with --dry-run before creating actual commits:
Stage only related changes before using wit ai commit for more focused commit messages.

Troubleshooting

If you see this error, set one of the supported API keys:
If you encounter model-specific errors, try a different model:
For very large diffs, the AI may truncate or summarize. Consider:
  • Staging fewer files at once
  • Breaking large changes into smaller commits