Reference
CLI reference
Every dsfc command, its arguments and its exit status.
PATH is a package directory (containing design-system.dsf) or a manifest file, and
defaults to the current directory.
| Exit status | Meaning |
|---|---|
0 |
Success. Warnings (such as DSF-A003) do not change it, unless --deny-warnings is given. |
1 |
An error diagnostic was reported, a warning under --deny-warnings (check, test, ir, build, generate), or fmt --check found unformatted files. |
2 |
Usage error (unknown command or argument). |
Commands that take --format json print one JSON object on standard output: diagnostics,
ok, and command data. In text format, diagnostics go to standard error.
dsfc check
dsfc check [PATH] [--target NAME]... [--format text|json] [--deny-warnings]
dsfc check --config FILE [--target NAME]... [--format text|json] [--deny-warnings]
Checks the package: manifest, sources, syntax, tokens, components, behavior, accessibility,
contrast, layout (impossible size constraints, DSF-Y001, and content that certainly
overflows, DSF-Y002, with the reference layout model), invalid variant combinations, usage
rules, assets (including pinned icon libraries) and examples. test, ir, build and
generate run the same analysis first and produce nothing when it reports an error. In CI,
--deny-warnings makes warnings fail the command.
With --target (swiftui, angular, dtcg, docs; repeatable), check also checks the
capabilities of each target, with its default options: the target is produced in memory
exactly as build produces it, and nothing is written. A construct the target cannot realize
is DSF-X001, a declared fallback it uses DSF-X002, a capability it realizes with
generated code rather than a platform API DSF-X003 (info), and one it realizes only in part
(a user preference it cannot follow, a value it cannot expose) DSF-X004, a warning that
--deny-warnings refuses, unless the project file accepts it for that target (accept,
see Configuration): then an info that says so, counted
1 approximated (1 accepted); each target’s tally follows
(capabilities of swiftui: 56 native, 16 custom, 0 approximated, 0 fallback, 0 unsupported). With
--config, it checks the package of a project file and its targets
(or the named ones) with their options, as generate would; only what depends on the output
directories (DSF-P009) is left to generate. Without a target, the output says that
capabilities were not checked. The capability IDs are listed in the
capability registry.
In text output, errors and warnings come first, then infos; an info repeated at several
locations is printed once, followed by (also at …). --format json adds targets and
capabilities (each target’s report, as in dsf-build.json).
dsfc test
dsfc test [PATH] [--format text|json]
Runs every example against the reference semantics, geometry expectations against the
reference layout model. A failure is DSF-E001; an example that cannot run yet is reported as
not run.
dsfc build
dsfc build [PATH] --target swiftui|angular|dtcg|docs --output DIR [--option KEY=VALUE]...
Checks, then generates one target below DIR, plus dsf-build.json (files and capability
report). Writes nothing when an error is reported. Options are listed on each target page:
SwiftUI, Angular,
DTCG JSON, Documentation site.
dsfc generate
dsfc generate [--config FILE] [--target NAME]...
Reads the project file (dsf.hcl by default) and generates every
target it declares, or only the named ones. Everything is produced in memory: nothing is
written when any error is reported. Files that the previous dsf-build.json of a target
lists and that are no longer produced are removed; a file dsfc did not write for that
target is never overwritten, and two targets never share a directory, even under two
spellings (out and Out, x/../out, a link) (DSF-P009). An invalid project file is
DSF-P007.
dsfc fmt
dsfc fmt [PATH]... [--check]
Formats .dsf files in the canonical style; directories are searched for *.dsf. With
--check, lists unformatted files and fails instead of rewriting them. Comments are kept.
dsfc ir
dsfc ir [PATH] [--output FILE]
Checks the package and prints its intermediate representation as canonical JSON (draft
schema 0.1.0-draft). The same package always produces byte-identical output.
dsfc tokens
dsfc tokens import FILE [--root DIR] [--output FILE] [--format text|json]
dsfc tokens export [PATH] --output DIR [--materialize] [--format text|json]
dsfc tokens resolve [PATH] [--input NAME=CONTEXT]... [--format text|json]
| Command | Does |
|---|---|
import |
Converts a DTCG .tokens.json or .resolver.json document to .dsf tokens. Referenced files must stay inside --root. |
export |
Writes the package’s tokens as DTCG 2025.10 JSON below DIR. Fails on values DTCG cannot represent; with --materialize, writes computed values as literals and a loss report (<package>.loss.json). |
resolve |
Prints the resolved tokens of one resolver input. PATH may also be a DTCG JSON file. |
See DTCG JSON for examples.
--output has the short form -o. dsfc --version prints the version, dsfc help <command> the help of a command.