Overview
Supported public API reference for @crustjs/core.
These pages cover the @crustjs/core root API, with build- and render-time helpers explicitly scoped to @crustjs/core/tooling below.
Runtime API
| Export | Description |
|---|---|
Crust | Immutable, chainable command builder and invocation boundary |
defineCommand(name, config?, recipe) | Define a named, inert reusable command definition for .add() |
defineContext(name, config?, setup) | Define a named command dependency factory |
defineExtension(id, config?) | Define an application-wide Extension |
defineExtension(id, factory) | Build an Extension factory with .id from a config-returning callback |
defineExtension<MetaKeys>() | Specialize an Extension definer with required root metadata keys |
defineExtensionId(id) | Mint a branded Extension identity from a non-empty, trimmed string |
defineFlag(name, definition) | Define one named flag, preserving its literal definition |
defineArg(name, definition) | Define one named positional argument |
CrustError | Structured framework error with one of four stable codes |
resolveArtifactDir(name) | Absolute path of an artifact or crust.include directory at runtime |
Types
See Types for command definitions, Command Snapshots, Command Action contexts, Contexts, Extensions, and error detail types. The utility intersections are MergeFlags and MergeContext.
The package root contains invocation-time authoring and execution APIs. @crustjs/core/tooling
exports the supported CommandSnapshot type consumed by
app.snapshot(), plus build- and render-time helpers: isListed(),
sectionsFor(), visibleSectionsFor(), formatDefault(), formatDescription(), the
presentation-neutral buildCommandDocumentation() model with its CommandDocumentation
(including unfiltered command sections), DocumentationArg, DocumentationFlag, and
UsageSegment types, and the SNAPSHOT_PATH_ENV and BUILD_OUT_DIR_ENV subprocess-protocol
constants. These helpers move in lockstep with first-party tooling.