Skip to content

First Commit: Welcome to swift-commit-gen (v0.1.0)

Choose a tag to compare

@Iron-Ham Iron-Ham released this 17 Oct 19:39
· 62 commits to main since this release

SwiftCommitGen reaches its first tagged release. Version 0.1.0 delivers an end-to-end workflow for generating high quality commit messages with Apple's on-device intelligence stack while keeping source code local.

Highlights

  • Inspects staged and unstaged changes to build a concise diff summary.
  • Drafts commit messages through Apple's on-device generative APIs, keeping data private.
  • Guides you through an interactive review so you can accept, edit, or discard the proposed message.
  • Offers optional staging and committing helpers to streamline the entire flow.

Installation

Homebrew (Recommended)

brew tap Iron-Ham/swift-commit-gen
brew install swiftcommitgen

Or install directly without tapping:

brew install Iron-Ham/swift-commit-gen/swiftcommitgen

From Source

  1. Clone the repository:
    git clone https://github.com/Iron-Ham/swift-commit-gen.git
    cd swift-commit-gen
  2. Use the bundled install script (defaults to ~/.local/bin):
    Scripts/install.sh
    Provide an alternate destination as the first argument if necessary, for example Scripts/install.sh /usr/local/bin.
  3. Prefer manual installation instead? Build and copy the release binary yourself:
    swift build -c release
    install -d "$HOME/.local/bin"
    install .build/release/swiftcommitgen "$HOME/.local/bin/"
    Add export PATH="$HOME/.local/bin:$PATH" to your shell profile if the binary directory is not already on the path.

Usage

Execute the generator from any Git repository with pending work:

swiftcommitgen

As the author, I'll say I've personally aliased it to cg.

Helpful options:

  • --staged limits analysis to staged files only.
  • --format json returns the draft message in a JSON format, along with diagnostics.
  • --help lists every available flag.
  • --style (summary, conventional, detailed) allows you to change the style that a commit is generated in. Defaults to summary.

Requirements

  • macOS 26 (Sequoia) or later with Apple Intelligence enabled.
  • Xcode 26 toolchain with command line tools registered.
  • Swift 6 compiler
  • Git 2.40 or newer on the shell PATH.
  • Terminal (or preferred shell) granted Full Disk Access so the FoundationModels framework can initialize.

Known Limitations

  • Configuration files for tailoring prompt behavior are still on the roadmap.
  • Extremely large diffs are split with token-aware batching, but exceptionally large histories can still exceed the combined context window and may require manual trimming.
  • Apple Intelligence must be available on the host system; no fallback to cloud models exists.

Looking Ahead

Future updates will focus on richer prompting controls, improved diff batching, user-configuration, and custom styling instructions. Feedback, issues, and pull requests are welcome as the project evolves.