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 versionmy-task@1.0.0— exact versionacme/my-task— cross-org (must be public or owned by you)acme/my-task@1.0.0— 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, 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(default300.0) — Max seconds to wait for —wait (default 300).--poll-interval(default2.0) — Seconds between status polls under —wait.--json(defaultFalse)
$ dn env listList task environments in the current workspace.
Options
--state— 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)
status
Section titled “status”$ dn env status <environment-id>Print a lightweight state snapshot — shell-script friendly.
Options
<environment-id>,--environment-id(Required)--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)--force,-f(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)