Skip to content

API Reference

@theme-kit/cli

Generate, validate, migrate, inspect and export themes from the command line.

Functions

cmdExport(args): Promise<void>

ParameterTypeDescription
argsParsedArgs

Returns Promise<void>


cmdGenerate(args): Promise<void>

ParameterTypeDescription
argsParsedArgs

Returns Promise<void>


cmdInspect(args): Promise<void>

ParameterTypeDescription
argsParsedArgs

Returns Promise<void>


cmdMigrate(args): Promise<void>

ParameterTypeDescription
argsParsedArgs

Returns Promise<void>


cmdValidate(args): Promise<void>

ParameterTypeDescription
argsParsedArgs

Returns Promise<void>


parseArgs(argv): ParsedArgs

ParameterTypeDescription
argvstring[]

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.

MemberTypeDescription
constructorUsageError
cause (optional)unknown
messagestring
namestring
stack (optional)string
stackTraceLimitnumberThe 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

MemberTypeDescription
_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"


@theme-kit/cli — API Reference — Theme Kit