feat(commit): Add non-interactive --yes (-y) flag to commit command to auto-accept AI recommendations and optionally push with -p

This commit is contained in:
2025-11-06 00:06:02 +00:00
parent adc828d9bb
commit 485c0a3855
4 changed files with 103 additions and 30 deletions

View File

@@ -110,6 +110,21 @@ The commit module's version bumping has been refactored to eliminate npm command
- Same code path for all project types
- Reuses existing `calculateNewVersion()` function
### Auto-Accept Flag for Commits
The commit module now supports `-y/--yes` flag for non-interactive commits:
**Usage:**
- `gitzone commit -y` - Auto-accepts AI recommendations without prompts
- `gitzone commit -yp` - Auto-accepts and pushes to origin
- Separate `-p/--push` flag controls push behavior
**Implementation:**
- Creates AnswerBucket programmatically when `-y` flag detected
- Preserves all UI output for transparency
- Fully backward compatible with interactive mode
- CI/CD friendly for automated workflows
## Development Tips
- Always check readme.plan.md for ongoing improvement plans
@@ -157,6 +172,27 @@ The commit module's version bumping has been refactored to eliminate npm command
## CLI Usage
### Commit Commands
```bash
# Interactive commit (default)
gitzone commit
# Auto-accept AI recommendations (no prompts)
gitzone commit -y
gitzone commit --yes
# Auto-accept and push to origin
gitzone commit -yp
gitzone commit -y -p
gitzone commit --yes --push
# Run format before commit
gitzone commit --format
```
### Format Commands
```bash
# Basic format
gitzone format