Skip to content

Commands

Every HARBOR command, generated from the plugin source. Invoke any of them as /harbor:<name>.

Environment

Set up a Python simulation repository and its virtual environment.

CommandArgumentsPurpose
env-install-uv[path]Generate an isolated Python environment for a simulation repo using uv on the host (creates a .venv/).

Probing

Inspect an existing benchmark or task and emit a portable specification.

CommandArgumentsPurpose
probe-benchmark[repo=<path>]
[canonical_task=<id>]
Probe an already-set-up benchmark repo and author <repo>/harbor/create-task/task-implementation.md — the per-family task-authoring guide consumed by /harbor:task-create.
probe-tasktask=<id>
[repo=<path>]
[output=<path>]
Probe an existing task in the current benchmark repo and emit <task-slug>-implementation.md — a portable per-task design-choice spec capturing scene / actions / reset / termination / observation / reward / DR.

Task authoring

Create, list, and clone tasks inside a benchmark.

CommandArgumentsPurpose
task-cloneop=create
source=<TaskID>
dest=<TaskID>
[repo=<path>]
[dest_repo=<path>]
[surface=<sections>]
[info_out=<path>]
or
op=delete
dest=<TaskID>
[repo=<path>]
Clone a task into an isolated, independently-editable copy — a GENERAL primitive, not tied to any single caller. Same-repo mode registers the copy under a new suffixed gym id (suffix is caller-chosen, e.g. -rewarditer7, -abtest1); cross-benchmark mode (dest_repo=, sim2sim) is COMING SOON and refuses in this release. op=create dispatches the task-cloner subagent (copy source's editable surface → rewire imports → register <dest> → run clone smokes). op=delete removes the clone's files and confirms the source still builds.
task-createname=<TaskID>
(description="<spec>" | from=<spec.md>)
[sections=<comma-list of 1..6>]
[assets=<path1,path2,...>]
[algorithm=<ppo|sac|td3>]
[timesteps_per_iter=N]
[success_threshold=0.5]
Author a NEW task or surgically edit an EXISTING task in a benchmark repo. Pre-flight verifies the dependency-generator → benchmark-generator → rl-integration-generator chain in sequence and dispatches any missing stage first (rl-integration defaults to the custom_torch algorithm source unless the user specifies one). Then reads <repo>/harbor/create-task/task-implementation.md and orchestrates: task-generator (§1–§5, per-section smokes) → the /harbor:reward-tune training loop for §6 (reward-tuning-agent iterations validated by ACTUAL training until success_rate ≥ threshold) §7 DR is COMING SOON — dr-generator is never dispatched in this release. Also supports REPRODUCE mode via from=<path> (a per-task spec emitted by /harbor:probe-task) — rebuilds the task identically including reward / DR / observation / action code (reproduce §6 is pasted verbatim at iter 0 of the same reward-tune loop, then validated by actual training like any other reward).
task-list[list]
or
<task-id>
List or inspect tasks within a Harbor benchmark.

Reward engineering

Design and tune the reward, validated by actual training.

CommandArgumentsPurpose
reward-add-logAdd per-reward-term logging to a Harbor benchmark repo without changing the env's native reward. The wrapper exposes per-term values on info["detailed_reward"] and asserts composer(terms) == reward every step, where composer ∈ {"sum", "product"} matches how the native reward composes its terms.
reward-tunetask=<id>
[algorithm=<ppo|sac|td3>]
[wandb=<project>]
[pool_size=N]
[gpus=N]
[success_threshold=0.5]
[timesteps_per_iter=N]
[seed=N]
[monitor_early_stop=true|false]
[monitor_interval=240]
Iteratively tune the §6 reward of an EXISTING task with an ASYNC fixed-pool controller. A thin orchestrator: the main agent runs pre-flight + (standalone only) picks the design base, then dispatches reward-tuning-agent, which designs each candidate — a bounded §1–§5 task delta plus a complete reward — and dispatches one reward-candidate-agent per candidate to implement both, smoke every section touched, train + render, and score per-term curves + rendered frames → success_rate. Keeps pool_size candidates in flight (capped by gpus locally), loops until success_rate ≥ success_threshold, then promotes the winning design onto the source task. Isolation follows the effective pool: sequential over a base snapshot when it is 1, one slot clone per candidate when it is more.

Training and tuning

Train, evaluate, render, sweep, and tune RL policies.

CommandArgumentsPurpose
rl-add-logCanonical metric-key contract for ALL rl-integration-generator algorithm implementations (custom_torch PPO/SAC/TD3, stable_baseline3, local_implementation). Defines the keys each algorithm MUST emit to metrics.jsonl + TensorBoard + W&B, plus the per-reward-term tracker pattern.
rl-add-trick<trick_name>
[algorithm=<ppo|sac|td3>]
[--dry-run]
Apply an RL training trick (e.g. obs_rms_jax, reward_norm_jax) to a chosen algorithm in the current benchmark repo. Modifies harbor/configs/rl/<algo>.parallel.yaml in place.
rl-evalcheckpoint=<path>
[task=<id>]
[n_envs=N]
[eval_total_steps=N]
[key=value ...]
Evaluate a trained RL checkpoint. Runs harbor/scripts/rl/<impl>/eval.py with the given checkpoint, auto-inferring task and algorithm from the saved config.
rl-list-tricks(no args)List all available RL training tricks (in-network obs RMS, reward normalization, etc.) with descriptions, applicable algorithms, and references.
rl-rendercheckpoint=<path>
[task=<id>]
[render_max_steps=N]
[key=value ...]
Render a trained RL checkpoint to MP4 and verify the policy actually moves (frame-difference sanity check).
rl-runtask=<id>
algorithm=<ppo|sac|td3>
[key=value ...]
Train an RL policy on the current benchmark. Wraps harbor/scripts/rl/<impl>/train.py with the repo's <repo>/.venv/bin/python and Hydra overrides.
rl-sweeptask=<id1>[,id2,...]
algorithm=<ppo,sac,...>
[key=v1,v2,...]
[parallelism=N]
[cluster=<true|path>]
Hyperparameter / seed sweep across multiple RL trials. Takes any keys (task, algorithm, seed, learning_rate, ...) where each value may be a comma-separated list. Computes the Cartesian product, then either dispatches one sub-agent per trial (default) OR — when cluster=... is given — renders a SLURM launch.sh that the user submits with sbatch. All results land under harbor/rl_experiments/sweeps/<sweep_id>/.
rl-tunetask=<id1>[,id2,...]
algorithm=<a1>[,a2,...]
[mode=local|cluster]
[metric_weights=<json>]
[stuck_threshold=N]
[max_iterations=N]
[smoke=true|false]
Grid hyperparameter tuning across tasks × algorithms. Cartesian product → one rl-tuning-agent subagent per (task, algorithm) cell, each running an open-ended tuning loop (default-config baseline → tricks → log-driven hyperparameter edits). Local mode runs cells sequentially; cluster mode dispatches all cells in parallel (each agent submits its own SLURM jobs internally). Maintains a tune-level history.md and gathers per-cell results into a final cross-cell summary.
rl-visualizecheckpoint=<path>
[task=<id>]
[n_steps=N]
Open a HEADED viewer (GLFW window) showing a trained RL policy in action. Loads a checkpoint, runs N steps on the CPU MuJoCo backend, displays each frame live.

Utilities

Plotting, account setup, experience ledgers, workspace reset, and tests.

CommandArgumentsPurpose
helpShow the full harbor plugin surface — slash commands, subagents, hooks.
plotspec=<path-to-yaml>
[or no args to walk through writing one]
Plot mean ± std curves from wandb runs grouped by task × baseline. Reads a YAML spec describing one or more subplots; each subplot averages multiple seeds for the same (task, baseline).
reset-workspacerepo=<path>
[clean_inbenchmark_tasks=true|false]
Reset a benchmark repo to its original cloned state by removing ALL harbor-plugin-generated files — the entire <repo>/harbor/ tree, the uv .venv/, the scripts/ carve-outs (run_random.py / render_random.py / _<family>_env.py), plugin caches — and (by default) reverting any task code the plugin wrote directly into the benchmark's own source tree. Runs in a subagent. DESTRUCTIVE + irreversible: shows a dry-run plan and asks to confirm first, then verifies via a git-based smoke (including hidden / ignored files) that the repo is byte-identical to its original clone before reporting success.
test[layers=1,2,3]
[repo=<path>]
[task=<id>]
[resume=true|false]
[fresh=false]
Run the harbor plugin test suite. L1 (contract) + L2 (unit) are deterministic pytest layers run by the main thread; L3 is an end-to-end agentic pipeline run in a subagent that drives the task-create chain module-by-module on an isolated, clean benchmark worktree. Default runs L1→L2→L3 in sequence (stop at first failure); layers= runs a subset. L3 is resumable Docker-layer style — each module is a fingerprinted stage; on re-run only the changed/failed stage and everything downstream re-runs. Maintains an append-only test history; on any failure it stops, reports the error + a suggested fix, and leaves state so the next run resumes from the unimpacted part.
update-experiencetarget=<name>
(experience="<bullet>" | file=<path>)
Append a learned experience into a target ledger, or file a probed task into the task-library.
wandb-setupShow the host's current W&B login info (account name + masked API key) and offer to re-login, logout, or just inspect.

Released under the Apache 2.0 License.