CLI
zb is the DAGZ command-line tool. It manages the local daemon and inspects test results: jobs, tests, spans, coverage,
and logs.
Install
curl -LsSf https://dagz.run/install.sh | bash
Daemon and environments
zb use
List available environments, or switch to one. DAGZ maintains one env per workspace under ~/.dagz/<env>.env/; the
default local is used unless you've switched.
zb use # list environments
zb use <env-id> # switch the current environment (e.g. to a deployed team server)
zb daemon up / down
Manage the local daemon (embedded ClickHouse, KV store, and web server). The daemon is shared across repos. Start it
once and run pytest --dagz in any project.
zb daemon up # start in foreground
zb daemon up --bg # daemonize; logs to ~/.dagz/local.env/web/web.log
zb daemon up --restart --bg # stop a running daemon first, then start fresh
zb daemon down # stop the daemon
The dashboard runs at http://localhost:29111.
zb login
Authenticate the CLI with a remote DAGZ server.
Running tests
zb select-tests
Preview test selection for the current working tree.
zb select-tests # list selected tests
zb select-tests --trace # show why each test was selected
Inspecting jobs
zb jobs
List recent jobs with status, duration, and selected/skipped counts.
zb jobs # last 10 jobs
zb jobs --last 50 # last 50
zb logs <job>
Print the captured stdout/stderr from a finished job.
zb logs j10 # the 10th job today
zb logs j1201.1 # December 1st's first job
zb logs j10 --group-by-worker # group output per worker
For the daemon's own log, tail ~/.dagz/local.env/web/web.log directly.
Inspecting spans
A span is a single execution flow inside a job (a test, a fixture, a subprocess, etc.). See Concepts: Spans.
zb spans <job>...
Tree of spans for one or more jobs, sorted by start time (default), elapsed time, CPU, wait, or memory.
zb spans j10
zb spans j10 j11 --sort elapsed
zb span-deps --span <name>
Show the dependencies discovered by a single span. Useful for understanding why a test was selected, or for debugging missing/spurious dependencies.
zb span-deps --span 'test:tests/test_foo.py::test_bar'
zb span-deps --span 'test:tests/test_foo.py::test_bar' --job j10
zb span-deps --span 'test:tests/test_foo.py::test_bar' --trace trace_j10.bin # from a downloaded trace file
zb span-logs <span>
Captured stdout/stderr from a single span across recent runs. Pulls the last N occurrences of that span (across jobs) so you can compare its log output over time.
zb span-logs 'test:tests/test_foo.py::test_bar'
zb span-logs 'test:tests/test_foo.py::test_bar' -n 20 # last 20 occurrences
zb span-logs 'test:tests/test_foo.py::test_bar' --no-logs # summary only
The span identifier is <type>:<name>, e.g. test:path/to/test.py::TestClass::test_method. If you omit the type
prefix, test: is assumed.
Coverage
zb cov <path>...
Annotate source files with hit/miss markers in the terminal.
zb cov src/dagz/scheduler.py
zb cov src/dagz/ # whole directory
zb cov src/foo.py --job j10 # coverage from a specific job
zb cov src/foo.py --trace trace_j10.bin # from a downloaded trace file
zb cov src/foo.py --who 12,40 # which spans, units or global hits hold the probes of lines 12 and 40
zb export-cov
Export coverage as a standard report file. See Coverage → Exporting coverage for details.
zb export-cov --format pycoverage # .coverage (SQLite, coverage.py-compatible)
zb export-cov --format xml # coverage.xml (Cobertura)
zb export-cov --format xml -j j10 -o out.xml
zb export-cov --format xml --trace trace_j10.bin -o out.xml # from a downloaded trace file
zb export-cov --format xml --stats # also print what the trace holds (spans/modules with hits)
--trace takes the trace .bin downloaded from the jobs page instead of reading the job from the server.
Misc
zb version
Print the embedded zb version.
Daemon config
On first start the daemon writes ~/.dagz/local.env/daemon.yaml. Edit it and run zb daemon up --restart --bg to
apply. See Running on Mac with Docker for an example.