parse
Generated reference page for the parse function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/parse/index.ts - Source link:
packages/dreamcli/src/core/parse/index.ts:332
Signatures
ts
function parse(schema: CommandSchema, argv: readonly string[]): ParseResult;| Parameter | Type | Description |
|---|---|---|
schema | CommandSchema | The command schema to parse against |
argv | readonly string[] | Raw argv strings (NOT including the command name itself) |
Members
Members
parse
Parse tokenized argv against a command schema.
Low-level API: most apps should let cli() or runCommand() handle parsing automatically. Call parse() directly when you need raw parsed values before env/config/default resolution or when writing custom tooling around schemas.
ts
(schema: CommandSchema, argv: readonly string[]): ParseResult;Examples
ts
const parsed = parse(deploy.schema, ['production', '--force']);
// => { args: { target: 'production' }, flags: { force: true } }