Repository navigation
Security
Update as soon as possible. This release fixes a high-severity vulnerability, GHSA-pxcf-vgf2-9676. If you ran oco or its Git hook in a hostile repository, the .env file of that repository could run commands and send your API key and diff to an attacker.
npm install -g opencommit@latestIf you use the OpenCommit GitHub Action, remove it from your workflows. This release removes the Action. The published tags stay vulnerable, and there will be no patch for them.
Breaking changes
- Repository
.envfile: it can change only the message format:OCO_LANGUAGE,OCO_DESCRIPTION,OCO_EMOJI,OCO_EMOJI_POSITION_BEFORE_DESCRIPTION,OCO_EMOJI_FULL_SPEC,OCO_ONE_LINE_COMMIT,OCO_OMIT_SCOPEandOCO_TICKET_FROM_BRANCH. OpenCommit ignores all otherOCO_*settings in this file and shows a warning. Set them withoco config setor in the shell. - GitHub Action: it is removed.
oco --yes: it never prompts, never stages files and never pushes. If something is missing, such as staged files or an API key, it exits with code 1. (#620)- Removed providers:
aimlapi,orcarouter,cheaperinference,requesty,atlascloud,uberllm,trustedrouterandaigrow. UseOCO_AI_PROVIDER=openaiand setOCO_API_URLto the base URL of the service. OpenCommit updates the global config automatically. If you set one of these providers in the shell, OpenCommit shows the settings that replace it. If you usedaimlapi, the request parameters also change. (#608) - Unknown providers: OpenCommit rejects them. Before, it sent the requests to OpenAI.
- API keys: if a provider needs a key, set
OCO_API_KEY. OpenCommit does not use keys from the environment variables of the provider SDKs, such asOPENAI_API_KEY.
New
- The default model is
gpt-6-lunafor OpenAI,openai/gpt-6-lunafor OpenRouter andgemini-3.5-flash-litefor Gemini. If you use OpenAI with its default URL, OpenCommit replaces a savedgpt-4o-miniwithgpt-6-luna, because OpenAI shuts downgpt-4o-minion 14 January 2027. (#617) - You can use OpenCommit as a library with
generateCommitMessage. (#599) - MiniMax is a new provider. (#543)
OCO_TICKET_FROM_BRANCHadds the ticket ID from the branch name to the message. (#606)- "Edit" opens the editor of Git with the full message. (#620)
OCO_PROXYworks with Azure, OpenCommit followsNO_PROXY, and you can setOCO_OLLAMA_THINKwithoco config set. (#618)
Fixes
- Excluded files: they stay out of the request to the AI provider. If all staged files are excluded, OpenCommit sends nothing.
- Staging: "Stage all" no longer adds ignored files when the name of a file looks like a Git option.
- Push: if there is no remote, the commit stays local. If the push fails after the commit, OpenCommit says so and exits with code 1. (#620)
- API keys and URLs:
- Messages: control characters are removed, except new lines and tabs.
- Models: requests use the parameters that current OpenAI and Claude models accept. (#617)
- Diffs:
- Git and the Git hook: OpenCommit shows the errors of Git and its hooks, and the OpenCommit hook uses the comment character of Git. Outside a Git repository, OpenCommit shows the error of Git. (#524, #620)
- commitlint: the prompt uses your context, and
.opencommit-commitlintis always in the root of the repository. (#617) - Settings: updates keep the default model and the key of a removed provider.
oco setupclears an old URL if it does not ask for a new one. (#618) - Flowise: requests go to the correct URL. (#439)
- Dependencies:
undici,follow-redirectsandqsare updated. (#619)
The @commitlint prompt module runs code from the current repository. If you enable it globally, use OpenCommit only in repositories that you trust.
Full changelog: v3.3.12...v4.0.0