✨ Enhancement: --dry-run flag for safe message preview
Summary
Gitbun currently has two modes: interactive (shows preview, asks for confirmation) and --auto (commits immediately). There is no way to only see what message would be generated without touching the Git index or creating a commit.
This is a common use case for:
- Developers testing a custom
.gitbunrc config or customPrompt
- CI pipelines that want to validate commit message quality before committing
- Contributors checking gitbun's fallback output against their diff without side effects
Proposed Behaviour
A new flag --dry-run (alias: -n) should:
- Run the full gitbun pipeline (AI call or fallback, scope/type detection)
- Print the generated commit message to stdout
- Exit without staging any files or running
git commit
Example output:
$ gitbun --dry-run
🔍 Dry run mode — no files will be staged or committed.
Generated commit message:
─────────────────────────────────────
feat(analyzer): add support for multi-file scope detection
─────────────────────────────────────
AI model used : deepseek-coder:6.7b (Ollama)
Confidence : high
Files analyzed: src/analyzer/scopeDetector.ts, src/analyzer/summarizer.ts
Why This Matters
Currently, the only way to test gitbun's output quality is to actually run it interactively or inspect source code. A --dry-run flag makes gitbun composable in shell scripts and safe to evaluate without risk of accidental commits — especially important in team onboarding or CI validation steps.
Implementation Notes
- Should work alongside
--no-ai to test fallback output: gitbun --dry-run --no-ai
- Should work with
--model to compare model outputs: gitbun --dry-run --model llama3
- Exit code
0 on success (message generated), 1 on failure (AI error, no staged files)
- Output should go to stdout so it can be piped:
gitbun --dry-run | grep "feat"
Environment
- All platforms (Node.js 18+)
- gitbun v1.13.0 (main branch)
Expected Behaviour
After this flag is implemented:
gitbun --dry-run prints the generated commit message and exits with code 0 — no git commit is run, no files are staged
gitbun --dry-run --no-ai tests the rule-based fallback output specifically
gitbun --dry-run --model llama3 uses the specified model for generation without committing
- The flag is documented in the README usage table alongside existing flags
gitbun --help includes --dry-run / -n with description: "Preview generated commit message without committing"
✨ Enhancement:
--dry-runflag for safe message previewSummary
Gitbun currently has two modes: interactive (shows preview, asks for confirmation) and
--auto(commits immediately). There is no way to only see what message would be generated without touching the Git index or creating a commit.This is a common use case for:
.gitbunrcconfig orcustomPromptProposed Behaviour
A new flag
--dry-run(alias:-n) should:git commitExample output:
Why This Matters
Currently, the only way to test gitbun's output quality is to actually run it interactively or inspect source code. A
--dry-runflag makes gitbun composable in shell scripts and safe to evaluate without risk of accidental commits — especially important in team onboarding or CI validation steps.Implementation Notes
--no-aito test fallback output:gitbun --dry-run --no-ai--modelto compare model outputs:gitbun --dry-run --model llama30on success (message generated),1on failure (AI error, no staged files)gitbun --dry-run | grep "feat"Environment
Expected Behaviour
After this flag is implemented:
gitbun --dry-runprints the generated commit message and exits with code 0 — nogit commitis run, no files are stagedgitbun --dry-run --no-aitests the rule-based fallback output specificallygitbun --dry-run --model llama3uses the specified model for generation without committinggitbun --helpincludes--dry-run/-nwith description: "Preview generated commit message without committing"