OCO Buddy
Generates a git commit message from your changes and drops it straight into the
Source Control input box. 15 commit styles, 8 languages, optional Gitmoji.
Works with any OpenAI-compatible /chat/completions endpoint — OpenAI, a local
Ollama, or anything else that speaks the same shape.
Commit styles
Set ocoBuddy.style, or run OCO: Generate with Style… to use a different one
for a single message without changing your default.
| Style |
Example |
| Conventional Commits |
feat: add authentication |
| Angular / Google |
feat(auth): add login |
| Atom Editor |
:sparkles: Add new feature |
| ESLint |
Feat: Add new rule |
| Ember.js |
[FEATURE] Add computed property |
| GraphQL |
Add user query (feat) |
| Ruby on Rails |
[FEATURE] Add authentication |
| Symfony |
[Feature] Add console command |
| Bitbucket |
JIRA-123: Add feature |
| Docker |
builder: fix cache |
| Karma |
feat(config): add env support |
| jQuery |
Core: Fix selector |
| Linux Kernel |
net: fix tcp bug |
| Semantic Versioning |
fix: resolve leak (closes [#123](https://github.com/AndhikaJeremia/oco-buddy/issues/123)) |
| Plain |
Fix login redirect bug |
The Bitbucket and Semantic Versioning styles read their issue reference from the
branch name — feature/JIRA-123-login gives JIRA-123, fix/123-leak gives
#123. When the branch has no issue in it the reference is left out rather than
invented.
Languages
English, Spanish, French, German, Italian, Portuguese, Japanese and Indonesian,
via ocoBuddy.language.
Only the prose is translated. Type keywords, tags and scopes — feat:,
[FEATURE], Core: — stay in English, so commitlint and friends keep working.
Setup
Run OCO: Settings from the Command Palette. That opens a panel with the base
URL, the API key, and a model dropdown you can populate from the endpoint —
click Load models and pick one. No need to know the model id up front.
Everything is also available in the normal Settings → Extensions → OCO Buddy
editor, or in settings.json directly:
{
"ocoBuddy.baseUrl": "https://api.openai.com/v1",
"ocoBuddy.apiKey": "sk-...",
"ocoBuddy.model": "gpt-4o-mini"
}
Usage
- Make some changes. Staging them is optional — see Which changes below.
- Click the ✨ button in the Source Control title bar, or run
OCO: Generate Commit Message from the Command Palette.
Commands
| Command |
What it does |
| OCO: Generate Commit Message |
Writes a message into the SCM box |
| OCO: Generate with Style… |
Same, picking a style for this message only |
| OCO: Settings |
Settings panel with a model dropdown loaded from the endpoint |
| OCO: Select Model |
Same list as a Command Palette quick-pick, if you prefer keyboard |
| OCO: Set API Key |
Stores a key in the OS keychain |
Which changes get described
ocoBuddy.diffSource:
auto (default) — the staged diff if anything is staged, otherwise everything
uncommitted in the working tree, untracked files included.
staged — the index only.
working — all tracked and untracked changes, staged or not.
ocoBuddy.excludePaths keeps paths out of what gets sent, as git pathspec
patterns. It defaults to lock files; generated code, snapshots and fixtures are
worth adding.
Large diffs
ocoBuddy.maxDiffChars is a budget, not a cut-off. Over it, the diff is
compressed in stages: each file gets a fair share of the budget (small files are
never starved by a large one), unchanged context lines are dropped before changed
lines, and a diff too large for even that is replaced by a per-file summary of
changed line counts. The model is told which of these it is looking at.
Repository context
The last ocoBuddy.historyCount commit subjects (10 by default) are sent as
examples, so messages pick up the scope names and tone already in use rather than
inventing new ones. Set it to 0 to send none.
Both model pickers call GET {baseUrl}/models and save your choice to
ocoBuddy.model. Endpoints that don't implement /models say so; type the id in
by hand there.
Settings
| Setting |
Default |
Notes |
ocoBuddy.baseUrl |
https://api.openai.com/v1 |
Bare base URL or a full /chat/completions URL. Ollama: http://localhost:11434/v1 |
ocoBuddy.apiKey |
"" |
Plain text in user settings — see below |
ocoBuddy.model |
gpt-4o-mini |
Any model the endpoint serves — use OCO: Select Model to browse |
ocoBuddy.style |
conventional |
One of the 15 styles above |
ocoBuddy.language |
english |
Language for the prose |
ocoBuddy.diffSource |
auto |
auto, staged or working |
ocoBuddy.body |
auto |
auto adds bullets when more than one file changed; always; never |
ocoBuddy.excludePaths |
["*-lock.*", "*.lock"] |
Git pathspecs kept out of the diff |
ocoBuddy.historyCount |
10 |
Recent commit subjects sent as context |
ocoBuddy.emoji |
false |
Prefix the subject with a GitMoji |
ocoBuddy.maxDiffChars |
12000 |
Character budget for the diff |
ocoBuddy.oneLine is gone; it is migrated to ocoBuddy.body automatically
(true becomes never).
Where the key comes from
Resolved in this order, first hit wins:
ocoBuddy.apiKey setting — convenient, but stored as plain text.
It's machine-scoped, so VS Code will not read it from a workspace's
.vscode/settings.json; it can only live in your user settings. That keeps
it out of any repo you commit.
- Secret storage — run OCO: Set API Key. Goes to the OS keychain, never
touches a settings file. Leave
ocoBuddy.apiKey blank to use this.
- Prompt — if neither is set, you're asked once and the answer goes to
secret storage.
A localhost base URL skips all of this and sends no Authorization header, so
local Ollama works with no key at all.
Install
From the Marketplace — search OCO Buddy in the Extensions view, or:
code --install-extension AndhikaJeremia.oco-buddy
From a packaged build
Packaged builds live in release/build/. Install the latest one:
code --install-extension release/build/oco-buddy-0.1.1.vsix
Or from the Extensions view: ⋯ → Install from VSIX… and pick the file.
Build from source
npm install
mkdir -p release/build
npm run package -- --out release/build/
Drop the --out and the .vsix lands in the project root instead.
Tests
npm test
Node's built-in runner, no extra dependencies. The git tests run against real
temporary repositories and the pipeline tests run against a stub HTTP endpoint,
so nothing reaches a real API.
Requirements
- VS Code 1.85 or newer.
- The built-in Git extension enabled.
git on your PATH.
Note
Your diff is sent to whatever endpoint ocoBuddy.baseUrl points at, along with
your recent commit subjects. Point it at a local model if that matters for your
code, and use ocoBuddy.excludePaths for anything that should never leave the
machine.