Summary
When certain ig commands are run incorrectly (e.g., missing required sub-commands or arguments),
the CLI currently outputs raw exception stack traces to the user. This is noisy, unhelpful, and
presents a poor developer experience.
Current Behavior
Running ig generate without a sub-command produces output like:
The full yargs internal stack trace is printed in red, even though this is an expected user error
(missing required sub-command), not an unexpected runtime exception.
Expected Behavior
- Known/expected errors (e.g., missing sub-command, invalid arguments) should display a clean,
actionable message — no stack trace.
- Unexpected runtime errors may still show a stack trace for debugging, but ideally gated behind
a --verbose or --debug flag.
- Error messages should guide the user toward the correct usage, e.g.:
Error: Please provide a sub-command for "generate".
Usage: ig generate template [name]
Run "ig generate --help" for available options.
Suggested Improvements
- Distinguish between
YError (yargs validation errors / expected user mistakes) and actual
runtime exceptions in the parseAsync callback in cli.ts.
- Suppress stack traces for
YError instances.
- Append a usage hint or a pointer to
--help when a command is used incorrectly.
- Consider a
--verbose flag to opt-in to full stack traces for debugging purposes.
Affected Area
packages/cli/lib/cli.ts — parseAsync error callback
packages/cli/lib/commands/generate.ts — demandCommand error message
- Potentially all commands using
demandCommand or argument validation
Summary
When certain
igcommands are run incorrectly (e.g., missing required sub-commands or arguments),the CLI currently outputs raw exception stack traces to the user. This is noisy, unhelpful, and
presents a poor developer experience.
Current Behavior
Running
ig generatewithout a sub-command produces output like:The full yargs internal stack trace is printed in red, even though this is an expected user error
(missing required sub-command), not an unexpected runtime exception.
Expected Behavior
actionable message — no stack trace.
a
--verboseor--debugflag.Suggested Improvements
YError(yargs validation errors / expected user mistakes) and actualruntime exceptions in the
parseAsynccallback incli.ts.YErrorinstances.--helpwhen a command is used incorrectly.--verboseflag to opt-in to full stack traces for debugging purposes.Affected Area
packages/cli/lib/cli.ts—parseAsyncerror callbackpackages/cli/lib/commands/generate.ts—demandCommanderror messagedemandCommandor argument validation