Skip to content

v4.0.0

Latest

Choose a tag to compare

@di-sukharev di-sukharev released this 30 Nov 19:21

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@latest

If 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 .env file: 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_SCOPE and OCO_TICKET_FROM_BRANCH. OpenCommit ignores all other OCO_* settings in this file and shows a warning. Set them with oco config set or 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, trustedrouter and aigrow. Use OCO_AI_PROVIDER=openai and set OCO_API_URL to 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 used aimlapi, 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 as OPENAI_API_KEY.

New

  • The default model is gpt-6-luna for OpenAI, openai/gpt-6-luna for OpenRouter and gemini-3.5-flash-lite for Gemini. If you use OpenAI with its default URL, OpenCommit replaces a saved gpt-4o-mini with gpt-6-luna, because OpenAI shuts down gpt-4o-mini on 14 January 2027. (#617)
  • You can use OpenCommit as a library with generateCommitMessage. (#599)
  • MiniMax is a new provider. (#543)
  • OCO_TICKET_FROM_BRANCH adds the ticket ID from the branch name to the message. (#606)
  • "Edit" opens the editor of Git with the full message. (#620)
  • OCO_PROXY works with Azure, OpenCommit follows NO_PROXY, and you can set OCO_OLLAMA_THINK with oco 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:
    • Without OCO_API_URL, DeepSeek requests no longer go to OpenAI. (#609)
    • OpenAI credentials from the environment are no longer sent to DeepSeek or Groq. (#610)
    • The model lists of Anthropic, Mistral, DeepSeek and MiniMax come from the configured URL.
    • Only the owner can access ~/.opencommit.
  • Messages: control characters are removed, except new lines and tabs.
  • Models: requests use the parameters that current OpenAI and Claude models accept. (#617)
  • Diffs:
    • File names with special characters, renames and many files work. (#620)
    • Each request of a large diff contains changed lines. (#620)
    • The prompts tell the model which lines changed. (#611)
  • 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-commitlint is always in the root of the repository. (#617)
  • Settings: updates keep the default model and the key of a removed provider. oco setup clears an old URL if it does not ask for a new one. (#618)
  • Flowise: requests go to the correct URL. (#439)
  • Dependencies: undici, follow-redirects and qs are 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