@dtifx/cli
v4.1.6
Published
Unified DTIFx command line that orchestrates diff, build, and audit workflows.
Downloads
30
Maintainers
Readme
Overview
@dtifx/cli publishes the dtifx executable. It unifies the extract, diff, build, and audit
runtimes so you can run every DTIFx workflow through one entry point with consistent logging,
telemetry, and error handling.
Installation
pnpm add -D @dtifx/cli @dtifx/audit @dtifx/build @dtifx/diff @dtifx/extractors
# or
npm install --save-dev @dtifx/cli @dtifx/audit @dtifx/build @dtifx/diff @dtifx/extractors- Requires Node.js 22 or later.
@dtifx/audit,@dtifx/build, and@dtifx/diffare peer dependencies. Install the packages that match your workflows.@dtifx/extractorsprovides the provider clients used by thedtifx extractnamespace.
Usage
Command line
# discover available namespaces and flags
pnpm exec dtifx --help
# run extract, audit, diff, and build workflows
pnpm exec dtifx extract figma --file ABC123 \
--token $FIGMA_ACCESS_TOKEN --output tokens/figma.json
pnpm exec dtifx extract penpot --file demo-file \
--token $PENPOT_ACCESS_TOKEN --output tokens/penpot.json
pnpm exec dtifx extract sketch --file ./design-library.json \
--output tokens/sketch.json
pnpm exec dtifx audit run --config ./dtifx.config.mjs
pnpm exec dtifx diff compare tokens/base.json tokens/feature.json
pnpm exec dtifx build generate --out-dir dist/tokensKernel-wide flags shared across namespaces include:
--json-logs– Emit NDJSON logs for CI ingestion.--telemetry <mode>– Export spans (noneorstdout).
Build and audit commands expose additional options such as --config, --out-dir, and --timings,
while diff-specific options are documented within their respective --help output.
Run dtifx <namespace> <command> --help for command-specific options.
Programmatic access
Import the CLI kernel to embed DTIFx workflows within custom hosts:
import {
auditCommandModule,
buildCommandModule,
createCliKernel,
diffCommandModule,
} from '@dtifx/cli';
const kernel = createCliKernel({
programName: 'dtifx',
version: '0.0.1',
});
kernel.register(auditCommandModule).register(buildCommandModule).register(diffCommandModule);
await kernel.run(process.argv);Testing adapters are available under @dtifx/cli/testing for driving commands without touching the
file system.
