An LLM-powered CLI assistant for writing conventional commit messages and branch names.
It reads the changes in your git repository, generates a relevant commit message following configurable conventions, and can also create a matching branch name when you start new work.
- Conventional commits: enforces allowed commit types like
feat:,fix:,refactor:, etc. - Branch naming: generates branch names with allowed prefixes like
feature/,bugfix/, etc. - Staged-first diff reading: prefers staged changes and falls back to unstaged changes.
- Combined workflow: create a branch and commit in a single command.
- LangGraph-powered generation: structured LLM output with node-level retry policies and soft context restrictions.
- Configurable rules: customize commit types, branch prefixes, length limits, and credentials via TOML.
Requires Node.js >= 20.
Published to the public npm registry.
npm install -g @shailesh-714/git-botRun without installing:
npx @shailesh-714/git-bot commit --dry-runInstall the latest release directly from GitHub:
curl -fsSL https://github.com/Shailesh-714/git-bot/releases/latest/download/install.sh | bashInstall a specific version:
curl -fsSL https://github.com/Shailesh-714/git-bot/releases/latest/download/install.sh | bash -s -- --version 0.1.1If you already have the repo cloned:
npm install
npm run build
node ./bundle/git-bot.cjs --helpCreate ~/.config/git-bot/config.toml (or pass --config):
[llm]
provider = "openai"
model = "gpt-4o-mini"
apiKey = "sk-..." # or set OPENAI_API_KEY
baseUrl = "" # optional OpenAI-compatible endpoint
temperature = 0.2
[conventions.commit]
enabledTypes = [
"feat", "fix", "refactor", "docs", "test", "chore", "style", "perf"
]
format = "{type}: {summary}"
maxLength = 72
[conventions.branch]
enabledPrefixes = [
"feature", "bugfix", "hotfix", "release"
]
separator = "/"
maxLength = 60Generate an example config:
git-bot config --init# Generate a commit message from staged changes (falls back to unstaged)
git-bot commit
# Stage all changes and commit in one step
git-bot commit --all
# Show the generated message without committing
git-bot commit --dry-run
# Skip confirmation prompts
git-bot commit --yes
# Generate a commit message and create a branch in one go
git-bot commit --branch
# Same with an issue identifier
git-bot commit --branch --issue JIRA-123
# Generate and create only a branch
git-bot branch
# Dry-run branch name only
git-bot branch --dry-runOPENAI_API_KEY— used whenapiKeyis not set in config.GIT_BOT_CONFIG— default config file path.
npm install
npm run dev -- commit --dry-run
npm test
npm run buildThis project uses npm trusted publishing via OIDC — no long-lived tokens required.
- Go to your package settings on npmjs.com.
- Find Trusted Publisher and select GitHub Actions.
- Fill in:
- Organization/user:
Shailesh-714 - Repository:
git-bot - Workflow filename:
release.yml - Allowed actions:
npm publish
- Organization/user:
- Bump the version in
package.json. - Push the change to
main. - Go to Actions → Release → Run workflow.
The workflow will tag the release, build and test the package, publish it to the public npm registry with provenance, and create a GitHub Release.
MIT