CLI & Configuration
1. Command Surface
Section titled “1. Command Surface”The package entry point is deepbuilder = deepbuilder.interfaces.cli:main. Before dispatching any command except config, the Click group loads dotenv files and installs process-group cleanup handlers. Implementation paths below are relative to the deepbuilder/ package.
| Command | Purpose | Implementation |
|---|---|---|
tui |
Start the full-screen terminal interface for chat, task preparation (/long-research), and managed research (/tasks, /status, /stop, /resume, /web). --resume restores a saved chat session. |
interfaces/cli/commands/run/tui.py |
run |
Run TARGET (a task ID, a local task folder, or a quoted new-task description) through the managed research lifecycle. Without TARGET it opens an interactive task picker; --manifest FILE launches a manifest instead. Runs are detached unless --tui attaches a terminal view. |
interfaces/cli/commands/run/task.py, runtime/parallel/control/ |
status |
Inspect one managed run, or list recent runs for the current workspace (--all lists runs across workspaces). |
interfaces/cli/commands/run/control/ |
stop / resume |
Stop or resume a managed run by run ID or task directory; an omitted target uses the current directory. resume --tui attaches a TUI. |
runtime/parallel/control/ |
web |
Start or stop (web stop) the workspace Web monitor and final-report viewer. Listens on 127.0.0.1:8765 by default. |
interfaces/ui/web_monitor/ |
config |
Manage the user model configuration: config init creates a template, config path prints its location. |
interfaces/cli/user_config.py |
run accepts --workers, --duration (minimum 10m), --cpu, --gpu (cpu, auto, or explicit IDs), --config, --input-data-dir, and --execution-root. With --manifest, these options are rejected and all run settings come from the manifest. --workspace selects the management workspace that holds chat sessions and the task board; --execution-root places each new task directory on another local disk. Managed run records live under ~/.local/state/deepbuilder/managed_runs/ (or $XDG_STATE_HOME).
The following advanced commands still work but are hidden from deepbuilder --help:
| Command | Purpose | Implementation |
|---|---|---|
prep |
Prepare a flat workspace dataset. It runs the data-preparation agent by default; --link-only exposes input entries as symlinks. |
research/solver/data_prep.py, research/solver/lnr/lifecycle/workspace/prep_fs.py |
repl |
Run an interactive DeepAgent session from explicit paths or a single-task manifest, with optional automatic first turn. | interfaces/cli/commands/run/repl.py, runtime/workflow.py |
parallel |
Run manifest tasks in the foreground with bounded concurrency and per-task CPU/GPU environment isolation. | runtime/parallel/execution/runner.py |
monitor |
Render a Rich dashboard from one task log directory or a parallel manifest. | interfaces/ui/monitor/ |
monitor-trace |
Build a self-refreshing HTML trend view from a parallel manifest. | interfaces/ui/monitor_trace/ |
resource-summary |
Aggregate one or more resource_events.jsonl files as a table or JSON. |
research/solver/lnr/resources/runtime/execution/state/unified_store.py |
replay-prepare |
Copy a saved LNR run into an isolated replay directory and truncate memory to a selected pending tool call. | research/solver/lnr/transitions/replay_prepare.py |
agent |
Run the embedded InquiryCraft agent (run, repl, sessions, tools, events, config) with the configured model pool. |
interfaces/cli/commands/run/lazy.py |
Every option can also be set through an environment variable, shown in each command’s --help (for example DEEPBUILDER_RUN_WORKERS or the shared DEEPBUILDER_WORKERS).
2. Configuration Model
Section titled “2. Configuration Model”deepbuilder/foundation/config/default.yaml is a small include file. Stable defaults are split by responsibility under deepbuilder/foundation/config/profiles/defaults/, and LNR defaults are further split under defaults/lnr/.
Config├── agent # code and feedback model settings, routing, price metadata├── exec # debug and task CPU/GPU lists├── workspace # input root, task root, task identity, tracing├── repl # interactive profile, step budget, workspace Git behavior├── tool # sandbox, tool concurrency, output and memory limits├── lnr # workers, stages, ESTRA, folding, snapshots, resources, merge├── evaluator # candidate, metric, backend, command environment, event logs├── gate # trusted Gate policy and configurable parameters└── profile_overridesConfiguration is represented by dataclasses re-exported from foundation/config/schema/settings.py. A run starts from the default include graph or a custom overlay, then applies task profile and explicit manifest/CLI overrides. Task packages remain authoritative for their artifact, metric, evaluator, and Gate declarations.
User configuration
Section titled “User configuration”Model endpoints are kept outside the repository in a structured model registry, by default ~/.config/deepbuilder/models.json (or under $XDG_CONFIG_HOME). deepbuilder config init writes a template with mode 600 and never overwrites an existing file; deepbuilder config path prints the location without showing credentials. The registry defines model aliases with per-role (code, feedback) endpoints and pricing, plus defaults.code_models and defaults.feedback_models. When a config is loaded, the registry fills agent.code and agent.feedback unless a stage already carries explicit endpoints and no aliases. The TUI and agent commands read the same file and accept --model-config to point elsewhere.
Environment variables come from, in priority order: the process environment, --env-file (or DEEPBUILDER_ENV_FILE), the nearest project .env found from the working directory, the source checkout’s .env, ~/.config/deepbuilder/.env, and ~/.deepbuilder/.env.
3. Current Default Behavior
Section titled “3. Current Default Behavior”| Setting | Default | Meaning |
|---|---|---|
lnr.wall_clock_budget_sec |
3600 |
One-hour task budget unless the manifest overrides it. |
lnr.max_steps |
500 |
Maximum LLM/tool rounds for a worker session. |
lnr.num_workers |
1 |
One persistent worker by default. |
lnr.omp_threads_cap |
8 |
Maximum OpenMP threads assigned to each worker CPU slice. |
lnr.estra_enabled |
true |
Enable evidence-based continue, redirect, and previous-stage restoration decisions. |
lnr.stage_memory_folding_enabled |
true |
Fold old stage cards into persistent summaries when the stage-memory view exceeds its budget. |
lnr.resource_control_mode |
resource_smart_llm |
Enable the full resource runtime, admission LLM, arbiter LLM, owning-agent advisory, queue, and GPU sharing. |
evaluator.task_profile / backend |
auto / auto |
Resolve the effective profile and evaluator from a registered task package. |
evaluator.stage_source_mode |
primary |
Use the Gate outcome as the sole Stage-admission decision. |
repl.repl_profile / repl_tool_preset |
lite / bash_write |
Use the compact REPL prompt and write files through bash rather than legacy write/edit tools. |
4. Manifest Shape
Section titled “4. Manifest Shape”max_concurrent: 1time_limit: 3900resume: false
lnr: wall_clock_budget_sec: 3600 num_workers: 2 omp_threads_cap: 8 resource_control_mode: resource_smart_llm
defaults: config: deepbuilder/foundation/config/default.yaml workspace_base: /path/to/runs
tasks: - exp_id: nomad2018-predict-transparent-conductors run_id: nomad-example input_data_dir: /path/to/task/data cpu_list: "0-15" gpu_list: cpu lnr: seed: 2222 resource_gpu_pool: []A manifest is launched as a detached managed run with deepbuilder run --manifest FILE, or in the foreground with the hidden deepbuilder parallel -m FILE. In both cases ParallelRunner resolves a task workspace from explicit task fields or workspace_base/run_id/exp_id, applies task-level CPU/GPU boundaries, and passes the structured configuration patch to the child process. The only supported solver type is lnr; a task may instead set phase: prep to run data preparation. Copy-and-edit examples are in deepbuilder/foundation/config/profiles/examples/, including tasks_lnr_parallel_example.yaml, tasks_example.yaml, tasks_prep_example.yaml, and tasks_unified_evaluator_example.yaml.
5. Evaluator and Gate Configuration
Section titled “5. Evaluator and Gate Configuration”The evaluator defaults are intentionally task-neutral. At runtime, TaskPackageSpec resolves the effective profile, candidate path, artifact kind, metric name and direction, evaluator entry point, and timeout from tasks/**/task.yaml.
| Field | Current role |
|---|---|
evaluator.backend |
auto resolves registered tasks to task_package. artifact_command remains available for command-template integration. |
evaluator.candidate |
Defines a workspace-relative artifact path, kind, scan mode, and optional SHA requirement for command-based evaluation. |
evaluator.metric |
Defines the metric name, direction, parser fields, and whether selection requires a known direction. |
evaluator.command |
Defines the evaluator command, isolated Python/environment path, working directory, timeout, environment variables, and output tails. |
evaluator.query_budget_scope |
Selects a task-wide or worker-local evaluator query budget. |
evaluator.stop_on_query_budget_exhausted |
Stops research after an accepted evaluation uses the final available query. |
evaluator.expose_wall_clock_remaining_sec |
Adds the current task time budget to evaluator feedback when enabled. |
gate.policy |
Selects a trusted registered Gate policy. Runtime configuration may tune permitted parameters but cannot disable core invariants. |
The optional deepbuilder/foundation/config/sci_modeling_bench.yaml profile combines worker-local query budgets with runtime context, structured Stage commits, agent-generated EDA summaries, and best-Stage finalization.
6. Resource-Control Presets
Section titled “6. Resource-Control Presets”| Mode | Expanded behavior |
|---|---|
off |
Disables the resource runtime, review state, queue, arbiter, advisory, observation, and sharing. |
resource_smart_policy |
Enables deterministic runtime, queue, review state, and policy arbiter without admission LLM, owning-agent advisory, or GPU sharing. |
resource_smart_llm |
Enables the complete control plane, including admission LLM, LLM arbiter, owning-agent advisory, and GPU sharing. |
Expert fields can override individual switches after selecting a coarse mode. The canonical expansion lives in deepbuilder/foundation/config/runtime/resource_modes.py.