Skip to main content
Running commitdog with no arguments stages all your changes and analyzes the diff to produce four concrete commit message suggestions. The suggestions come entirely from your local code: commitdog reads function names, file types, and directory structure to infer a scope and verb, then generates messages in Conventional Commits format. Nothing leaves your machine during this step. Once you pick a message, commitdog commits and asks whether to push.

Usage

The platform flags run the same commit flow but push to the platform you name instead of your primary. Combine a flag with a file to stage only that file: commitdog -gt main.go. See Mirrors for pushing the same repo to multiple platforms. If there is nothing to commit, commitdog checks your remotes for unpushed commits. It offers to push if the target platform is behind, and if a mirror is behind instead, it prints the flag to run:

How suggestions are derived

commitdog analyzes the staged diff directly — no AI and no network call. It extracts:
  • Function names added or removed (e.g. addRefreshToken, verifyToken)
  • File types and directories to infer a scope (e.g. auth, api, db)
  • Change pattern (new file, delete, rename, test-only, config-only, etc.)
It then builds up to four distinct messages ranging from specific (feat(auth): add refreshToken and verifyToken) to brief (feat: update auth module), capped at 72 characters each.

Commit flow

1

Stage your changes

If nothing is staged, commitdog stages everything automatically:
To stage a single file instead, pass it as an argument:
2

Secret scan

commitdog silently scans the staged diff for leaked credentials. If it finds something, it shows exactly where and blocks the commit before showing suggestions:
If a secret is detected, commitdog blocks the commit and prints the file and line. Typing y at the prompt overrides the block and will push the secret to your remote. Remove the credential from the file before committing instead. To unstage the file: git reset HEAD <file>. To purge a secret already in history, use git filter-repo or BFG Repo Cleaner.
commitdog detects: AWS access and secret keys, GitHub tokens (classic and fine-grained), GitLab tokens, private keys (RSA, EC, DSA, OpenSSH), generic API keys, generic passwords and secrets, Slack tokens, Stripe keys, and Heroku API keys. Test files, mocks, fixtures, and placeholder values are skipped automatically.
3

Review suggestions

commitdog displays up to four suggestions derived from your diff:
Enter a number to pick that message, e to edit, or q to abort without committing.
4

Edit before committing (optional)

Pressing e at the suggestion prompt opens the first suggestion for inline editing:
Press Enter with an empty line to keep the original message, or type a replacement. The edited message is used as-is.
5

Commit and push

After you pick or edit a message, commitdog commits and confirms:
It then asks whether to push:
Press Enter or y to push. Enter n to skip. If the push fails, commitdog’s auto-recovery logic handles common errors like HTTPS auth failure and non-fast-forward rejections.