-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli): adopt flag presets for shared CLI options #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
galligan
wants to merge
1
commit into
outfitter/v2-cli-runtime
Choose a base branch
from
outfitter/v2-flag-presets
base: outfitter/v2-cli-runtime
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Waymark CLI - Engineering Memory | ||
|
|
||
| ## @outfitter/contracts Error API (v0.4.1) | ||
|
|
||
| - `ValidationError.create(field, reason, context?)` -- field-specific validation | ||
| - `ValidationError.fromMessage(message, context?)` -- freeform validation | ||
| - `InternalError.create(message, context?)` -- unexpected errors | ||
| - `CancelledError.create(message)` -- user/signal cancellation | ||
| - `NotFoundError.create(resourceType, resourceId, context?)` | ||
| - `getExitCode(category)` -- maps ErrorCategory to exit code number | ||
| - Exit codes: validation:1, not_found:2, conflict:3, permission:4, timeout:5, rate_limit:6, network:7, internal:8, auth:9, cancelled:130 | ||
|
|
||
| ## Dual Commander Package Issue | ||
|
|
||
| - `@outfitter/cli` bundles its own Commander at `node_modules/@outfitter/cli/node_modules/commander/` | ||
| - `instanceof CommanderError` fails across package boundaries | ||
| - Solution: duck-type check `isCommanderLikeError()` that checks `.exitCode` (number) + `.code` (string starting with "commander.") | ||
| - Commander already prints help/version to stdout before throwing -- must suppress duplicate output in catch handlers | ||
|
|
||
| ## createCLI() Integration Notes | ||
|
|
||
| - `createCLI()` calls `.version()` and `.exitOverride()` internally | ||
| - Do NOT call `.version()` again -- patch the existing option in-place to change flags | ||
| - The `cli.parse()` method handles help/version exit codes; `program.parseAsync()` bypasses this | ||
| - When using `program.parseAsync()` directly, add `isCommanderOutputError()` check in catch to avoid double-printing | ||
|
|
||
| ## Biome Formatting | ||
|
|
||
| - Formatter reorders imports alphabetically -- don't fight it | ||
| - `biome-ignore lint/suspicious/noExplicitAny:` needed when patching Commander internals | ||
| - Format hook runs on pre-commit and may fix multiple files | ||
|
|
||
| ## Graphite Workflow | ||
|
|
||
| - `gt modify -cm "message"` stages only tracked changes + creates new commit | ||
| - `gt modify -acm "message"` stages ALL changes including untracked | ||
| - Without `-a`, must `git add` specific files first, then use `-cm` | ||
| - Graphite auto-restacks the entire branch stack after commits |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,4 +66,4 @@ | |
| "@outfitter/mcp" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| wm config [options] | ||
| Usage: wm config [options] | ||
|
|
||
| print resolved configuration | ||
|
|
||
| Options: | ||
| --print print merged configuration (default: false) | ||
| --json output compact JSON (default: false) | ||
| --help, -h display help for command | ||
| -h, --help display help for command |
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--color alwaysinstead of falling back to autoresolveNoColorFromOpts()only treatsfalseand"never"as special cases, soopts.color === "always"is collapsed into the same path as auto mode. Downstream color checks still rely on TTY detection, which means commands likewm --color always ... | catcan lose ANSI output even though the CLI now documents--color [mode]with analwaysmode. This makes the new flag mode ineffective in non-TTY environments.Useful? React with 👍 / 👎.