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 - Multiple aliases - Use
oc,ocmt, oropencommit
- Node.js >= 18.0.0
- OpenCode installed and authenticated
# npm
npm install -g opencode
# or brew
brew install sst/tap/opencodeThen authenticate:
opencode auth# bun (recommended)
bun install -g ocmt
# npm
npm install -g ocmt
# pnpm
pnpm install -g ocmt
# yarn
yarn global add 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.0On first run, ocmt creates a .oc/ directory in your repository root with configuration files:
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.
Edit these files to customize AI behavior for your project.
| Command | Aliases | Description |
|---|---|---|
oc |
ocmt, opencommit |
Generate commit message from staged changes |
oc changelog |
oc cl |
Generate changelog from commits |
| Option | Description |
|---|---|
-a, --all |
Stage all changes before committing |
-y, --yes |
Skip confirmation prompts |
-V, --version |
Show version number |
-h, --help |
Show help |
| Option | Description |
|---|---|
-f, --from <ref> |
Starting commit/tag reference |
-t, --to <ref> |
Ending commit/tag reference (default: HEAD) |
- Connects to OpenCode - Tries to connect to an existing OpenCode server, or spawns a new one
- Analyzes your changes - Reads the staged git diff
- 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 | Provider | Model |
|---|---|---|
| Commit messages | opencode | gpt-5-nano |
| Changelogs | opencode | claude-sonnet-4-5 |
$ 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