icore reference
Argument syntax, command definitions, execution, and output. For exact signatures and types, see the source for the published release. Public exports
Commands and arguments
| Task | API | Reference |
|---|---|---|
| Define types, constraints, and defaults | createCommand(), createCommand.withTypes() |
Option schemas |
| Parse arguments from the terminal | parseArgv() |
Argument syntax |
| Find a command by its path or alias | createCommands(), resolveCommand(), resolveCommandFromArgs() |
Command resolution |
Execution and output
| Task | API | Reference |
|---|---|---|
| Validate arguments before creating resources | app.prepare(), app.runPrepared() |
Two-step execution |
| Format text, tables, JSON, or CSV | createPresentation(), renderTextTable(), renderJson(), renderCsv() |
Output values |
| Write data or diagnostics | createOutput() |
Output channels |
Errors
IcoreError represents invalid input and invalid command definitions. isIcoreError(...) narrows an error, optionally by its code. isUsageError(...) identifies user input errors, including CliUsageError, which your application can throw for its own input rules. IcoreError types and codes · CliUsageError
The terminal application example shows how to preserve the original failure, close resources, and then apply the error policy. Cleanup and error handling