Skip to content

Options

OptionMeaning
-s SLOTthe slot name in the object or bundle, like Release.Agnostic
-p ASSETthe path of the asset in the bundle
-c COMMAND, --command COMMANDstrictly relative command path inside the anonymous command directory
-f FILE, --file FILEwrite to FILE (overwriting if it exists)
-d DIR, --dir DIRwrite to directory DIR (creating it if needed)
-n STRIP, --strip STRIPwhen writing to a directory, strip this many leading path components [default: 0]
-m MEMBER, --member MEMBERwhen writing to a tar archive, only extract MEMBER; for run-object/run-asset it also implies the command path

Use -- to separate the global options from the command and its arguments.

  • -help, --help - show help and exit.
  • --version - show version information and exit.
  • -v, --verbose - show command lines while building; show values when complete. Repeat for more verbosity (max three).
  • --quiet - don't show progress status; command lines still shown with -v.
  • --global - set defaults to XDG directories under the dk program name.
  • --install PROGRAM - [caution] install files to XDG directories under PROGRAM for forms with XDG variables (${STATE}, ${CACHE}), and to home directories for ${HOME}.
  • -I DIR - include directory to search for values.json[c] and *.values.json[c] (also library subdirectories, e.g. DIR/SomeLibrary_Std/values.json). Repeatable.
  • --cell NAME=PATH - add a subdivision of project source code with the given NAME and PATH; later cells override earlier cells with the same name.
  • -C DIR - change to DIR before doing anything else.
  • --execution-abi ABI - set the execution_abi wildcard; defaults to the ABI of this build executable (e.g. Darwin_arm64, Windows_x86_64).
  • --target-abi ABI - set the target_abi wildcard; defaults to --execution-abi.
  • -d MODE - enable debugging (-d list lists modes).
  • -x TARGET, --invalidate TARGET - invalidate TARGET before running the command; like invalidate but saved only if the command succeeds. Repeatable.
  • --import lazy|eager - import values from distributions lazily, or all values for all slots at once [default: lazy].
  • -a, --autofix - [caution] automatically fix problems like incorrect checksums.
  • -t BUILD_TIMESTAMP, --build-timestamp BUILD_TIMESTAMP - from the ISO-8601 BUILD_TIMESTAMP (2021-02-03T04:05:06Z), set the semver "build metadata" for invalidated and new objects' versions to bn-YYYYMMDDhhmmss.
  • -P BUILD_PERIOD, --build-period BUILD_PERIOD - as -t, modulo BUILD_PERIOD. Suffixes: s seconds, m minutes, h hours, d days.
  • -n BUILD_NUMBER, --build-number BUILD_NUMBER - set the build metadata to bn-BUILD_NUMBER (omit the bn- prefix).

The build metadata is constructed from dk0's -t TIMESTAMP command-line option in the bn-YYYYMMDDhhmmss format. In CI, pass the commit timestamp:

# GitHub Actions
run: dk0 -t "${{ github.event.head_commit.timestamp }}" ...
# GitLab CI
- dk0 -t "$CI_COMMIT_TIMESTAMP" ...
  • --integrity none|existence|checksum - verify the local value store against the trace store. none is fastest but can't tell if values are evicted; existence checks for the existence of values (fetching from a remote value store if present); checksum is slowest, skips any value read without a constructive-trace entry, and removes it if permitted [default: existence].
  • --random-seed SEED - seed the RNG for operations needing randomness (e.g. signing build files). Highly insecure but allows reproducible trace/value stores; if unset, a seed is generated from system entropy.
  • --trust-local-package PACKAGE_ID - allow loading distributions from PACKAGE_ID even if their signatures cannot be verified. Repeatable.
  • --dangerously-trust-all - skip all trust prompts and allow every privileged operation. Don't do it.
  • --keys-env ENV_PREFIX - use <ENV_PREFIX>_PUBKEY and <ENV_PREFIX>_SECKEY as the build public/secret key (lines may be separated with pipes or newlines).
  • --keys-dir DIR - directory for the build.pub/build.sec keys [default: <workspace>/t/k, or <xdg config>/dk with --global].
  • --data-dir DIR - data files [default: <workspace>/t/d, --global: <xdg data>/dk].
  • --cache-dir DIR - transient cache files [default: <workspace>/t/c, --global: <xdg cache>/dk].
  • --valuestore DIR - the value store for assets and intermediate build artifacts [default: datadir/val.1].
  • --tracestore DIR - the trace store for successful builds and their dependent assets/artifacts [default: datadir/cts.1].
  • -I DIR - include directory (see Global options).
  • -isystem DIR - add DIR to the system include directories.
  • -nobuiltininc - do not include built-in modules like MlFront_Attestation.GitHubCLI.
  • -nosysinc - do not include the system include directories (the etc/dk/i directory where dk0 is installed) or any -isystem dirs.
  • -noworkspaceinc - do not include the workspace include directories (etc/dk/i and etc/dk/v in the workspace).
  • --errors-color / --errors-plain / --errors-pretty - control error-message formatting [default: plain if CI=true, otherwise color].
  • --ancestor-graph FILE / --dependency-graph FILE - at exit, print a DOT-format ancestor/dependency graph to FILE or stdout (-).
  • --print-platform-ids - print platform-specific ids that affect cache ids.
  • --print-config - print configuration and exit.
  • --wait-trace-store - when multiple builds run in the same directory, wait for the trace store to become available (nothing printed while waiting).
  • -f FILE - a package search start file: the directory of FILE is implicitly added with -I DIR, and ancestor directory names form a package id for forms without one.
  • -p PACKAGE, --package PACKAGE - the package for forms without explicit package ids [default: inferred from parent directories].
  • --long - use long identifiers to avoid collisions (on Windows, enable long paths first).