AI-powered git commit message, changelog & documentation generator using opencode.ai
┌ oc
│
◆ Staged changes:
│ + src/index.ts
│ + src/utils/git.ts
│
● Diff: 42 lines
│
◇ Commit message generated
│
◇ Proposed commit message:
│ "feat: add git status parsing utilities"
│
◆ What would you like to do?
│ ● Commit with this message
│ ○ Edit message
│ ○ Regenerate message
│ ○ Cancel
└
- AI-powered commit messages - Generates conventional commit messages from your staged changes
- Changelog generation - Create changelogs from your commit history
- Interactive CLI - Beautiful terminal UI with confirmation prompts
- Customizable - Edit
.oc/config.mdto customize commit message rules and models - Global + project config - Set defaults in
~/.oc/, override per-project - Multiple aliases - Use
oc,ocmt, oropencommit
- Node.js >= 18.0.0
- OpenCode installed and authenticated
bun add -g opencode-ai
npm install -g opencode-ai
# or brew
brew install sst/tap/opencodeThen authenticate:
opencode auth# bun (recommended)
bun install -g ocmt
# npm
npm install -g ocmt# Interactive commit flow
oc
# Stage all changes first
oc -a
# Skip confirmation prompts
oc -y
# Stage all and skip prompts
oc -ay
# Use provided message directly (skips AI)
oc "feat: add new feature"# Interactive changelog generation
oc changelog
# Shorthand aliases
oc cl
oc --changelog
oc -cl
# Specify range
oc changelog --from v1.0.0 --to HEAD
oc changelog -f v1.0.0 -t v2.0.0
# Auto-save to file (non-interactive)
oc changelog --from v1.0.0 --save
# Copy to clipboard
oc changelog --from v1.0.0 --copy
# Both save and copy
oc changelog --from v1.0.0 --save --copy# Interactive PR creation
oc pr
# Skip prompts (uses defaults)
oc pr -y
# Specify target branch
oc pr --target-branch develop
oc pr -b main
# Provide title and body directly
oc pr --title "feat: add new feature" --body "Description here"
# Open in browser for creation
oc pr --browser
# Auto-open in browser after creation
oc pr --open# Interactive release (commit, changelog, tag, push)
oc release
# Specify version
oc release --version 1.2.0
# Full automated release
oc release -v 1.2.0 --tag --push -y
# Skip changelog generation
oc release --skip-changelog --tag
# Custom changelog commit message
oc release --commit-message "docs: update changelog for v1.2.0"ocmt can automatically create feature branches with AI-generated names based on your changes.
# Specify a branch name directly
oc --branch feat/my-feature
# Skip branch creation entirely
oc --skip-branchConfiguration options:
autoCreateBranchOnDefault: Auto-create branch when on default branch (default:true)autoCreateBranchOnNonDefault: Auto-create branch when on non-default branch (default:false)forceNewBranchOnDefault: Always require new branch on default branch (default:false)
When you run any oc command, you'll be prompted to choose your interaction style:
◆ How would you like to proceed?
│ ● Use defaults and approve each (AI generates content, you confirm with Enter)
│ ○ Use defaults and auto-accept (AI generates content, proceeds automatically)
│ ○ Don't use defaults (Full interactive mode with all options)
- Use defaults and approve each: AI generates content, you press Enter to confirm each step
- Use defaults and auto-accept: AI generates content and proceeds automatically
- Don't use defaults: Full interactive mode with edit, regenerate, and intent change options
To skip this prompt and always use a specific mode, set it in your config file:
{
"defaults": {
"executionMode": "confirm-each",
"skipModePrompt": true
}
}Valid values for executionMode:
"interactive"- Full interactive mode"confirm-each"- Approve each AI-generated item"auto-accept"- Auto-accept all AI-generated content
Use --interactive / -i to override the saved preference and force interactive mode.
For CI/CD or scripting, use flags to skip all prompts:
# Commit with all defaults
oc -ay --skip-branch
# Generate and save changelog
oc changelog --from v1.0.0 --save -y
# Full release pipeline
oc release -v 1.2.0 --tag --push -y
# Create PR with specific content
oc pr -y --title "Release v1.2.0" --body "Release notes here" -b main --openocmt uses a layered configuration system with global defaults and project-level overrides.
| Location | Purpose |
|---|---|
~/.oc/ |
Global config (applies to all projects) |
<repo>/.oc/ |
Project config (overrides global settings) |
On first run, ocmt creates the global ~/.oc/ directory with default configuration files. Project-level .oc/ folders are optional and only used if they exist.
Configure models, behavior, and preferences:
{
"commit": {
"autoAccept": false,
"autoStageAll": false,
"autoCreateBranchOnDefault": true,
"autoCreateBranchOnNonDefault": false,
"forceNewBranchOnDefault": false,
"branchModel": "opencode/gpt-5-nano",
"model": "opencode/gpt-5-nano"
},
"changelog": {
"autoSave": false,
"outputFile": "CHANGELOG.md",
"model": "opencode/claude-sonnet-4-5"
},
"release": {
"autoTag": false,
"autoPush": false,
"tagPrefix": "v"
},
"pr": {
"autoCreate": false,
"autoOpenInBrowser": false,
"model": "opencode/gpt-5-nano"
},
"general": {
"confirmPrompts": true,
"verbose": false
},
"defaults": {
"executionMode": null,
"skipModePrompt": false
}
}Models are specified in provider/model format:
{
"commit": {
"model": "opencode/gpt-5-nano",
"branchModel": "opencode/gpt-5-nano"
},
"changelog": {
"model": "opencode/claude-sonnet-4-5"
}
}You can use any model supported by your provider. For example:
opencode/gpt-5-nanoopencode/claude-sonnet-4-5github-copilot/gpt-4
Reference models.dev for proper syntax supported by OpenCode
Controls how AI generates commit messages. Default uses Conventional Commits:
# Commit Message Guidelines
## Types
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `refactor`: Code change that neither fixes a bug nor adds a feature
...
## Rules
1. Use lowercase for the type
2. No scope (e.g., use `feat:` not `feat(api):`)
3. Use imperative mood ("add" not "added")
...Controls changelog generation format. Default uses Keep a Changelog format.
Settings are merged in this order (later overrides earlier):
1. Built-in defaults
↓
2. ~/.oc/config.json (global)
↓
3. <repo>/.oc/config.json (project)
For JSON config, individual fields are deep-merged. For markdown configs (config.md, changelog.md), the project file completely replaces the global file if it exists.
| Command | Aliases | Description |
|---|---|---|
oc |
ocmt, opencommit |
Generate commit message from staged changes |
oc changelog |
oc cl |
Generate changelog from commits |
oc release |
oc rel |
Full release flow: commit, changelog, tag, push |
oc pr |
- | Create a pull request for the current branch |
| Option | Description |
|---|---|
-i, --interactive |
Force interactive mode (ignore saved defaults preference) |
-s, --silent |
Suppress all CLI updates and animations |
-V, --version |
Show version number |
-h, --help |
Show help |
| Option | Description |
|---|---|
-a, --all |
Stage all changes before committing |
-y, --yes |
Skip confirmation prompts |
--model <model> |
Override AI model (format: provider/model) |
--accept |
Auto-accept generated message without confirmation |
--branch <name> |
Use specified branch name instead of generating |
--skip-branch |
Skip branch creation entirely |
| Option | Description |
|---|---|
-f, --from <ref> |
Starting commit/tag reference |
-t, --to <ref> |
Ending commit/tag reference (default: HEAD) |
-o, --output <path> |
Output file path (default: CHANGELOG.md) |
--save |
Auto-save to file without prompting |
--copy |
Copy changelog to clipboard |
--model <model> |
Override AI model (format: provider/model) |
| Option | Description |
|---|---|
-f, --from <ref> |
Starting commit/tag reference |
-v, --version <version> |
Version for the release (semver format) |
-t, --tag |
Create a git tag for the release |
-p, --push |
Push to remote after tagging |
-y, --yes |
Skip confirmation prompts |
--skip-changelog |
Skip changelog generation |
--commit-message <msg> |
Custom commit message for changelog commit |
| Option | Description |
|---|---|
-y, --yes |
Skip confirmation prompts |
-b, --target-branch <branch> |
Target branch for the PR |
--title <text> |
PR title (skips AI generation for title) |
--body <text> |
PR body/description (skips AI generation for body) |
--browser |
Open in browser for PR creation |
--open |
Auto-open PR in browser after creation |
- Connects to OpenCode - Tries to connect to an existing OpenCode server, or spawns a new one
- Analyzes your changes - Reads the staged git diff
- Optional branch - Creates a new branch with an AI-generated name (if enabled)
- Generates message - Sends diff to AI with your configured rules
- Confirms with you - Shows the proposed message for approval/editing
- Commits - Creates the commit with the final message
| Feature | Default Model |
|---|---|
| Commit messages | opencode/gpt-5-nano |
| Branch names | opencode/gpt-5-nano |
| Changelogs | opencode/claude-sonnet-4-5 |
Models are configurable in ~/.oc/config.json or <repo>/.oc/config.json. See Configuration for details.
$ oc
┌ oc
│
◆ Staged changes:
│ + src/utils/parser.ts
│ + src/index.ts
│
● Diff: 127 lines
│
◇ Commit message generated
│
◇ Proposed commit message:
│ "feat: add expression parser with AST support"
│
◆ What would you like to do?
│ ● Commit with this message
└$ oc changelog
┌ changelog
│
◇ Found releases and commits
│
◆ Select starting point for changelog:
│ ○ v1.0.0 (release)
│ ○ v0.9.0 (release)
│ ● abc1234 feat: add user authentication
│ ○ def5678 fix: resolve memory leak
└Install OpenCode first:
npm install -g opencode
# or
brew install sst/tap/opencodeRun authentication:
opencode authMake sure you're in a git repository:
git initStage your changes first:
git add .
# or
oc -a # stages all changes automaticallyContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
oc😉) - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
# Clone the repo
git clone https://github.com/yourusername/ocmt.git
cd ocmt
# Install dependencies
bun install
# Run in development mode
bun run dev
# Build for production
bun run build
# Type check
bun run typecheckMIT
- OpenCode - AI coding assistant
- OpenCode Docs - Documentation
- Conventional Commits - Commit message specification
- Keep a Changelog - Changelog format