Task environments
Provision, inspect, and tear down task environments — the per-task sandboxed instances agents run against.
$ dn env <command>Provision and tear down task environments (sandboxed task instances).
create
Section titled “create”$ dn env create <task-ref>Provision a task environment.
task_ref follows the canonical [org/]name[@version] format:
my-task— latest visible version[email protected]— exact versionacme/my-task— cross-org (must be public or owned by you)acme/[email protected]— cross-org exact version
Use --input name=value repeatedly to bind template variables (values
are JSON-decoded when possible, falling back to plain strings).
With --wait, poll until the environment is ready (or reaches a
terminal failure/torn-down state). Without it, return as soon as the
server accepts the request.
Options
<task-ref>,--task-ref(Required)--input— Template variable binding (KEY=VALUE, e.g. —input target=https://example.com; JSON value allowed, repeatable).--secret— Secret id to inject into the sandbox (repeatable).--project-id— Optional explicit project UUID.--timeout-sec— Sandbox lifetime in seconds (capped by org max).--wait(defaultFalse) — Poll until the environment reaches a terminal state (ready/failed/torn_down).--wait-timeout-sec,--wait-timeout(default300.0) — Max seconds to wait for —wait (default 300).--poll-interval-sec,--poll-interval(default2.0) — Seconds between status polls under —wait.--json(defaultFalse)
Aliases: ls
$ dn env listList task environments in the current workspace.
Options
--state,--status— Filter by sandbox state (repeatable: running, paused, killed, etc.).--page(default1) — 1-indexed page number.--limit(default50) — Items per page.--json(defaultFalse)
$ dn env get <environment-id>Fetch a task environment by id.
Options
<environment-id>,--environment-id(Required)--json(defaultFalse)
$ dn env wait <environment-id>Block until an environment reaches a terminal state.
Polls until the environment is ready or torn_down, then prints
the current detail. Exits non-zero if the wait times out.
Options
<environment-id>,--environment-id(Required)--timeout-sec,--wait-timeout-sec,--wait-timeout(default300.0) — Max seconds to wait (default 300).--poll-interval-sec,--poll-interval(default2.0) — Seconds between status polls.--json(defaultFalse)
delete
Section titled “delete”Aliases: rm
$ dn env delete <environment-id>Tear down a task environment (terminates the sandbox).
Options
<environment-id>,--environment-id(Required) — The environment ID.--yes,-y(defaultFalse) — Skip the confirmation prompt.
$ dn env exec <environment-id>Run a shell command inside a provisioned task environment.
Requires the per-environment execute token returned by dn env create.
The token is not recoverable later — pass it via --token or
DREADNODE_ENVIRONMENT_TOKEN.
Exits with the command’s exit code so the CLI composes in shell scripts.
Options
<environment-id>,--environment-id(Required)<*>— Command to run inside the environment (pass after--).--token— Execute token fromdn env create. Falls back to $DREADNODE_ENVIRONMENT_TOKEN when unset.--timeout-sec(default30) — Max execution time in seconds (1-600).--json(defaultFalse)