Complete reference for all dlab commands and options.
dlab [command] [options]The primary command is dlab run. As a backward-compatible shorthand, its options may also be passed directly at the root — dlab --dpack ... is equivalent to dlab run --dpack ....
Execute opencode in a Docker container with your data and prompt.
dlab run --dpack PATH --data PATH [--data PATH ...] --prompt TEXT [options]| Argument | Description |
|---|---|
--dpack PATH |
Path to the decision-pack configuration directory |
--data PATH |
Data file or directory to copy into the workspace (repeat for multiple files: --data a.csv --data b.csv) |
--prompt TEXT |
Prompt text for the agent |
--data is required unless the decision-pack sets requires_data: false in config.yaml. --prompt (or --prompt-file) is required unless the decision-pack sets requires_prompt: false.
| Argument | Description |
|---|---|
--prompt-file PATH |
Read prompt from file (mutually exclusive with --prompt) |
--model MODEL |
Override the default_model from config |
--work-dir PATH |
Explicit work directory path (default: auto-generated) |
--continue-dir PATH |
Resume a previous session from this directory |
--rebuild |
Force rebuild Docker image even if cached |
--env-file PATH |
Path to environment file (auto-detected from decision-pack .env if not specified) |
--no-sandboxing |
Run opencode locally without Docker (see below) |
With --no-sandboxing, dlab skips Docker entirely and runs opencode directly on the host. The decision-pack's docker/ directory is copied into the work dir as _docker/, and instructions are prepended to the prompt telling the agent to provision its own environment from it. Pre-run and post-run hooks are not executed in local mode.
Use this when Docker is unavailable or for quick iteration; the sandboxing and reproducibility guarantees of the Docker environment do not apply.
All environment variables starting with DLAB_ are automatically forwarded from the host to the Docker container. This lets decision-packs define their own configuration variables without framework changes.
# Example: MMM decision-pack uses this to control local vs Modal fitting
DLAB_FIT_MODEL_LOCALLY=1 dlab run --dpack mmm --data ./data --prompt "..."Resume an interrupted session:
dlab run --dpack ./my-dpack --continue-dir ./analysis-001 --prompt "Continue"This refreshes the .opencode config and hook scripts from the decision-pack, then runs opencode in the existing work directory. Cannot be combined with --data.
# Basic usage
dlab run --dpack ./my-dpack --data ./data --prompt "Analyze this CSV"
# Multiple data files (repeat --data for each file)
dlab run --dpack ./my-dpack --data file1.csv --data file2.csv --prompt "Compare"
# With model override
dlab run --dpack ./my-dpack --data ./data \
--prompt "Build a model" \
--model anthropic/claude-opus-4
# Resume interrupted session
dlab run --dpack ./my-dpack --continue-dir ./analysis-001 \
--prompt "Continue the analysis"
# Environment file (auto-detected from decision-pack .env if present)
dlab run --dpack ./my-dpack --data ./data --prompt "Analyze"The run command shows phased progress with Rich formatting:
dlab . my-dpack . opencode/big-pickle
Session: ./analysis-001
[1/4] Setting up environment
Image: dlab-my-dpack (cached)
Warning: 3 dangling Docker image(s) using disk space
Clean up with: docker image prune -f
Container started: analysis-001
[2/4] Pre-run hooks
deploy_modal.sh
Deploying Modal app...
Modal app deployed.
[3/4] Running agent ...
╭────────────── Monitoring ───────────────╮
│ dlab connect ./analysis-001 │
│ Live-monitor the run │
│ │
│ dlab timeline ./analysis-001 │
│ View execution timeline after the run │
╰─────────────────────────────────────────╯
[4/4] Cleanup
Stopping container...
Done.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | CLI error (missing args, invalid config, etc.) |
| 128+N | Terminated by signal N (e.g., 130 = Ctrl+C) |
dlab run returns opencode's exit code, so an agent-level failure (invalid
API key, unknown model) exits non-zero even when the session lifecycle
(image build, container, hooks, cleanup) completed — dlab's exit code
deliberately mirrors the agent's outcome. On failure, dlab scans the session
log for known fatal signatures (model not in opencode's catalog, rejected
API key, exhausted credits) and prints a "Likely cause" hint.
Model preflight validates against the bundled catalog merged with a
user-level cache (~/.cache/dlab/models.json); when the cache is older than
seven days, dlab run refreshes it from models.dev in the background — the
refresh never blocks or fails a run.
Interactive TUI wizard to create a new decision-pack directory.
dlab create-dpack [OUTPUT_DIR]| Argument | Default | Description |
|---|---|---|
OUTPUT_DIR |
. |
Directory where the decision-pack will be created |
- Basics — decision-pack name, description
- Container — package manager (conda/pip/uv/pixi), base Docker image
- Features — Decision Hub integration, Python library, Modal, requires_data, requires_prompt
- Model — default model with live search from models.dev API
- Permissions — opencode.json permission configuration
- Skeletons — directory scaffolding (skills, tools, subagents, parallel agents)
- Skills — search and download skills from Decision Hub
- Review — summary and create
| Key | Action |
|---|---|
| Tab / Shift+Tab | Navigate between fields |
| Arrow keys | Navigate between fields, select in lists |
| Enter | Confirm selection |
| Ctrl+Q | Quit wizard |
| Esc | Go back to previous screen |
Interactive TUI wizard to create a parallel agent configuration.
dlab create-parallel-agent [DPACK_DIR]| Argument | Default | Description |
|---|---|---|
DPACK_DIR |
. |
Path to the decision-pack config directory |
- Agent — select an existing agent or create a new one (agents already configured are greyed out)
- Description — optional documentation
- Timeout — maximum runtime per instance (minutes)
- Failure behavior — continue, fail fast, or retry
- Suffix prompt — instructions appended to each worker's prompt (pre-filled template)
- Consolidator prompt — instructions for combining results (pre-filled template)
- Consolidator model — model for the consolidation step
Creates opencode/parallel_agents/{name}.yaml and optionally opencode/agents/{name}.md (if creating a new agent).
Install a decision-pack as a wrapper script for convenient access.
dlab install PATH [--bin-dir PATH]| Argument | Description |
|---|---|
PATH |
Path to the decision-pack configuration directory |
| Option | Default | Description |
|---|---|---|
--bin-dir PATH |
~/.local/bin |
Directory to install the wrapper script |
dlab install ./my-dpack
# After installation:
my-dpack --data ./data --prompt "Analyze this"Launch a TUI to monitor running or completed sessions.
dlab connect WORK_DIRThe --log and --log-json flags are reserved but not yet implemented — passing them prints an error and exits.
- Left sidebar: Agent selector showing all agents (main, parallel instances, consolidator)
- Main area: Log events for selected agent with timestamps
- Right sidebar (toggleable): Artifacts pane showing files created by agent
- Bottom: Status bar (running/completed, cost, duration)
| Key | Action |
|---|---|
q |
Quit |
/ |
Focus search |
Esc |
Clear search |
a |
Toggle artifacts pane |
e / c |
Expand / collapse all events |
j / k |
Next / previous agent |
Enter |
Expand/collapse selected event |
Tab |
Focus artifacts pane (when visible) |
Display execution timeline and Gantt chart for a session.
dlab timeline [WORK_DIR]| Argument | Default | Description |
|---|---|---|
WORK_DIR |
Current directory | Path to session work directory |
- Log file summaries: Start time, duration, event count, and cost per agent
- Event timeline: Chronological trace of tool calls and text outputs
- Cost breakdown: Total and per-agent API costs
- Gantt chart: Visual representation of parallel execution
Open a browser-based session viewer with a DAG visualization of the session (orchestrator, parallel instances, consolidator) and a detail panel per node.
dlab view WORK_DIR [--port PORT] [--no-open] [--export FILE]| Argument | Default | Description |
|---|---|---|
WORK_DIR |
— | Path to session work directory |
| Option | Default | Description |
|---|---|---|
--port PORT |
auto-select | Port for the viewer server |
--no-open |
— | Start the server without opening a browser |
--export FILE |
— | Write a self-contained HTML file instead of starting a server |
dlab --help
dlab create-dpack --help
dlab create-parallel-agent --help
dlab connect --help
dlab timeline --help
dlab view --help
dlab install --help