Skip to content

About

macOS menu bar app that commits your git projects with AI-written messages from opencommit (oco)

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Magic Commit

CI Latest release macOS 14+ License: MIT Website

A macOS menu bar app that keeps an eye on your git projects and commits them with AI-written messages from opencommit (oco), in one click.

Commit as often as you like with a quick WIP, then let Magic Commit turn every WIP commit into a real, descriptive message before you push.

Website: magic-commit.nicolas-dmg.fr

Features

Each project in the panel shows its branch, changed files, WIP commits and ahead/behind counts, plus the actions that make sense right now:

  • Commit: stages everything (unless you've already staged something) and runs oco --yes.
  • WIP: makes an instant commit with the message WIP, with no AI call.
  • Batch oco: gives each unpushed WIP commit a real message generated by oco from that commit's own diff. Other commits keep their messages, empty WIP commits are dropped, and original author dates are kept.
  • Push: runs git push (or git push -u <remote> <branch> for a new branch). It warns you first if WIP commits are still in there.

The menu bar icon shows how many projects have something to commit or push. Statuses refresh when you open the panel, every 60 seconds, and after your Mac wakes.

Requirements

  • macOS 14 Sonoma or later

  • opencommit installed and configured:

    npm install -g opencommit
    oco config set OCO_API_KEY=<your key>

    Magic Commit reads your PATH from your login shell, so oco installed through nvm, Homebrew or similar is found.

Installation

Download

  1. Download MagicCommit.zip from the latest release and unzip it.

  2. Move Magic Commit.app to /Applications.

  3. The app isn't notarized by Apple, so macOS blocks the first launch. Either right-click the app and choose Open, or run:

    xattr -dr com.apple.quarantine "/Applications/Magic Commit.app"

Build from source

Requires Xcode 15.3+ (or a Swift 5.10+ toolchain).

git clone https://github.com/dommangetnicolas/magic-commit.git
cd magic-commit
./scripts/build-app.sh --install

Run ./scripts/build-app.sh --help for all options.

Usage

  1. Click the wand icon in the menu bar, then + to add one or more git repositories.
  2. Use the buttons on each project row to commit, WIP, batch-rename or push.
  3. Use the … menu (or right-click a row) to open the project in Finder or Terminal, refresh it, or remove it.
  4. Turn on Launch at login in the panel's footer to keep it running.

Command line

Batch oco can also run without the UI:

"/Applications/Magic Commit.app/Contents/MacOS/MagicCommit" batch-oco ~/path/to/repo

How Batch oco works

Rewriting history is risky, so Batch oco is careful:

  1. It takes the commits from the oldest unpushed WIP commit up to HEAD and replays them in a temporary git worktree.
  2. Each WIP commit is re-staged there and oco --yes writes its message. Other commits are re-committed unchanged.
  3. The branch is moved to the rewritten history only if the final content is identical and HEAD hasn't moved in the meantime.

Your working tree and staged changes are never touched. If oco fails partway through, nothing changes. Commits that are already pushed are never rewritten, and merge commits stop the operation.

Contributing

Contributions are welcome. See CONTRIBUTING.md to get set up, and the changelog for what's new.

License

MIT

About

macOS menu bar app that commits your git projects with AI-written messages from opencommit (oco)

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages