API Reference
@theme-kit/cli
Generate, validate, migrate, inspect and export themes from the command line.
Functions
cmdExport(args): Promise<void>
| Parameter | Type | Description |
|---|---|---|
args | ParsedArgs | — |
Returns Promise<void>
cmdGenerate(args): Promise<void>
| Parameter | Type | Description |
|---|---|---|
args | ParsedArgs | — |
Returns Promise<void>
cmdInspect(args): Promise<void>
| Parameter | Type | Description |
|---|---|---|
args | ParsedArgs | — |
Returns Promise<void>
cmdMigrate(args): Promise<void>
| Parameter | Type | Description |
|---|---|---|
args | ParsedArgs | — |
Returns Promise<void>
cmdValidate(args): Promise<void>
| Parameter | Type | Description |
|---|---|---|
args | ParsedArgs | — |
Returns Promise<void>
parseArgs(argv): ParsedArgs
| Parameter | Type | Description |
|---|---|---|
argv | string[] | — |
Returns ParsedArgs
Classes
class UsageError
Extends Error
Thrown by commands when the user passes invalid arguments. Reported by the
CLI runtime with exit code Usage (2) and a usage hint.
| Member | Type | Description |
|---|---|---|
constructor | UsageError | — |
cause (optional) | unknown | — |
message | string | — |
name | string | — |
stack (optional) | string | — |
stackTraceLimit | number | The Error.stackTraceLimit property specifies the number of stack frames |
collected by a stack trace (whether generated by new Error().stack or | ||
Error.captureStackTrace(obj)). |
The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will
not capture any frames. |
| captureStackTrace | void | — |
| prepareStackTrace | any | — |
Interfaces
ParsedArgs
| Member | Type | Description |
|---|---|---|
_ | string[] | — |
Variables
ExitCodes
Stable process exit codes for the theme-kit CLI.
These are guaranteed by the command implementations and documented in the CLI README and docs. Consumers (CI pipelines, editor integrations) can rely on them without parsing stdout.
Readonly<{ Error: 1; OK: 0; Usage: 2; ValidationFailed: 3 }>
VERSION
The @theme-kit/cli package version, surfaced by theme-kit --version.
Must stay in sync with the "version" field in packages/cli/package.json;
scripts/release/audit-packages.mjs fails the release gate if they drift.
"1.0.2"