Skip to content

CLI reference

Note

This documentation is auto-generated from the command line.

now

now - Nix-based distributed command runner.

Examples:
  # Initialize a basic workflow in ./now.nix
  now init

  # Load envvars from a dotenv file and run the default job(s)
  now run --env-file .env

  # Run the "deploy" job (and all dependencies) from the specified workflow,
  # and specify a remote builder for the run
  now run deploy \
    --builders "ssh://mac aarch64-darwin" \
    --workflow .now/remote.nix

  # Abort immediately on the first failing job,
  # and run all jobs on the local machine
  now run --abort --local-only

Usage: now <COMMAND>

Commands:
  init  Initialize a basic workflow
  list  List the jobs available in the workflow
  eval  Evaluate a workflow, printing its JSON representation
  run   Run one or more jobs
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

now init

Initialize a basic workflow

Usage: now init [WORKFLOW]

Arguments:
  [WORKFLOW]  Path to the workflow

Options:
  -h, --help  Print help

now list

List the jobs available in the workflow

Usage: now list [OPTIONS]

Options:
  -w, --workflow <FILE>
          Path to the workflow.

          Cannot be used together with the `--flake` option.

  -f, --flake <FLAKE[#ATTR]>
          Path to the flake and an optional attribute (defaults to the `now` output).

          Cannot be used together with the `--workflow` option.

  -e, --env-file <FILE>
          Optional dotenv file to read environment variables from

  -c, --cwdir <CWDIR>
          In which directory to evaluate the workflow

  -t, --tree
          Whether to print jobs as a graphviz-compatible .dot tree graph

  -h, --help
          Print help (see a summary with '-h')

now eval

Evaluate a workflow, printing its JSON representation

Usage: now eval [OPTIONS]

Options:
  -w, --workflow <FILE>
          Path to the workflow.

          Cannot be used together with the `--flake` option.

  -f, --flake <FLAKE[#ATTR]>
          Path to the flake and an optional attribute (defaults to the `now` output).

          Cannot be used together with the `--workflow` option.

  -e, --env-file <FILE>
          Optional dotenv file to read environment variables from

  -c, --cwdir <CWDIR>
          In which directory to evaluate the workflow

  -h, --help
          Print help (see a summary with '-h')

now run

Run one or more jobs

Usage: now run [OPTIONS] [JOB]...

Arguments:
  [JOB]...
          Jobs to target in this run. Unix-style globs are supported.

          If unspecified, the default jobs of the workflow are run.

          Cannot be used together with the `--all-jobs` option.

Options:
  -w, --workflow <FILE>
          Path to the workflow.

          Cannot be used together with the `--flake` option.

  -f, --flake <FLAKE[#ATTR]>
          Path to the flake and an optional attribute (defaults to the `now` output).

          Cannot be used together with the `--workflow` option.

      --dry-run
          Don't realize derivations or run jobs.

          Useful for debugging workflows before running them.

      --all-jobs
          Run all jobs in the workflow.

          Cannot be used together with any `[JOB]` arguments.

  -e, --env-file <FILE>
          Optional dotenv file to read environment variables from

      --gcroot-dir <DIR>
          Directory where Nix GC roots for realized steps are kept.

          Defaults to a temporary directory removed when `now` exits.

      --abort
          Immediately abort on the first job failure

      --termination-timeout <DURATION>
          Graceful termination timeout for steps when the job is aborted.

          When enabled, SIGTERM is first sent to each currently running step, then after the grace period, SIGKILL is sent to each still running step.

          A duration less than one second will signal instant termination.

          [default: 10s]

      --timeout <DURATION>
          Timeout for the entire workflow, eg. `1h`

      --keep-alive <KEEP_ALIVE>
          How often to send keep-alive messages to remote hosts. After not receiving a response 3 times, the job fails.

          Only set if the duration is greater than or equal to `1s`.

          Cannot be used together with the `--local-only` option.

  -c, --cwdir <CWDIR>
          In which directory to run the workflow.

          Defaults to the current directory if --workflow is set, and the directory that `now.nix` is in otherwise

      --builders <BUILDERS>
          A semicolon-separated list of build machines. When specified, overrides the remote builders configuration of the host.

          Cannot be used together with the `--local-only` option.

          For more information on the syntax, see: <https://nix.dev/manual/nix/latest/command-ref/conf-file#conf-builders>

      --cores <CORES>
          How many simultaneous jobs to use for local builds.

          Defaults to the number of physical cores in the current machine.

          Cannot be used together with the `--remote-only` option.

      --local-only
          When specified, ignores the remote builders configuration of the host, running all jobs in the local builder.

          Jobs that cannot run in the local builder will fail.

          Cannot be used together with either the `--builders`, `--remote-only`, or `--keep-alive` options.

      --remote-only
          When specified, runs all jobs in remote builders, only using the local runner for job orchestration.

          Cannot be used together with either the `--cores` or `--local-only` options.

      --skip
          When specified, skips jobs that don't match any builders or runners and their dependencies, instead of failing

  -l, --logging <LOGGING>
          Controls what extra info is prefixed on each log line.

          Cannot be used together with the `--tracing` option.

          Possible values:
          - minimal: Don't print anything before logs
          - host:    Only print host before logs
          - step:    Only print step before logs
          - full:    (default) Print host and step before logs

          [default: full]

      --tracing [<TRACING>]
          Whether to emit traces in Duper instead of colored logs.

          You can also set whether ANSI colors are included in the traces or not.

          For more information on Duper: <https://duper.dev.br>

          Cannot be used together with the `--logging` option.

          Possible values:
          - no-colors: (default) Don't include ANSI colors in output
          - colors:    Include ANSI colors in output

  -h, --help
          Print help (see a summary with '-h')