feat(cli): add machine-readable CLI help, recommendation, and configuration flows

This commit is contained in:
2026-04-16 18:54:07 +00:00
parent f43f88a3cb
commit fd7a73398c
14 changed files with 2482 additions and 786 deletions
+25 -32
View File
@@ -23,10 +23,10 @@ Gitzone CLI (`@git.zone/cli`) is a comprehensive toolbelt for streamlining local
### Configuration Management
- Uses `npmextra.json` for all tool configuration
- Configuration stored under `gitzone` key in npmextra
- No separate `.gitzonerc` file - everything in npmextra.json
- Project type and module metadata also stored in npmextra
- Uses `.smartconfig.json` for tool configuration
- CLI settings live under the `@git.zone/cli` namespace
- Agent and non-interactive defaults now belong under `@git.zone/cli.cli`
- Project type, module metadata, release settings, commit defaults, and format settings live in the same file
### Format Module (`mod_format`) - SIGNIFICANTLY ENHANCED
@@ -84,7 +84,7 @@ The format module is responsible for project standardization:
1. **Plan → Action Workflow**: Shows changes before applying them
2. **Rollback Mechanism**: Full backup and restore on failures
3. **Enhanced Configuration**: Granular control via npmextra.json
3. **Enhanced Configuration**: Granular control via `.smartconfig.json`
4. **Better Error Handling**: Detailed errors with recovery options
5. **Performance Optimizations**: Parallel execution and caching
6. **Reporting**: Diff views, statistics, verbose logging
@@ -132,7 +132,7 @@ The commit module now supports `-y/--yes` flag for non-interactive commits:
## Development Tips
- Always check readme.plan.md for ongoing improvement plans
- Use npmextra.json for any new configuration options
- Use `.smartconfig.json` for any new configuration options
- Keep modules focused and single-purpose
- Maintain the existing plugin pattern for dependencies
- Test format operations on sample projects before deploying
@@ -144,30 +144,18 @@ The commit module now supports `-y/--yes` flag for non-interactive commits:
```json
{
"gitzone": {
"@git.zone/cli": {
"cli": {
"interactive": true,
"output": "human",
"checkUpdates": true
},
"format": {
"interactive": true,
"parallel": true,
"showStats": true,
"cache": {
"enabled": true,
"clean": true
},
"rollback": {
"enabled": true,
"autoRollbackOnError": true,
"backupRetentionDays": 7
},
"modules": {
"skip": ["prettier"],
"only": [],
"order": []
},
"licenses": {
"allowed": ["MIT", "Apache-2.0"],
"exceptions": {
"some-package": "GPL-3.0"
}
"only": []
}
}
}
@@ -182,6 +170,9 @@ The commit module now supports `-y/--yes` flag for non-interactive commits:
# Interactive commit (default)
gitzone commit
# Read-only recommendation
gitzone commit recommend --json
# Auto-accept AI recommendations (no prompts)
gitzone commit -y
gitzone commit --yes
@@ -201,11 +192,14 @@ gitzone commit --format
# Basic format
gitzone format
# Read-only JSON plan
gitzone format plan --json
# Dry run to preview changes
gitzone format --dry-run
# Non-interactive mode
gitzone format --yes
# Non-interactive apply
gitzone format --write --yes
# Plan only (no execution)
gitzone format --plan-only
@@ -222,11 +216,10 @@ gitzone format --verbose
# Detailed diff views
gitzone format --detailed
# Rollback operations
gitzone format --rollback
gitzone format --rollback <operation-id>
gitzone format --list-backups
gitzone format --clean-backups
# Inspect config for agents and scripts
gitzone config show --json
gitzone config set cli.output json
gitzone config get release.accessLevel
```
## Common Issues (Now Resolved)