feat: command refactor#107
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the CLI from a flag-driven interface into explicit subcommands (run, diff, validate, format, suggest, list-files, show-config), updates the main orchestrator and tests accordingly, and refreshes docs/examples to match the new command structure.
Changes:
- Refactor CLI parsing to Commander subcommands and update unit tests to assert per-command option sets.
- Update runtime flow in
src/index.tsto branch oncommandName(new early exits, newdiffcommand path,validate --strictexit code). - Update README/FAQ/CONTRIBUTING/CLAUDE and example docs/scripts to the new CLI usage; bump
@typescript-eslint/eslint-plugin.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/commandLine.test.ts | Reworks CLI parsing tests around new subcommands and option sets. |
| src/index.ts | Switches orchestration logic to commandName; adds strict validation exit code handling and new diff behavior. |
| src/exitCodes.ts | Adds EXIT_VALIDATION_WARNINGS for validate --strict. |
| src/commandLine.ts | Implements Commander subcommands and shared option parsing/validation helpers. |
| package.json | Bumps @typescript-eslint/eslint-plugin patch version. |
| package-lock.json | Lockfile updates for the eslint-plugin bump and related packages. |
| example/7-format-only/config.yaml | Updates usage comment to new format command. |
| example/7-format-only/README.md | Updates format-only example commands to subcommand syntax. |
| example/5-external-files/README.md | Updates usage snippets to new diff/run/validate/list-files commands. |
| example/4-prune-mode/README.md | Updates usage snippets to new diff/run commands and wording. |
| example/3-multi-env-chain/sync-all.sh | Updates scripted invocations to diff (preview) and run (apply). |
| example/3-multi-env-chain/README.md | Updates walkthrough commands to diff and run. |
| example/2-stop-rules/README.md | Updates stop-rule example commands to diff and run. |
| example/1-config-inheritance/README.md | Updates inheritance example commands to diff and run. |
| example/0-basic/config-minimal.yaml | Updates comment to refer to suggest command wording. |
| example/0-basic/README.md | Updates basic example commands to diff/run. |
| README.md | Major documentation rewrite for subcommands, options tables, examples, and new exit code 4. |
| FAQ.md | Updates FAQ guidance/examples to subcommands and documents validate --strict. |
| CONTRIBUTING.md | Updates repo layout, scripts, test commands, architecture notes, and exit codes section. |
| CLAUDE.md | Updates CLI and architecture notes to subcommands and strict validation exit code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.