# rotari documentation (full) > Generated from the rendered MkDocs pages; the separate Go API site is not included. ## Home Source: https://rotari-dev.github.io/rotari/docs/ # rotari documentation Rotari keeps track of experiment batches run from shell scripts: which jobs are running, which failed and why, their logs, and every earlier run. It runs the same batch on a workstation, over SSH, or on a shared Slurm, PBS, LSF, or Sun Grid Engine cluster while keeping commands, results, and logs together. ## Start here - Getting started (https://rotari-dev.github.io/rotari/docs/GETTING_STARTED/): installation and the first run. - Videos (https://rotari-dev.github.io/rotari/docs/VIDEOS/): short videos of each feature, made from real runs. - Concepts (https://rotari-dev.github.io/rotari/docs/CONCEPTS/): projects, queues, runs, IDs, and state. - Running and controlling jobs (https://rotari-dev.github.io/rotari/docs/RUNNING/): define jobs, start and wait for runs, and control arrays, dependencies, retries, timeouts, and interruptions. - Recovering failed runs (https://rotari-dev.github.io/rotari/docs/RECOVERING/): rerun failed jobs, optionally after editing them. - Executors and schedulers (https://rotari-dev.github.io/rotari/docs/EXECUTORS/): local, SSH, Slurm, PBS, LSF, and SGE execution backends. - Inspecting runs and jobs (https://rotari-dev.github.io/rotari/docs/INSPECT/): status, logs, run readiness, and history. - Web UI (https://rotari-dev.github.io/rotari/docs/WEB/): modes, remote access, and previewing what jobs write or opening TensorBoard and Jupyter Lab on it. The repository README (https://github.com/rotari-dev/rotari) provides the project overview; installation and quick start instructions are maintained in the Getting started (https://rotari-dev.github.io/rotari/docs/GETTING_STARTED/) guide. ## Reference - CLI reference (https://rotari-dev.github.io/rotari/docs/CLI_REFERENCE/): commands and common options. - Python client (https://rotari-dev.github.io/rotari/docs/PYTHON_CLIENT/): installation and a short usage guide. - Python API (https://rotari-dev.github.io/rotari/docs/python-api/) - Go API (https://rotari-dev.github.io/rotari/docs/go-api/) ## Asking an AI assistant about rotari To get help from an AI assistant such as ChatGPT, Claude, or GitHub Copilot, give it this documentation: - If the assistant can open web links, share the documentation index (https://rotari-dev.github.io/rotari/docs/llms.txt). It lists every page, so the assistant can read the ones it needs. - If it cannot, download the full documentation as one text file (https://rotari-dev.github.io/rotari/docs/llms-full.txt) and attach it to the conversation. --- ## Architecture Source: https://rotari-dev.github.io/rotari/docs/ARCHITECTURE/ # Code architecture This is a map of the code: which process does what, which package owns which responsibility, and which functions a command passes through. Read it before changing code you have not touched before. It describes structure, not rules. The behavior that must be preserved (state layout, fallback chains, locking, path rules) is in contracts/README.md (https://rotari-dev.github.io/rotari/docs/contracts/README.md). User-facing behavior is in the README (https://github.com/rotari-dev/rotari#documentation) and the guides it links to. ## Processes Rotari is one binary, but at runtime it plays several roles. Knowing which process a piece of code runs in explains most of the structure. ``` flowchart LR subgraph clients["user shell"] runcli(["rotari run / retry"]) waitcli(["rotari wait"]) direct(["rotari add / copy / change / cancel
show / jobs / export ..."]) webcli(["rotari web
(HTTP)"]) mcpcli(["rotari mcp
(stdio MCP)"]) end subgraph sup["one per active run of a project"] supervisor["supervisor
rotari __server
executes the run's jobs"] end files[("<basedir>/projects/<project>/
queue.json, meta.json, runs/..., .rotari-attachments/...")] nodes["wrapper scripts on
Slurm / PBS / LSF / SGE / SSH nodes"] runcli -->|"starts as a child"| supervisor runcli -->|"request / acceptance over startup pipes"| supervisor runcli -->|"session, progress journal, summary"| files waitcli -->|"session, progress journal, summary"| files supervisor -->|read / write| files direct -->|"read / write under state lock"| files webcli -->|"read, edit queue"| files mcpcli -->|"read job report"| files nodes -->|write attempt status.json| files classDef command fill:#e0e7ff,stroke:#4f46e5,color:#1e1b4b class runcli,direct,webcli command ``` - CLI client. Every `rotari ` invocation. Most commands (`add`, `copy`, `change`, `show`, `jobs`, `export`, ...) read and write the project files directly under the project's state lock. Only `run` and `retry` go through the supervisor; `cancel`, `suspend`, and `resume` signal jobs from the calling process, as the Web UI does. - Supervisor. `rotari __server`, started by `run` and `retry` through `startSupervisor` (cmd/rotari/server.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/server.go)) for each run, and stopped when that run ends. The source still calls it the server. It serves one run of one project. Pipes inherited as descriptors 3 and 4 carry only the initial request and acceptance/rejection (including the accepted run ID); they are closed after that handoff. It holds a lease (`server.lock`, `server.pid`) in the project directory. Because it is a child of the `run` command, it and the run's jobs inherit that command's working directory and environment, which is why a supervisor is never reused (RUN-3 in contracts (https://rotari-dev.github.io/rotari/docs/contracts/02-run-lifecycle-and-execution.md#run-lifecycle)). It is not an authority for state: everything it knows is also on disk. - Run execution. Every run, sync or async, executes inside its supervisor; see Sync and async runs (https://rotari-dev.github.io/rotari/docs/ARCHITECTURE/#sync-and-async-runs). Before execution, `projectrun` saves its coordinator identity (host, PID, PID namespace, and process start time) in the run's `context.json`, separate from the removable execution lock. It records successful management completion after finalization and lock cleanup, without treating that marker as process death. `project.AssessCoordinator` owns the read-only live/stopped/unknown assessment used by `info`, including when the run lock has disappeared. `project.Unlock` reuses it to gate recovery: live refuses, unknown requires explicit attestation, and stopped permits recovery. Execution probes run outside the state lock; unlock then reacquires it and compares a recovery fingerprint covering queue/meta and relevant run evidence before applying. CLI dry-run, MCP preview, and the Web's `GET /api/unlock` return the same policy evidence without mutation; CLI, MCP, Python, and the Web's Recover dialog (`internal/webui/unlock.go`) expose the attestation. Recovery authorization is recorded in the existing run context, without changing the coordinator record. `project`'s `repair.go` validates summary completeness against expanded commands, carried origins/status marks and all relevant attempts. Unlock either finalizes matching interrupted metadata through `state.FinalizeRun` with the recorded finish time and applicable client cleanup, or explains a release to collecting. It never replays `projectrun.Runner` callbacks. Unknown executions require explicit attestation for repair; terminal records are not termination evidence. Expanded array origins use `model.TaskOrigin`, the same domain rule that run planning and `model.Queue.OriginOf` use; pinned and unpinned origins keep their respective attempt semantics. `project.AssessExecutions` reuses the repair inventory's job/attempt/origin traversal for read-only `info`. Executor-owned `ExecutionProber` classifies local groups, fresh scheduler queue/accounting observations using backend parsers, and SSH remote groups through a private per-attempt token. Local attempts durably publish host/PID namespace/start identity in `job.json`; incomplete publication stays unknown. Probes are bounded and rate-limited, with per-assessment SGE whole-queue caching. Verified active evidence blocks recovery even with attestation and terminal outcomes; stopped evidence removes execution attestation. Unknown/unsupported evidence remains explicit. Process-group and scheduler scopes are not machine-wide audits. SSH state is retained for 30 days and safely pruned only when no matching process group remains; the remote wrapper prunes in the background after its job has started, examining only expired state. Both finalization and ordinary release use the execution assessment; stale snapshots are rejected after lock reacquisition. - Web server. `rotari web` (cmd/rotari/web.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web.go) parses flags; internal/webui (https://rotari-dev.github.io/rotari/docs/internal/webui/) serves). It lists registered basedirs and lightweight project/run metadata, checks project locks across the selected basedir, and loads a project's queue and run summaries only when that project is opened. Job/attempt details load only for the selected run or active runs. The notification inbox reads the records runs left in the master directory (`/api/notifications`), not the run state. Beside the handlers, `cmd/rotari/web.go` runs `runwatch.ReportInterrupted` at startup and every 30 seconds, which records runs `project.Inspect` finds interrupted, since a killed run cannot. The dedicated history-search API scans only the user-selected basedir, project, and run scopes, or every registered basedir when asked for all, without expanding the lightweight `/api/state` index. The activity API (`/api/activity`) lists runs across every registered basedir through `internal/runlist`, as `rotari runs` does, for one bounded time range: runs outside it are skipped by run ID and directory time without being opened, and details are read for listed runs only. Expanding another basedir reads only its project directory names. Static export remains a complete snapshot. Its control endpoints (`/api/copy`, `/api/cancel-job`, ...) call the same internal operations as the CLI. With `--allow-exec`, it also starts the commands registered in the global `launchers.toml` through one `internal/launcher` manager (cmd/rotari/web_launch.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_launch.go) builds it; internal/webui/launches.go (https://rotari-dev.github.io/rotari/docs/internal/webui/launches.go) serves the API). Each launch runs under its own `rotari __launch` wrapper process, which holds the read end of a pipe only the Web server can write: when the Web server exits, even by SIGKILL, every wrapper stops its command's process group. A service launch listens on a loopback port the manager picks; once `launcher.VerifyListener` shows that the listener belongs to the launch and its readiness path answers, `/_launch/ID/` (internal/webui/launch_proxy.go (https://rotari-dev.github.io/rotari/docs/internal/webui/launch_proxy.go)) forwards requests to it unchanged, checking ownership again for every new upstream connection. Launches are not runs: they take no project lock and write nothing under a basedir; their output lives in a private `$TMPDIR/rotari-web-launches-*` directory removed at shutdown, or by the next Web server if this one was killed. Open in VS Code, or another editor, runs nothing on the server: the page frame's web_editor.js (https://rotari-dev.github.io/rotari/docs/internal/webui/assets/web_editor.js) opens a URL of the editor's scheme, from where the browser keeps which editor it uses and how that reaches this host, and `/api/editor-target` (internal/webui/editor.go (https://rotari-dev.github.io/rotari/docs/internal/webui/editor.go)) says where an artifact is; `/api/log-links` (internal/webui/log_links.go (https://rotari-dev.github.io/rotari/docs/internal/webui/log_links.go), which also finds the paths in shells' output) which paths in a job's log are files. With `--allow-terminal`, it holds shells in an `internal/terminal` `Keeper` (cmd/rotari/web_terminal.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_terminal.go) builds it; internal/webui/terminal.go (https://rotari-dev.github.io/rotari/docs/internal/webui/terminal.go) serves them at `/_terminal/shells`, `/_terminal/here`, and `/_terminal/ws`, groups them by project, by basedir for a basedir's own pages, or as of no project, and serves the panel's own window at `/_terminal/window`; `/_terminal/projects` says what each project with shells last ran, counted by the run page's Jobs card groups (`jobCountGroup`, in Go and JS alike); `/_terminal/shells/ID/links` which words of its output are run IDs, job IDs, or paths that exist, with a file's line (internal/webui/terminal_links.go (https://rotari-dev.github.io/rotari/docs/internal/webui/terminal_links.go)); `/_terminal/shells/ID/dirs` the directories of its group's history and where its project's recent runs started (internal/webui/terminal_dirs.go (https://rotari-dev.github.io/rotari/docs/internal/webui/terminal_dirs.go)); `/_terminal/shells/ID/preview` says where a shell is and what it runs, which internal/terminal (https://rotari-dev.github.io/rotari/docs/internal/terminal) finds from its process without attaching; the panel's Explorer lists a shell's directory or any other at `/_terminal/files`, changes, downloads, and uploads files under `/_terminal/files/` through internal/fileops (https://rotari-dev.github.io/rotari/docs/internal/fileops), (internal/webui/terminal_files.go (https://rotari-dev.github.io/rotari/docs/internal/webui/terminal_files.go)) and opens files through `/api/tableview-sources` with a path). Pages only attach to shells, since each link reloads the page, and the panel in web_shell.js (https://rotari-dev.github.io/rotari/docs/internal/webui/assets/web_shell.js) loads xterm.js when first opened and connects only to the tab shown. Its project link can be turned off per browser tab, keeping the terminal's selected group and pane layout across page loads and handing them to its separate window and back. A per-window identifier lets the window save that state in its opening tab's session storage even while the page reloads. On macOS, internal/terminal (https://rotari-dev.github.io/rotari/docs/internal/terminal/) reads a foreground process's argument vector through `kern.procargs2`, keeping argument boundaries without starting `ps` for every output chunk. A shell is not a run: it takes no project lock and writes nothing under a basedir. With `--detach` (cmd/rotari/web_detach.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_detach.go)), the command checks its options, then starts itself again in a session of its own with its output in `/web/.log`, and returns once that process reports its address on an inherited pipe. The background process holds the host's `flock` lease and writes `/web/.json`; internal/webdetach (https://rotari-dev.github.io/rotari/docs/internal/webdetach/) finds, records, and compares detached servers and keeps the log bounded, and internal/lease (https://rotari-dev.github.io/rotari/docs/internal/lease/) holds and probes the lease for it and for the run supervisor's `server.lock`. At a terminal, or with `--disconnect-action detach`, `rotari web` is a client (cmd/rotari/web_client.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_client.go)). It starts the server the same way, but with pipes for its output and a lifeline whose end the server watches, and stays attached. Ctrl-C asks the server to stop, and Ctrl-D asks it to detach: it takes the host's lease, records itself, and moves its output onto the log with `dup3`. A disconnect, or the lifeline closing however the client went, follows the disconnect action. Without a terminal, with the default action, `rotari web` serves in its own process. When a detached server runs with the options given, the client attaches to it instead (cmd/rotari/web_reattach.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_reattach.go)): with no pipe to that server, it follows its log (`webdetach.TailLog`), watches its lease and record (`webdetach.Ended`), and stops it with SIGTERM on Ctrl-C. `rotari web --shutdown` (cmd/rotari/web_shutdown.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/web_shutdown.go)) finds that server the same way. It reads what its shells run from the process table (`terminal.ServerShells`), since it has no token to ask the server, then sends SIGTERM and waits for the lease. `POST /_server/shutdown` (internal/webui/shutdown.go (https://rotari-dev.github.io/rotari/docs/internal/webui/shutdown.go)) calls `Options.Shutdown`, which `serveWeb` wires to the same shutdown as SIGINT and SIGTERM. - Jobs and wrappers. Local jobs are child processes of the supervisor. Scheduler jobs run elsewhere through a generated wrapper script that writes the attempt's `status.json`, which the supervisor polls. ### Sync and async runs Both modes run the same lifecycle, `projectrun.Runner.Run`, inside the run's supervisor; they differ only in whether the client stays attached. | Sync run (`rotari run`) | Async run (`rotari run --async`) | Client | Enters the shared file-backed attachment/follower flow | Returns after the startup acceptance | Process that executes the jobs | The supervisor | The supervisor | PID in `running.lock` | The supervisor | The supervisor | Entry point | `supervisor.Operations.Run` (internal/supervisor/run.go (https://rotari-dev.github.io/rotari/docs/internal/supervisor/run.go)) | `supervisor.Operations.StartRun`, which runs `Runner.Run` in a goroutine | ``` sync: client ─request/accept─▶ supervisor: Begin → Run (Execute → Finish) └─ attachment session ──▶ progress journal / summary / controls async: client ─request/accept─▶ supervisor: Begin ──▶ "Run started" to client └─ Run (Execute → Finish), then the supervisor exits ``` The supervisor is started with `setsid`, detached from the client's terminal session, so a run keeps going when an async client returns or an attached client detaches with Ctrl-D. Synchronous `run`/`retry` and `wait` use the same post-start follower and session lifecycle. Each client has its own process-held lock and record under `.rotari-attachments/`; attachment state is derived from valid sessions, not a count or the legacy run-lock boolean. The supervisor checks sessions while the run executes. A same-host client death, including `SIGKILL`, releases its lock; Linux process start-time identity prevents a reused PID from being mistaken for the original process, and a suspended client keeps its lock. A remote host cannot be verified locally, so its session is conservatively treated as live. Unexpected disconnects detach by default; `--disconnect-action cancel` or `ROTARI_DISCONNECT_ACTION=cancel` asks the supervisor to cancel a run after it proves the client dead. Explicit Ctrl-C still cancels, Ctrl-D detaches, and Ctrl-Z suspends the client. Both modes use the same progress observer. The supervisor records run-start, job-start, retry, failure, and completion-count events in the run's `progress.jsonl`, independently of the starting client's quiet setting, and clients read the journal after startup acceptance. Journaling is best-effort and does not determine execution or finalization. A colliding job ID disables journaling rather than changing the job's behavior; reader I/O failures warn and fall back to result-only waiting. `rotari wait` incrementally reads these events while waiting for the authoritative finalized summary and uses the same CLI progress renderer and cancellation boundary as synchronous `run`/`retry`. JSON wait omits text events but still holds an attachment while following an active run. See progress observer (https://rotari-dev.github.io/rotari/docs/internal/supervisor/run.go), journal I/O (https://rotari-dev.github.io/rotari/docs/internal/state/progress.go), and attachment sessions (https://rotari-dev.github.io/rotari/docs/internal/attachment/session.go) and the shared wait (https://rotari-dev.github.io/rotari/docs/cmd/rotari/wait.go). Because the filesystem is the shared medium, any process can die and the next one can reconstruct what happened from the files. That is why so much code takes a `state.ProjectPaths` and not an in-memory object. ## Packages Dependencies point one way: `cmd/rotari` imports every `internal` package, and no `internal` package imports `cmd/rotari`. ``` flowchart TB cmd["cmd/rotari
CLI flags, wiring, output"] mcpadapter["internal/mcp
MCP tools over shared packages"] projectrun["projectrun
run lifecycle"] project["project
state machine, idle edits"] resolve["resolve
selectors to run and job"] queueops["queueops
queue and history edits"] report["report
diagnosis evidence"] bugreport["bugreport
bug report bundle"] joblist["joblist
recent jobs"] runwatch["runwatch
interrupted runs for the inbox"] supervisor["supervisor
server request work"] webui["webui
Web handlers and assets"] launcher["launcher
launched commands
(imports nothing from rotari)"] tableview["tableview
Table viewer reads
(imports nothing from rotari)"] subgraph l2["orchestration and projections"] server run jobcontrol web jobstatus workflow queueedit runlineage diagnose jobfilter artifact artifactsource end subgraph l1["adapters"] executor state runregistry notificationlog stickies attachment config end model["model
(imports nothing from rotari)"] cmd --> projectrun cmd --> project cmd --> resolve cmd --> queueops queueops --> project queueops --> resolve queueops --> queueedit queueops --> executor queueops --> state queueops --> jobstatus queueops --> attachment cmd --> report cmd --> bugreport bugreport --> report bugreport --> web bugreport --> executor bugreport --> config bugreport --> state cmd --> mcpadapter mcpadapter --> report mcpadapter --> resolve mcpadapter --> runview mcpadapter --> project mcpadapter --> state mcpadapter --> jobcontrol report --> web report --> project report --> diagnose cmd --> joblist joblist --> jobstatus joblist --> project cmd --> supervisor cmd --> attachment supervisor --> server supervisor --> attachment runview --> attachment supervisor --> projectrun supervisor --> jobcontrol cmd --> webui cmd --> launcher webui --> web webui --> queueops webui --> jobcontrol webui --> report webui --> joblist webui --> tableview config --> state resolve --> project resolve --> runregistry resolve --> state project --> jobstatus project --> executor project --> state run --> jobfilter queueedit --> jobfilter server --> jobfilter cmd --> l2 projectrun --> run projectrun --> executor projectrun --> state projectrun --> jobstatus server --> executor run --> executor jobcontrol --> executor jobcontrol --> state jobcontrol --> jobstatus jobcontrol --> resolve web --> jobstatus web --> runview web --> diagnose web --> state jobstatus --> executor jobstatus --> state jobstatus --> jobfilter jobstatus --> diagnose workflow --> state artifactsource --> artifact projectrun --> artifactsource jobstatus --> artifact executor --> state runregistry --> state notificationlog --> state stickies --> state webui --> stickies webui --> notificationlog runwatch --> project runwatch --> notificationlog attachment --> state l1 --> model l2 --> model ``` Arrows mean "imports". `cmd/rotari` imports every `internal` package, and every package imports `model`; those edges are drawn once per group. `go list -f '{{.ImportPath}}: {{join .Imports " "}}' ./internal/...` prints the current graph if this list drifts. The boundary rules in contracts/00-overview.md (https://rotari-dev.github.io/rotari/docs/contracts/00-overview.md#go-package-boundaries) are checked against this graph by internal/archtest (https://rotari-dev.github.io/rotari/docs/internal/archtest/boundaries_test.go). Package | Owns | Start reading at | internal/model (https://rotari-dev.github.io/rotari/docs/internal/model/) | Domain types and pure rules: queue, queued command, job spec, result, summary, selections, command selectors, dependencies, arrays, and a failed result's failure kinds and the one cause failure summaries and `--filter-failure-cause` share. No I/O. | `model.go`, `selection.go`, `command_selector.go`, `dependencies.go`, `failure_cause.go` (`FailureCause`) | internal/state (https://rotari-dev.github.io/rotari/docs/internal/state/) | The filesystem: path resolution and validation, JSON load/write, locks, run and attempt directory listing. A run's `commands.json`, `summary.json`, and `carried.json` are read together, once, as a `RunSnapshot`; a job's latest attempt is found with one listing (`LatestAttempt`); readers read independent runs and jobs with `ReadEach`, at most `ReadConcurrency` at a time. A basedir's projects are listed only by `ProjectNames`, which tells a missing basedir (`ErrBaseDirMissing`) from one without projects. Runs are ordered only by `RunsNewestFirst`, next to the run ID format (`NewRunID`, `RunIDStart`). Whether a recorded process can be observed from here is decided only by `ObserveProcess` and `ObserveProcessGroup`, from the platform facts `PIDNamespace` and `ProcessStart` (per-platform files: `/proc` on Linux, `none` and `sysctl` on macOS). No execution policy. | `paths.go`, `project_paths.go`, `store.go`, `lock.go`, `run_files.go` (`LoadRunSnapshot`), `read_each.go`, `project_names.go`, `run_order.go`, `process_identity.go`, `process_platform*.go` | internal/executor (https://rotari-dev.github.io/rotari/docs/internal/executor/) | How one job attempt is started, waited for, cancelled, and suspended: local processes, Slurm, PBS, LSF, SGE, SSH, wrapper scripts. No run semantics. | `contracts.go` (`JobExecutor`), `local.go`, `slurm.go`, `sge.go` | internal/project (https://rotari-dev.github.io/rotari/docs/internal/project/) | A project's run state (idle, running, interrupted) from `running.lock` and `meta.json`, removing a stale local lock the one way every reader does (SAFE-11), one run's phase (running, interrupted, finished, ended) for `wait` and the MCP run summary, consistency checks, recovery, and the queue-edit sequence: state lock, state check, load, edit, then the queue write, preceded by the metadata write only while idle. The recovery commands it prints use a location renderer that CLI commands install (`SetCommandLocation`), so they omit an implicit `--basedir` (CLI-22). | `inspect.go` (`Inspect`, `InspectRunLock`, `EnsureIdle`), `run_phase.go` (`RunPhaseOf`), `edit.go` (`EditQueue`, `CreateQueueGuarded`), `reset.go` (`Reset`), `unlock.go` (`Unlock`) | internal/resolve (https://rotari-dev.github.io/rotari/docs/internal/resolve/) | Location and job-name rules shared by the commands that read existing state: a run ID through the run registry, an `att_` attempt ID, the latest-run fallback, run names, and job IDs or names looked up in the queue and latest runs, in one state directory or, for read-only commands without `--basedir`, across the default and registered ones. show's and wait's own selector orders build on it. | `resolve.go` (`ExistingRun`, `RunID`, `Jobs`, `JobIDsByName`), `scope.go` (`Scope`) | internal/config (https://rotari-dev.github.io/rotari/docs/internal/config/) | Scope-aware global/cwd workspace/basedir/project discovery, location-key cycle validation, recursive file-value merging and immutable canonical TOML snapshots; YAML, TOML, JSON parsing. Runtime option meanings stay in `cmd/rotari`. | `layers.go` (`LoadScope`, `Load`, `Merge`, `Loaded.Snapshot`), `config.go` | internal/notification (https://rotari-dev.github.io/rotari/docs/internal/notification/) | `notifications.toml`: its schema, scope lookup, validation, serialization, and the shared job/run event and batch model used by both webhook and browser notifications, including the browser inbox text (`NewBrowserMessage`) and the event facts a record may keep (`Event.Recordable`). It also owns the Web UI basedir route (`WebBaseDirID`) that `internal/webui` serves and webhook links point to. Delivery stays in `cmd/rotari` (`runNotificationManager` batches a run's events for the Webhook and the record) and `internal/webui`. | `config.go` (`Load`, `Marshal`), `event.go` (`NewBatch`), `browser.go` (`NewBrowserMessage`) | internal/notificationlog (https://rotari-dev.github.io/rotari/docs/internal/notificationlog/) | The master directory's notification records for the Web inbox, `/notifications/.jsonl`, one file per run appended only by that run's process (and, once it stopped, one `run.interrupted` through `AppendOnce`), kept for 10 days, and the inbox's shared read/cleared cursors of each basedir (`inbox-state.json`). `Entries` renders records with each project's current browser settings for both the Web inbox and `rotari notifications`. Knows nothing of HTTP. | `log.go` (`Append`, `Records`, `Advance`), `entries.go` (`Entries`) | internal/stickies (https://rotari-dev.github.io/rotari/docs/internal/stickies/) | The sticky notes users put on Web UI pages, `/stickies.json`, a map from a page key (the Web UI route, an arbitrary string rather than a path) to that page's notes, saved atomically under a lock file with limits on notes, pages, and text. Independent of run notes and of every job, run, and result. Knows nothing of HTTP. | `stickies.go` (`Load`, `Save`, `Pages`, `Search`) | internal/runwatch (https://rotari-dev.github.io/rotari/docs/internal/runwatch/) | Finds runs whose coordinator stopped without finishing them, with the shared `project.Inspect` rule under the shared state lock, and records each once as `run.interrupted` through `notificationlog.Log.AppendOnce`; `rotari web` calls it on a timer. Inbox only, never the Webhook. | `runwatch.go` (`ReportInterrupted`) | internal/runregistry (https://rotari-dev.github.io/rotari/docs/internal/runregistry/) | The master directory's run index, `/runs/.json`: register, look up, unregister, and find stale entries for `gc`. | `registry.go` | internal/attachment (https://rotari-dev.github.io/rotari/docs/internal/attachment/) | Per-client run attachments: process-held locks, host and PID-start identity, attachment aggregation, stale-client policy handoff, initiating-client startup reservations, and removal of a deleted run's attachment state (`ForgetRun`, called by `delete`). It does not render CLI output. | `session.go` | internal/projectrun (https://rotari-dev.github.io/rotari/docs/internal/projectrun/) | One project's run against its files: `Begin` (context, command snapshot, run lock, registry, running metadata; consumes the queue only for queue-based runs), `Execute` (snapshot, plan, source revisions of the executed jobs, dispatch, summary), and `Finish` (final context, metadata finalization, lock removal). Saved-run snapshots are constructed under the project state lock without editing the next queue. Shared by sync and async runs and by cancellation. Also checks that a queue can run with the known executors (`ValidateQueue`). | `lifecycle.go`, `execute.go`, `plan.go`, `plan_revision.go` (`PlanRevision`, the revision a run preview prints and a start checks), `validate.go` | internal/run (https://rotari-dev.github.io/rotari/docs/internal/run/) | Run rules without file access: which jobs execute or are carried forward, dependency unblocking, retries, per-executor lanes and concurrency, the summary contents. | `rerun.go` (`PlanRerun`), `engine.go` (`ExecuteJobs`), `dispatch.go` (`Dispatcher`) | internal/jobstatus (https://rotari-dev.github.io/rotari/docs/internal/jobstatus/) | Read side: turns attempt files and the run's recorded results (the summary, or before it the carried results a run records at start) into one displayed result and timestamps, and reads the hosts, times, and log that job filters judge, and the artifact candidates an attempt recorded, following carried jobs to their attempt. Shared by CLI and Web. | `job.go` (`RecordedResults`), `attempt.go`, `times.go`, `facts.go`, `artifacts.go` | internal/runview (https://rotari-dev.github.io/rotari/docs/internal/runview/) | Read-side loading of a persisted run snapshot and resolution of each job's displayed status, a project's runs in start order, the run lifecycle and initiating-client connection projection, the one-run summary, and the failures with no retry left that `wait --until-failure` stops on. Shared by run comparison, history views, CLI status displays, the Web run lineage summary, and the MCP tools. | `run.go` (`LoadRun`, `LineageStatus`), `client.go` (`ClientStatus`, `RunLifecycleLabel`), `order.go` (`RunsByStart`, `Summary`, `FinalFailureGroups`) | internal/supervisor (https://rotari-dev.github.io/rotari/docs/internal/supervisor/) | The work behind supervisor requests: sync and async runs, including preflight selection planning. Implements `server.Operations` and returns plain-text messages; the completion message the client prints is built in `cmd/rotari` from the run's files. | `run.go` (`Operations.Run`, `StartRun`) | internal/server (https://rotari-dev.github.io/rotari/docs/internal/server/) | Supervisor startup transport: request/acceptance types, inherited startup pipes, the lease and liveness check, and idle shutdown. The pipe is closed after run acceptance; ongoing progress and attachment are file-backed. Work is delegated to an `Operations` interface. | `protocol.go`, `serve.go`, `client.go`, `lease.go` | internal/jobcontrol (https://rotari-dev.github.io/rotari/docs/internal/jobcontrol/) | Cancel, suspend, resume of running jobs through executors. | `jobcontrol.go` | internal/webui (https://rotari-dev.github.io/rotari/docs/internal/webui/) | The Web UI: HTTP handlers and JSON API, static export, embedded assets, the auth wrapper and its narrow authentication-event interface, the launch API, its Host/Origin guard, the `/_launch/` service proxy, and the Table viewer's page and API (`/tableview/`, `TableViewHandler` for `rotari tableview`, and `GenerateStaticTableView` for its static snapshot). CLI metadata, environment definitions, the config template, and the launcher manager come in through `Options`. | `webui.go` (`handler`), `auth.go` (`WithAuthToken`), `options.go`, `artifacts.go`, `artifact_files.go`, `launches.go`, `launch_guard.go`, `launch_proxy.go`, `table_view.go`, `table_view_static.go`, `table_view_shell.go` (a terminal shell's directory, or a path from the Explorer, in the Table viewer), `terminal.go` and `terminal_files.go` (the terminal's routes and the Explorer's listing), `assets/` | internal/weblog (https://rotari-dev.github.io/rotari/docs/internal/weblog/) | Bounded Web server startup and authentication evidence under the master directory: allow-listed JSON Lines records, nonblocking delivery from requests, cross-process single-write appends, rotation, and event rate limits. Used by live `rotari web` and `rotari tableview`; static exports write nothing. | `log.go` (`Recorder`) | internal/webdetach (https://rotari-dev.github.io/rotari/docs/internal/webdetach/) | The one detached `rotari web` per user and host: its files under `/web/` named by host, finding it through its lease (removing a crashed one's record), holding the lease and publishing its record (never the token), comparing a request's settings with its own, and its log's rotation at start and copy-and-truncate while it runs. Knows nothing of HTTP or of starting processes. | `webdetach.go` (`Find`, `Hold`, `Settings.Differences`, `OpenLog`, `KeepLogBounded`) | internal/lease (https://rotari-dev.github.io/rotari/docs/internal/lease/) | A process's `flock` claim on a file for its lifetime, and the non-blocking probe that reports a holder or an error, never a dead holder. Used by `internal/server`'s supervisor lease and `internal/webdetach`. | `lease.go` (`Hold`, `TryLock`, `Probe`) | internal/launcher (https://rotari-dev.github.io/rotari/docs/internal/launcher/) | Commands a user registered in `launchers.toml` and runs against an artifact from the Web UI: the file's schema and the StrictModes-style check that no other user can change it, the manager of one Web server's launches (start, reuse, stop, limits, rotating output), the `rotari __launch` wrapper that stops a launch's process group when the Web process exits for any reason, and the check that a service port belongs to the launch. Knows nothing of jobs, runs, or HTTP. | `manager.go` (`Manager`), `registry.go` (`LoadRegistry`), `wrapper.go` (`RunWrapper`), `listener.go` (`VerifyListener`) | internal/terminal (https://rotari-dev.github.io/rotari/docs/internal/terminal/) | Interactive shells on pseudo-terminals: starting one in a session of its own with exactly the environment it is given, input, output, and resizing, and ending it when its terminal closes. `Keeper` holds up to a limit of shells, overall and per group, that outlive their attachments, each with recent output to replay, how much of it was taken before, and take-over by its newest attachment, a limit on how long they run with nothing attached to any of them, and each group's recent directories, read at a shell's prompt after Enter and kept only in memory. Knows nothing of jobs, runs, or HTTP. | `session.go` (`Start`, `Session`), `keeper.go` (`Keeper`, `Attachment`) | internal/tableview (https://rotari-dev.github.io/rotari/docs/internal/tableview/) | What the Table viewer reads: delimited files split on a chosen separator, JSON Lines files, Markdown and supported source/config document kinds, or a directory's immediate children and explicitly expanded subdirectories as rows or as files grouped by stem, indexed once per version so a page is read from a nearby checkpoint, filtered, sorted, described, and paged, and properties of image, audio, video, and PDF files its cells name. Callers supply a `Target`, the file and the roots it may be read under; every file is opened through `os.Root`. Knows nothing of jobs, runs, or HTTP. | `target.go` (`Target`, `RootOf`, `MediaTypes`), `delimited.go`, `jsonl.go`, `table.go` (`Table`), `filter.go`, `describe.go`, `media.go` (`Probe`), `directory.go` (`OpenDirectory`) | internal/fileops (https://rotari-dev.github.io/rotari/docs/internal/fileops/) | Changes to files for the terminal's Explorer: making a folder or an empty file, moving without replacing anything (`renameat2` with `RENAME_NOREPLACE` on Linux) and never across file systems, copying a file or link (never a folder) with a name of its own beside it on request, removing, writing an upload under a temporary name renamed into place (`WriteNew`), and writing a folder as a zip while reading it (`WriteZip`). Every new name is one path element (`CheckName`). Knows nothing of jobs, runs, or HTTP. | `fileops.go` (`CheckName`, `Mkdir`, `CreateFile`, `Move`, `CopyFile`, `CopyName`, `Remove`), `transfer.go` (`WriteNew`, `WriteZip`, `ZipName`), `rename_linux.go`, `rename_other.go` | internal/web (https://rotari-dev.github.io/rotari/docs/internal/web/) | JSON projections of runs, jobs, attempts, and timelines for the Web UI. | `loader.go` | internal/queueops (https://rotari-dev.github.io/rotari/docs/internal/queueops/) | Queue and run-history edits shared by the CLI and Web UI: add, change, remove, copy, deleting runs or a whole project (`DeleteProject`), and adding notes to a run (`AddNote`). Loads and saves the files around `internal/queueedit` through the `internal/project` edit sequence, owns `ValidateJobs`, and builds saved-run command snapshots in memory for `projectrun`. | `editor.go` (`Editor`), `change.go`, `copy.go` | internal/queueedit (https://rotari-dev.github.io/rotari/docs/internal/queueedit/) | Pure queue edits, such as building a queue from an earlier run (`copy`, `retry`). | `copy.go` | internal/workflow (https://rotari-dev.github.io/rotari/docs/internal/workflow/) | Workflow manifests: `export` merge and `import` reconciliation. | `manifest.go`, `export.go`, `reconcile.go` | internal/workflowstate (https://rotari-dev.github.io/rotari/docs/internal/workflowstate/) | Applies workflow manifests to saved project state: reads saved runs as sources to reconcile a manifest, imports a manifest into the queue under a `project.Guard`, and loads a settled run for export. Shared by `rotari import`, `rotari export`, and the MCP import and export tools. | `import.go` (`Import.Apply`), `sources.go`, `export.go` (`LoadSettledRun`) | internal/runlist (https://rotari-dev.github.io/rotari/docs/internal/runlist/) | Runs across state directories for `rotari runs`: which runs are listed, their lifecycle, client status, and order, as recorded values. | `runlist.go` (`Collect`, `Recent`) | internal/joblist (https://rotari-dev.github.io/rotari/docs/internal/joblist/) | Recent job attempts across a base directory's projects for `rotari jobs` and the Web UI's jobs page: which attempts are listed, their order, and how their times read. | `joblist.go` (`Collect`) | internal/report (https://rotari-dev.github.io/rotari/docs/internal/report/) | The redacted evidence report for AI-assisted diagnosis, shared by `show --report` and the Web UI. Reads jobs through `internal/web`'s projection. | `report.go` (`Build`) | internal/bugreport (https://rotari-dev.github.io/rotari/docs/internal/bugreport/) | `rotari bug-report`: collects the executable identity, host, basedir filesystem and clock, registered basedirs, Web events, configuration, `server.log`, and a run's state files, job output, and scheduler queries (`executor.ProbeSchedulerJob`) into a Markdown summary or a `.tar.gz` bundle. Secrets are always removed; paths and hostnames unless asked not to. `info` and `check` results come from `cmd/rotari` as files. | `bugreport.go` (`Collect`), `environment.go`, `run.go`, `redact.go`, `tar.go` (`WriteTarGz`) | internal/mcp (https://rotari-dev.github.io/rotari/docs/internal/mcp/) | MCP tools that `rotari mcp` (`cmd/rotari/mcp.go`) serves: read-only project list, run summary, bounded run wait, job report, project check, run comparison, and redacted run export, previewed, revision-guarded import and run start, job control of a running run, and previewed, revision-guarded reset/unlock. Run preview/start share source snapshot planning and report jobs omitted by a non-empty queue. They present the shared functions the CLI uses (`project.Overviews`, `basedirregistry.Discover`, `runview.Summary`, `projectrun.Runner.Check`, `runlineage.Compare`, `report.Build`, `workflowstate.Import`, `projectrun.RunSource`, `projectrun.Runner.PreviewRun`), locate runs only through the master directory's run registry (`resolve.RegisteredRun`), and return no absolute paths; every tool is added through `addTool`, which hides state directories in errors. Starting a supervisor and new job IDs come from `cmd/rotari` as `Options`; it does not import `cmd/rotari`. | `server.go` (`NewServer`), `tools.go`, `wait.go`, `export.go`, `write.go`, `control.go`, `reset.go`, `unlock.go` | internal/runlineage (https://rotari-dev.github.io/rotari/docs/internal/runlineage/) | Comparison and summaries of loaded runs for `lineage`, including whether each repository's code changed between two runs, and the grouping of a run's failures by cause that `show`, `lineage`, and the Web UI share. | `runlineage.go`, `failures.go` (`FailureGroups`), `sources.go` (`CompareSources`) | internal/jobfilter (https://rotari-dev.github.io/rotari/docs/internal/jobfilter/) | The conditions of the `--filter-*` options that narrow a job selection, evaluated without file access; callers supply what a condition needs about each job, and an error when they cannot read it. | `filter.go` (`Filter`, `Selects`) | internal/artifact (https://rotari-dev.github.io/rotari/docs/internal/artifact/) | Artifact candidate discovery: the one classifier that decides whether a command argument, environment value, or configuration string is a file or directory reference, with the accepting rule and provenance, the structural YAML/JSON/TOML walk of referenced configuration files, static inspection of shell code with `mvdan.cc/sh`, and lexical inspection of Python files. Reads no files; callers supply the job definition and a `SourceReader`. | `classify.go` (`Classify`), `command.go`, `discover.go` (`FromJob`), `config.go` (`Discover`, `ConfigReader`), `shell.go`, `python.go` | internal/artifactsource (https://rotari-dev.github.io/rotari/docs/internal/artifactsource/) | The only file access of artifact discovery: reads a referenced configuration file if it is a regular file within the size limit, without blocking on FIFOs or devices, and caches each configuration file's parse and each script's contents per version for one run. | `read.go` (`Read`), `cache.go` (`Cache`) | internal/sourcerev (https://rotari-dev.github.io/rotari/docs/internal/sourcerev/) | Reads the git or jj revision of the repository holding a directory, for the run's `sources.json`. A jj working copy is snapshotted first, so its commit ID covers uncommitted edits. Holds no run rules: `projectrun` chooses the directories. | `sourcerev.go` (`Read`, `ReadAll`) | internal/diagnose (https://rotari-dev.github.io/rotari/docs/internal/diagnose/) | Rule-based failure diagnosis. | `analysis.go` | internal/archtest (https://rotari-dev.github.io/rotari/docs/internal/archtest/) | Tests only: the package boundary rules checked against the import graph. | `boundaries_test.go` | internal/doclinks (https://rotari-dev.github.io/rotari/docs/internal/doclinks/) | Tests only: relative links and `#anchor` links in the root Markdown files, `contracts/`, and `docs/`. | `links_test.go` | conformance (https://rotari-dev.github.io/rotari/docs/conformance/) | Tests only: contract checks against the built binary and the Web API, importing only the standard library and their own harness, `conformance/support`. Document-to-directory mapping is in `layout.json`; tests are being migrated under the matching contract groups. | `harness_test.go`, `contracts_test.go`, `layout.json` | The interface flag-pair suites are split between 03-interfaces (https://rotari-dev.github.io/rotari/docs/conformance/03-interfaces/), pairedits (https://rotari-dev.github.io/rotari/docs/conformance/03-interfaces/pairedits/), and pairruns (https://rotari-dev.github.io/rotari/docs/conformance/03-interfaces/pairruns/), pairweb (https://rotari-dev.github.io/rotari/docs/conformance/03-interfaces/pairweb/), and pairjobcontrol (https://rotari-dev.github.io/rotari/docs/conformance/03-interfaces/pairjobcontrol/) to keep each Go package within the default test timeout. They share the public-binary fixture, schema sampling, bounded subprocess invocation, and restored state through conformance/support/pairs.go (https://rotari-dev.github.io/rotari/docs/conformance/support/pairs.go). No pair is skipped in short or race mode. Many `internal` functions take callbacks or hook fields (`projectrun.Runner`, `run.BatchLaneCallbacks`, `run.OriginResults`, `server.Operations`). This is how `cmd/rotari` supplies file access and output without the internal package importing it. When a callback's body is long, the logic probably belongs in an internal package. ### Where does new code go? - Can it be explained without paths, files, or locks, and does it only define or validate rotari concepts? `internal/model`. - Does it read or write a file or directory layout? `internal/state`. - Does it decide the next execution step of a run? `internal/run`. - Does it start, record, or finish a project's run on disk? `internal/projectrun`. - Does it decide whether a project may be edited, or save an idle edit? `internal/project`. - Does it edit a project's queue or run history on disk for more than one interface (CLI, Web, supervisor)? `internal/queueops`, with the pure queue transformation in `internal/queueedit`. - Does it talk to a process or scheduler? `internal/executor`. - Does it decide what status a job shows? `internal/jobstatus`. - Does it decide which base directory, project, run, or job a selector names? `internal/resolve`. - Is it a Web handler, the static export, or a Web asset? `internal/webui`. - Does it start or stop a command the user registered for artifacts? `internal/launcher`. - Does it read, filter, or page what the Table viewer shows? `internal/tableview`; its page and API are `internal/webui` (`table_view.go`, and `table_view_static.go` for a static snapshot). - Is it flag parsing, message wording, or colors? `cmd/rotari`. ## Files in cmd/rotari Configuration loading in `config.go` stages global/workspace → basedir selection → basedir config → project selection → project config. `config_selectors.go` retains location provenance when file defaults meet registry selectors. `init_workspace.go` writes only cwd defaults. The run client passes captured file values through `server.Request.FileConfig` to `projectrun.Start`, so `Begin` writes the merged snapshot without reopening ordinary source files. Notification discovery/snapshots stay independent. Web options capture the startup workspace directory; current views select validated real sources and run views read saved snapshots. `cmd/rotari` is the largest package. Each command has a `cmdXxx` function, dispatched from `run` in main.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/main.go). Role | Files | Entry and dispatch | `main.go` | Flag metadata, help, config defaults, completion | `cli_spec.go`, `config.go`, `completion.go`, `schema.go`, `guide.go`, `environment.go` | Queue editing (flags and output; `add`, `change`, `copy`, `remove`, `delete`, and `note` call `internal/queueops`) | `add.go`, `change.go`, `copy.go`, `remove.go`, `reset.go`, `delete.go`, `gc.go`, `unlock.go`, `note.go` | Starting a run (client side; the supervisor side is `internal/supervisor`) | `run_command.go`, `job_executor.go` | Default run registry wiring (`registerRun`, `resolveRunLocation`) | `run_registry.go` | Wiring the run lifecycle (`projectRunner`) and its failure diagnosis | `project_run.go`, `diagnosis.go` | Supervisor process wiring and its server registry | `server.go`, `registry.go` | Read-only context, configuration, supervisor, and run overview (`info`) | info.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/info.go) | Bug report options, run selection, and the `info` and `check` facts it passes to `internal/bugreport` | bug_report.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/bug_report.go) | `basedirs`, `projects`, and `runs` command flags and dispatch | lists.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/lists.go) | `stickies` command and `/api/stickies`: sticky notes read (and, from the Web UI only, saved) through `internal/stickies` | stickies.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/stickies.go) | `notifications` command: recorded notifications rendered by `notificationlog.Entries`, as the Web inbox renders them | notifications.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/notifications.go) | Project discovery and list rendering (`showProjectsForBaseDirs`) | projects.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/projects.go) | Registered basedir list rendering | basedirs.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/basedirs.go) | Job control | `job_control.go`, `wait.go` | Reading results | `show.go`, `show_artifacts.go`, `jobs.go`, `diff.go`, `check.go` | Workflow manifests | `export.go`, `import.go`, `workflow_source.go` | `web` command and the Web UI's CLI metadata (`webOptions`) | `web.go` | `web --allow-exec` (launcher file, manager, token, allowed hosts) and `config --launchers` | `web_launch.go` | `tableview` command (the Table viewer for one path) | `tableview.go` | Notifications and terminal output | `webhook.go`, `webhook_batch.go`, `color.go`, `terminal*.go` | Failures by cause, the completion message that `run` and `wait` print (`formatRunCompletion`), and the location options of printed next-step commands (`hintLocation`) | `failure_groups.go`, `run_completion.go`, `hint_location.go` | ## Walkthroughs ### `rotari add` - `cmdAdd` (add.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/add.go)) parses flags into `model.QueuedCommand` values. - `queueops.Editor.Add` (internal/queueops/add.go (https://rotari-dev.github.io/rotari/docs/internal/queueops/add.go)) resolves `state.ProjectPaths` and calls `project.EditQueue` (internal/project/edit.go (https://rotari-dev.github.io/rotari/docs/internal/project/edit.go)), which takes the state lock, checks the project is idle, loads `queue.json`, runs the callback that appends the new commands, and writes `meta.json` and then `queue.json`. `change`, `copy`, and `remove` follow the same path through their `queueops.Editor` methods, and `import` through its own callback; `delete` uses `project.Edit` for the lock and idle check alone, and `delete --project` (`Editor.DeleteProject`) moves the project directory out of `projects/` under the lock and removes it after. `copy --to-project` (`Editor.CopyTo`) reads the run from the source project and edits, or creates, the destination's queue under the destination's lock only. The Web UI and the supervisor call the same `queueops.Editor` methods. No supervisor is involved. ### `rotari run` Client side, in run_command.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/run_command.go): - `cmdRun` resolves the target project and, for `--run-id`, `--failed`, or `--job-id`, first repopulates the queue from an earlier run (`queueops.Editor.Copy`, backed by `internal/queueedit`). With `--to-project`, the request names the destination project and carries the source project in `SourceProject`; planning (`projectrun.PlanRun`) builds the snapshot from the source run with the selection already applied. - `startSupervisor` starts a new supervisor for this run as a child process, so it inherits the command's working directory and environment, and waits for its ready message on the inherited pipes. It fails if the project already has one. - Before a synchronous request it reserves a client session. It sends `server.Request{Op: OpRun}`; the server accepts once the run is committed and returns the run ID. It then closes the startup pipe and enters the same file-backed follower as `wait`. The async path reads its single start response and returns without attaching. Supervisor side: - `server.Server.Handle` (internal/server/serve.go (https://rotari-dev.github.io/rotari/docs/internal/server/serve.go)) dispatches `OpRun` to `supervisor.Operations.Run` (sync) or `StartRun` (async) in internal/supervisor/run.go (https://rotari-dev.github.io/rotari/docs/internal/supervisor/run.go); server.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/server.go) only builds the `Operations`. - `Run` / `StartRun` share `prepareRun`: take the state lock, check the project is idle, and validate the queue. Then `projectrun.Runner.Begin` (internal/projectrun/lifecycle.go (https://rotari-dev.github.io/rotari/docs/internal/projectrun/lifecycle.go)) writes `context.json` and the queue as `runs//commands.json`, takes the run lock (`running.lock`), registers the run, marks `meta.json` as running, and empties the queue, keeping its defaults. - `Runner.Run` then executes the run in the supervisor. Both sync and async runs journal progress; a supervisor monitor checks bound client sessions and applies same-host disconnect cancellation when configured. Sync `Run` returns after execution while its startup response has already been sent; async `StartRun` answers once and continues in a goroutine. The supervisor stops once the run ends. Execution, in `Runner.Execute` (internal/projectrun/execute.go (https://rotari-dev.github.io/rotari/docs/internal/projectrun/execute.go)): - Load the run's `commands.json`, the queue `Begin` took, convert it to `model.JobSpec`s, and validate IDs and dependencies. - `Runner.PlanSelection` → `run.PlanRerun`: decide which jobs execute and which results are carried from an earlier run. - Rewrite `runs//commands.json` with fingerprint matches and carried origins. - `run.NewDispatcher` builds one lane per executor with its own concurrency. `run.ExecuteJobs` (internal/run/engine.go (https://rotari-dev.github.io/rotari/docs/internal/run/engine.go)) is the loop: start jobs whose dependencies are satisfied, collect results, retry, and stop if the project is being cancelled. - Each lane calls the executor's `Submit` and `Wait` (internal/executor/contracts.go (https://rotari-dev.github.io/rotari/docs/internal/executor/contracts.go)). The executor writes attempt files under `runs///attempts//`. The run discovers each attempt's artifact candidates (`internal/artifact`) when it assigns the attempt ID and writes them to the attempt's `artifacts.json` once the attempt has been submitted (`artifactRecorder` in internal/projectrun/artifacts.go (https://rotari-dev.github.io/rotari/docs/internal/projectrun/artifacts.go)). - `run.BuildRunSummary` builds the summary, with diagnoses attached, and it is written to `summary.json`. Finish, in `Runner.Finish`: - Record the final load in `context.json`. - `Finalize` finalizes `meta.json` (`state.FinalizeRun`) after checking that the run lock is still this run's, then reports the finished run to the notification hook, which flushes any pending job events with it: the batch is appended to the master directory's notification record and, when configured, sent to the Webhook. - Remove the run lock. ### `rotari show` and the Web UI - `cmdShow` (show.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/show.go)) or a Web handler (internal/webui (https://rotari-dev.github.io/rotari/docs/internal/webui/webui.go)) resolves the run and job directories through `internal/state`. - Each job's outcome comes from `internal/jobstatus` (`ReadJob`, `ResolveAttempt`, `Timestamps`), which falls back from the attempt's `status` file to its wrapper `status.json` to `summary.json`. - The CLI formats text; `internal/web` (loader.go (https://rotari-dev.github.io/rotari/docs/internal/web/loader.go)) builds JSON for the browser. Never read status files directly in a renderer; go through `jobstatus` so the CLI and Web UI agree. ### `rotari cancel` - `cmdCancel` (job_control.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/job_control.go)) resolves the project, the run a run or attempt ID names, and the job IDs with `resolve.JobSelection`, and calls `jobcontrol.Controller.Cancel` in its own process. - `jobcontrol.Controller.Cancel` (internal/jobcontrol/jobcontrol.go (https://rotari-dev.github.io/rotari/docs/internal/jobcontrol/jobcontrol.go)), which finds the running run through its run lock, rejects a named run that is not the active one, expands array job IDs to tasks, marks `meta.json` as `cancelling` for a whole-run cancel, and calls the executor's `Cancel` for each running job. For a job not submitted yet it writes a `cancelled` marker, then checks again whether the run has submitted it meanwhile. - The run loop sees the cancelled results and the `cancelling` phase, and stops starting or retrying jobs. Once it has submitted a job, the dispatcher (`Dispatcher.afterSubmit`) cancels it if the phase or a marker shows that a cancel reached it during submission. - With `--wait`, `Cancel` polls until the run lock is released, or for a job selection until each selected job has stopped (`Controller.finishJobCancelMessage`). ### `rotari mcp` `rotari mcp` (mcp.go (https://rotari-dev.github.io/rotari/docs/cmd/rotari/mcp.go)) serves the MCP tools of internal/mcp (https://rotari-dev.github.io/rotari/docs/internal/mcp/) over stdio. The user guide is docs/MCP.md (https://rotari-dev.github.io/rotari/docs/MCP/), the rules are MCP-1 to MCP-7 in contracts/03-server-and-command-interfaces.md (https://rotari-dev.github.io/rotari/docs/contracts/03-server-and-command-interfaces.md), and how the design was chosen is in the agent interface plan (https://rotari-dev.github.io/rotari/docs/development/2026-10-02-mcp-agent-interface/plan.md). - A presentation layer. Each tool calls the functions the CLI uses: - `runview` and `runlineage` for summaries and comparisons; - `workflowstate` for import and export; - `projectrun` to plan a run; - `jobcontrol` for cancel, suspend, and resume; - `project.Reset` for reset. `internal/mcp` adds no selection, status, or grouping rule of its own, so a fix in a shared package reaches the CLI, the Web UI, and MCP together. What only the binary can do comes in as `mcp.Options`: starting a supervisor (`startRunForMCP`) and new job IDs. `internal/mcp` does not import `cmd/rotari`. - Add tools for demonstrated MCP-only gaps. Do not expose CLI commands or flags through MCP just for parity. Add a task-shaped tool when an MCP-only agent trial shows that an existing workflow cannot be completed, or takes disproportionate calls or output; otherwise, do not expand the MCP surface. Record the trial outcome and update the plan's shared behavior map when adding a capability. - Located through the master directory. A run is found by its ID in the run registry (`resolve.RegisteredRun`). A project is found by `basedir_ref`, a hash from the basedir registry, and its name. No tool takes or returns a path. Every tool is added through `addTool`, which replaces registered directories in error messages with `BASEDIR`. - Preview, then apply at a revision. Each tool that changes a project comes as a read-only preview and a write: - the preview returns `project.Revision`, a hash of `queue.json` and `meta.json`; - the write requires that revision and applies through the same `project.Guard` as the CLI's `--dry-run` / `--if-revision`, so it fails without effect if anything wrote the project in between. Job control guards by run ID instead, because a running run's state changes continuously: it acts only while that run is the active one. The MCP client's per-tool permission is the approval. Previews are annotated read-only, and `rotari_cancel` and `rotari_reset` destructive. - Starting and following a run. `rotari_start_run` copies from the last run under the guard when `projectrun.RunSource` says to, then sends an async run request whose `IfRevision` the supervisor checks again before `Begin`. It returns the run ID. `rotari_wait_run` and `rotari_run_summary` read the run's state through `project.RunPhaseOf`, which `rotari wait` also uses. - Bounded, redacted output. Evidence lines and the export view are redacted by pattern, and the full manifest stays with `rotari export`. Summaries list 10 jobs per failure group, and comparisons list 20 changed jobs, unless `all_jobs` is set; the rest are counted. ## Naming pitfalls - Project vs. queue. A project owns one queue, and much of the code still uses `queue` or `QueueName` for the project name (`server.Request.QueueName`, `queueName` variables). They mean the project. - Server vs. supervisor. The background coordinating process is called the supervisor in documentation, and `server` in code (`internal/server`, `rotari server`). The HTTP process is the Web server. - Import aliases. `cmd/rotari` imports `internal/run` as `runcontract` and `internal/server` as `serverinternal`, because `run` and `server` are already function names in `package main`. - Job vs. attempt. A job has a stable ID within a run; each execution of it (including retries) is an attempt with its own directory and an `att_` ID. --- ## CLI reference Source: https://rotari-dev.github.io/rotari/docs/CLI_REFERENCE/ # CLI reference The command reference below is generated from `rotari schema --json`, the same metadata used by command help and shell completion. Environment variables are documented separately in Environment variables (https://rotari-dev.github.io/rotari/docs/ENVIRONMENT_VARIABLES/). For options available from the CLI, environment, and configuration, values are resolved in this order: explicit CLI value, environment variable, configuration values, then built-in default. Ordinary files merge global → cwd workspace → basedir → project; command sections then override root values. `--config FILE` replaces automatic discovery with that file. See Configuration (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#configuration-files) for location constraints, `init`, source inspection, and file-only run snapshots. ## Short options These short forms are aliases for their long options. Each is available only for commands that support the corresponding long option; `-h` displays help. Short option | Long option | Purpose | `-b DIR` | `--basedir DIR` | State directory | `-p NAME` | `--project-name NAME` | Project name | `-r ID` | `--run-id ID` | Run selector | `-j ID` | `--job-id ID` | Job selector; repeatable where supported | `-e EXECUTOR` | `--executor EXECUTOR` | Select or override the executor | `-h` | `--help` | Display help | ## Commands ### `rotari info` show the current Rotari context and active run state Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | `--json` | `` | `ROTARI_INFO_JSON` | print machine-readable JSON | ### `rotari init` write cwd workspace location defaults without creating state Usage: `rotari init [BASEDIR [PROJECT]]` ### `rotari config` generate a config file template Option | Value | Environment | Description | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--list` | `` | `ROTARI_CONFIG_LIST` | list existing config files | `--notifications` | `` | `CLI only` | generate notifications.toml instead of command defaults | `--launchers` | `` | `CLI only` | generate launchers.toml, the commands rotari web --allow-exec can run against artifacts, in the global config directory | `--format` | `FORMAT` | `ROTARI_CONFIG_FORMAT` | config format: yaml, toml, or json (choices: yaml, toml, json) | `--output` | `FILE` | `ROTARI_CONFIG_OUTPUT` | output config file path | ### `rotari check` check whether a project is ready to run Usage: `rotari check [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--json` | `` | `ROTARI_CHECK_JSON` | print machine-readable JSON | `--deep` | `` | `ROTARI_CHECK_DEEP` | check local executables and working directories | `--quiet` | `` | `ROTARI_CHECK_QUIET` | suppress success output | ### `rotari reset` discard the current, not-yet-run queue Usage: `rotari reset [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--quiet` | `` | `ROTARI_RESET_QUIET` | suppress success output | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari cancel` cancel the active run or running jobs Usage: `rotari cancel [JOB_ID|ATTEMPT_ID|RUN_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | cancel a running job; may be repeated | `--job-name` | `NAME (repeatable)` | `ROTARI_JOB_NAME` | cancel the unfinished jobs with this name; may be repeated | `--stage` | `STAGE` | `ROTARI_CANCEL_STAGE` | cancel the unfinished jobs of this stage | `--matrix` | `NAME` | `ROTARI_CANCEL_MATRIX` | cancel the unfinished jobs of this matrix | `--wait` | `` | `ROTARI_CANCEL_WAIT` | wait until the cancel took effect: the whole run has stopped or, with a job selection, each selected job has stopped | `--yes` | `` | `CLI only` | cancel the jobs that filters select without asking | `--filter-state` | `STATE (repeatable)` | `CLI only` | select jobs in this state; may be repeated (choices: running, pending) | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | ### `rotari suspend` suspend running jobs Usage: `rotari suspend [JOB_ID|ATTEMPT_ID|RUN_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | suspend a running job; may be repeated | `--job-name` | `NAME (repeatable)` | `ROTARI_JOB_NAME` | suspend the running jobs with this name; may be repeated | `--stage` | `STAGE` | `ROTARI_SUSPEND_STAGE` | suspend the running jobs of this stage | `--matrix` | `NAME` | `ROTARI_SUSPEND_MATRIX` | suspend the running jobs of this matrix | `--yes` | `` | `CLI only` | suspend the jobs that filters select without asking | `--filter-state` | `STATE (repeatable)` | `CLI only` | select jobs in this state; may be repeated (choices: running) | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | ### `rotari resume` resume suspended jobs Usage: `rotari resume [JOB_ID|ATTEMPT_ID|RUN_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | resume a suspended job; may be repeated | `--job-name` | `NAME (repeatable)` | `ROTARI_JOB_NAME` | resume the suspended jobs with this name; may be repeated | `--stage` | `STAGE` | `ROTARI_RESUME_STAGE` | resume the suspended jobs of this stage | `--matrix` | `NAME` | `ROTARI_RESUME_MATRIX` | resume the suspended jobs of this matrix | `--yes` | `` | `CLI only` | resume the jobs that filters select without asking | `--filter-state` | `STATE (repeatable)` | `CLI only` | select jobs in this state; may be repeated (choices: running) | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | ### `rotari delete` delete saved run history Usage: `rotari delete [RUN_ID]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | run to delete | `--all` | `` | `CLI only` | delete every run of the project | `--project` | `` | `CLI only` | delete the whole project named by --project-name: its queue, runs, and project configuration | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari gc` find and remove orphan run registry entries Usage: `rotari gc [MASTERDIR]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | `--dry-run` | `` | `CLI only` | list the orphan entries without removing them | ### `rotari unlock` recover an interrupted run after assessing its coordinator and managed executions Usage: `rotari unlock [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | select the interrupted run to recover and verify it against project state | `--assume-stopped` | `` | `CLI only` | explicitly attest that unverifiable coordinator and managed executions stopped; required for unknown execution evidence; never overrides verified live ownership or execution | `--dry-run` | `` | `CLI only` | assess recovery without changing state | `--json` | `` | `CLI only` | print recovery assessment and refusal codes as JSON | ### `rotari change` change queued jobs, or with --run-id the jobs of that run, which replace the queue first; a command after the options replaces the jobs' command Usage: `rotari change ` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | first replace the queue with this run's jobs, then change them | `-j` / `--job-id` | `ID` | `ROTARI_JOB_ID` | target job ID | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | target job name | `--stage` | `STAGE` | `ROTARI_CHANGE_STAGE` | change every job in a stage | `--matrix` | `NAME` | `ROTARI_CHANGE_MATRIX` | change every job of a matrix, named by its base job name | `--all` | `` | `CLI only` | change every job | `-e` / `--executor` | `EXECUTOR` | `ROTARI_EXECUTOR` | replace job executor (choices: local, lsf, pbs, sge, slurm, ssh) | `--executor-option` | `OPTION` | `ROTARI_EXECUTOR_OPTIONS` | replace executor options; each value is split into words by shell quoting rules | `--clear-executor-options` | `` | `ROTARI_CHANGE_CLEAR_EXECUTOR_OPTIONS` | clear executor options | `--working-directory` | `DIR` | `ROTARI_CHANGE_WORKING_DIRECTORY` | working directory for the job; by default, the directory where rotari run or retry is started | `--clear-working-directory` | `` | `ROTARI_CHANGE_CLEAR_WORKING_DIRECTORY` | clear the job working directory | `--env` | `KEY=VALUE (repeatable)` | `ROTARI_CHANGE_ENV` | replace job environment variables; may be repeated | `--clear-env` | `` | `ROTARI_CHANGE_CLEAR_ENV` | clear job environment variables | `--set-job-name` | `NAME` | `ROTARI_CHANGE_SET_JOB_NAME` | replace job name | `--depends-on` | `NAME (repeatable)` | `ROTARI_CHANGE_DEPENDS_ON` | replace prerequisites; may be repeated | `--clear-depends-on` | `` | `ROTARI_CHANGE_CLEAR_DEPENDS_ON` | clear prerequisites | `--depends-on-finished` | `NAME (repeatable)` | `ROTARI_CHANGE_DEPENDS_ON_FINISHED` | replace prerequisites that only need to finish, whatever their result; may be repeated | `--clear-depends-on-finished` | `` | `ROTARI_CHANGE_CLEAR_DEPENDS_ON_FINISHED` | clear prerequisites that only need to finish | `--artifact` | `PATH (repeatable)` | `CLI only` | replace the declared artifact paths (see add --artifact); may be repeated | `--clear-artifacts` | `` | `ROTARI_CHANGE_CLEAR_ARTIFACTS` | clear the declared artifact paths | `--timeout` | `DURATION` | `CLI only` | replace the job timeout, such as 90m or 2h | `--clear-timeout` | `` | `ROTARI_CHANGE_CLEAR_TIMEOUT` | remove the job timeout | `--retry` | `N` | `CLI only` | replace the job's retry limit; 0 disables retries | `--clear-retry` | `` | `ROTARI_CHANGE_CLEAR_RETRY` | use the run's --retry limit for the job again and remove its retry delay settings | `--retry-delay` | `DURATION` | `ROTARI_CHANGE_RETRY_DELAY` | replace the wait before the job's first retry, such as 30s | `--retry-backoff` | `FACTOR` | `ROTARI_CHANGE_RETRY_BACKOFF` | replace the factor applied to the retry delay for each further retry | `--retry-max-delay` | `DURATION` | `ROTARI_CHANGE_RETRY_MAX_DELAY` | replace the upper limit of the retry delay | `--status` | `STATUS` | `CLI only` | mark the job with a status that result filters of the next run read in place of its recorded result (choices: success, failed, cancelled, unfinished) | `--clear-status` | `` | `ROTARI_CHANGE_CLEAR_STATUS` | remove the job's status mark | `--quiet` | `` | `ROTARI_CHANGE_QUIET` | suppress success output | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari export` export the current queue or saved runs as a workflow manifest Usage: `rotari export [TARGET] [FILE]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID (repeatable)` | `ROTARI_RUN_ID` | run ID to export; may be repeated | `--format` | `FORMAT` | `ROTARI_EXPORT_FORMAT` | manifest format: yaml, toml, or json (choices: yaml, toml, json) | `--template` | `` | `ROTARI_EXPORT_TEMPLATE` | print a starter workflow manifest | `--output` | `FILE` | `CLI only` | write the workflow manifest to a file | ### `rotari import` validate and replace a queue from a workflow manifest Usage: `rotari import FILE [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--overwrite` | `` | `ROTARI_IMPORT_OVERWRITE` | replace a non-empty queue | `--json` | `` | `ROTARI_IMPORT_JSON` | print the import plan as JSON | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari remove` remove queued jobs, or with --run-id jobs of that run, which replace the queue first Usage: `rotari remove [JOB_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | first replace the queue with this run's jobs, then remove from them | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | remove a job; may be repeated | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | remove a job by name | `--stage` | `STAGE` | `ROTARI_REMOVE_STAGE` | remove every job in a stage | `--matrix` | `NAME` | `ROTARI_REMOVE_MATRIX` | remove every job of a matrix, named by its base job name | `--all` | `` | `CLI only` | remove every job | `--quiet` | `` | `ROTARI_REMOVE_QUIET` | suppress success output | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari basedirs` list state directories known to the master registry Option | Value | Environment | Description | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | ### `rotari projects` list projects across known state directories Option | Value | Environment | Description | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | limit the listing to this state directory | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | ### `rotari runs` list active runs and recently finished runs across known state directories Usage: `rotari runs [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | `--since` | `DURATION` | `ROTARI_RUNS_SINCE` | include finished runs in this time window (default 1d), such as 24h or 7d; active or interrupted runs are always included; lifecycle filters narrow the results | `--json` | `` | `ROTARI_RUNS_JSON` | print machine-readable JSON | `--filter-running` | `` | `CLI only` | select runs in the running lifecycle | `--running` | `` | `CLI only` | short form of --filter-running | `--filter-interrupted` | `` | `CLI only` | select runs in the interrupted lifecycle | `--interrupted` | `` | `CLI only` | short form of --filter-interrupted | `--filter-incomplete` | `` | `CLI only` | select runs in the incomplete lifecycle | `--incomplete` | `` | `CLI only` | short form of --filter-incomplete | `--filter-finished` | `` | `CLI only` | select runs in the finished lifecycle | `--finished` | `` | `CLI only` | short form of --filter-finished | `--filter-failed` | `` | `CLI only` | select runs in the failed lifecycle | `--failed` | `` | `CLI only` | short form of --filter-failed | `--filter-cancelled` | `` | `CLI only` | select runs in the cancelled lifecycle | `--cancelled` | `` | `CLI only` | short form of --filter-cancelled | ### `rotari notifications` list the notifications runs recorded for the Web inbox across known state directories, without marking them read Usage: `rotari notifications [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | `--since` | `DURATION` | `ROTARI_NOTIFICATIONS_SINCE` | include notifications recorded in this time window (default 1d), such as 24h or 7d; notifications are kept for 10 days | `--unread` | `` | `ROTARI_NOTIFICATIONS_UNREAD` | list only notifications the Web inbox has not marked read | `--json` | `` | `ROTARI_NOTIFICATIONS_JSON` | print machine-readable JSON | ### `rotari show` show details for a project, run, job, or attempt Usage: `rotari show [SELECTOR]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | run ID or latest | `--queue` | `` | `ROTARI_SHOW_QUEUE` | show the current queue even when a run is selected | `-j` / `--job-id` | `ID` | `ROTARI_JOB_ID` | job ID | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | job name | `--failed` | `` | `ROTARI_SHOW_FAILED` | short form of --filter-failed | `--unfinished` | `` | `ROTARI_SHOW_UNFINISHED` | short form of --filter-unfinished | `--success` | `` | `ROTARI_SHOW_SUCCESS` | short form of --filter-success | `--stage` | `NAME` | `ROTARI_SHOW_STAGE` | show jobs in this stage only | `--matrix` | `NAME` | `ROTARI_SHOW_MATRIX` | show jobs of this matrix only, named by its base job name | `--logs` | `` | `ROTARI_SHOW_LOGS` | print output logs for all jobs | `--failed-logs` | `` | `ROTARI_SHOW_FAILED_LOGS` | print output logs for failed jobs | `--no-logs` | `` | `ROTARI_SHOW_NO_LOGS` | show one job or attempt's details without logs or automatic following | `--stream` | `STREAM` | `ROTARI_SHOW_STREAM` | show both streams or select stdout/stderr | `--tail` | `N` | `ROTARI_SHOW_TAIL` | print only the last N lines of each log, with --logs, --failed-logs, or a job's output | `--follow` | `` | `ROTARI_SHOW_FOLLOW` | follow one selected log stream until the run completes | `--no-pager` | `` | `ROTARI_SHOW_NO_PAGER` | print logs directly instead of using a pager | `--json` | `` | `ROTARI_SHOW_JSON` | print machine-readable JSON for a run | `--report` | `` | `ROTARI_SHOW_REPORT` | print a Markdown report: notes, a job table, and each job's evidence | `--artifacts` | `` | `ROTARI_SHOW_ARTIFACTS` | list every artifact candidate of one job attempt instead of its logs | `--wide` | `` | `ROTARI_SHOW_WIDE` | print the run or queue table in full: attempt IDs, submit times, expanded dependencies, whole commands, and the columns that are the same for every job | `--filter-failed` | `` | `CLI only` | select jobs with a failed result | `--filter-unfinished` | `` | `CLI only` | select jobs without a finished result | `--filter-success` | `` | `CLI only` | select jobs with a successful result | `--filter-exit-code` | `N (repeatable)` | `CLI only` | select jobs with this exit code; may be repeated | `--filter-failure-kind` | `KIND (repeatable)` | `CLI only` | select jobs of this failure kind; may be repeated (choices: timeout, cancelled, blocked, oom, signal, error) | `--filter-diagnosis` | `VALUE (repeatable)` | `CLI only` | select failed jobs matching a current diagnosis rule; may be repeated | `--filter-failure-cause` | `CAUSE (repeatable)` | `CLI only` | select failed jobs that failure summaries group under this cause; may be repeated | `--filter-changed` | `` | `CLI only` | select queued jobs whose definition changed from the reference run | `--filter-new` | `` | `CLI only` | select queued jobs with no matching job in the reference run | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-finished-after` | `TIME` | `CLI only` | select jobs finished at or after this time | `--filter-finished-before` | `TIME` | `CLI only` | select jobs finished before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | ### `rotari note` add a note to a run or to one job attempt: why it was made or what its result showed Usage: `rotari note RUN_ID|ATTEMPT_ID TEXT` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | ### `rotari stickies` list the sticky notes put on Web UI pages, read-only Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `--page` | `PAGE` | `CLI only` | list only the notes of this Web UI page, such as / or projects/NAME | `--search` | `TEXT` | `CLI only` | list only the notes whose text contains every word of TEXT, ignoring case | `--json` | `` | `ROTARI_STICKIES_JSON` | print the pages and notes as JSON | ### `rotari lineage` list runs, summarize one run, or compare two runs Usage: `rotari lineage [RUN_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--json` | `` | `ROTARI_LINEAGE_JSON` | print the lineage, summary, or comparison as JSON | ### `rotari jobs` list running and recently finished jobs across known state directories Usage: `rotari jobs [PROJECT]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory | `--format` | `FORMAT` | `ROTARI_JOBS_FORMAT` | output fields; use %s %b %p %a %n %c %t %f %e (%f is finished time) | `--since` | `DURATION` | `ROTARI_JOBS_SINCE` | include jobs finished within this duration (default 1d), such as 24h or 7d; unfinished jobs are always included | `--json` | `` | `ROTARI_JOBS_JSON` | print machine-readable JSON; not with --format | `--wide` | `` | `ROTARI_JOBS_WIDE` | add job names and elapsed times to the default fields, keep the time zone, (recorded), and the project and state directory columns even when every job shares them, and print whole state directories and commands; not with --format or --json | `--filter-failed` | `` | `CLI only` | select jobs with a failed result | `--filter-unfinished` | `` | `CLI only` | select jobs without a finished result | `--filter-success` | `` | `CLI only` | select jobs with a successful result | `--failed` | `` | `CLI only` | short form of --filter-failed | `--unfinished` | `` | `CLI only` | short form of --filter-unfinished | `--success` | `` | `CLI only` | short form of --filter-success | `--filter-running` | `` | `CLI only` | select jobs in the running state | `--running` | `` | `CLI only` | short form of --filter-running | `--filter-waiting` | `` | `CLI only` | select jobs in the waiting state | `--waiting` | `` | `CLI only` | short form of --filter-waiting | `--filter-suspended` | `` | `CLI only` | select jobs in the suspended state | `--suspended` | `` | `CLI only` | short form of --filter-suspended | `--filter-pending` | `` | `CLI only` | select jobs in the pending state | `--pending` | `` | `CLI only` | short form of --filter-pending | `--filter-unknown` | `` | `CLI only` | select jobs in the unknown state | `--unknown` | `` | `CLI only` | short form of --filter-unknown | ### `rotari wait` wait for a run by project, run name, or run ID Usage: `rotari wait [PROJECT_OR_RUN_NAME_OR_RUN_ID ...]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `--disconnect-action` | `ACTION` | `ROTARI_DISCONNECT_ACTION` | when the wait client is killed or its terminal closes, detach or cancel selected runs (default detach); Ctrl-D or the end of terminal input always detaches (choices: detach, cancel) | `-r` / `--run-id` | `ID (repeatable)` | `ROTARI_RUN_ID` | run ID; may be repeated | `--timeout` | `DURATION` | `ROTARI_WAIT_TIMEOUT` | maximum wait duration | `--until-failure` | `` | `ROTARI_WAIT_UNTIL_FAILURE` | return as soon as a job of the run has failed with no retry left, without waiting for the rest | `--json` | `` | `ROTARI_WAIT_JSON` | print each completed run as one JSON object | `--quiet` | `` | `ROTARI_WAIT_QUIET` | suppress normal progress and completion output; keep failure diagnostics and JSON results | `--all` | `` | `ROTARI_WAIT_ALL` | without a selector, wait for every active run in the basedir, not only those started from this shell | ### `rotari add` add a command to a queue Usage: `rotari add ` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-e` / `--executor` | `EXECUTOR` | `ROTARI_EXECUTOR` | job executor (choices: local, lsf, pbs, sge, slurm, ssh) | `--executor-option` | `OPTION (repeatable)` | `ROTARI_EXECUTOR_OPTIONS` | option passed to the executor (sbatch/qsub/bsub/ssh); each value is split into words by shell quoting rules; replaces the run's executor options for this job; may be repeated | `--output` | `FILE (repeatable)` | `CLI only` | stdout destination; stderr also goes here unless --error is specified; may be repeated | `--error` | `FILE (repeatable)` | `CLI only` | stderr destination; defaults to --output destinations; may be repeated | `--artifact` | `PATH (repeatable)` | `CLI only` | a file or directory the job writes or reads, recorded as an artifact candidate of each attempt besides the paths found statically in the job definition, which misses paths built at runtime; $ROTARI_ARRAY_TASK_ID, $ROTARI_JOB_DIR, and the job's --env and matrix variables expand; may be repeated | `--log-mode` | `MODE` | `CLI only` | internal log mode (choices: merge, separate) | `--open-mode` | `MODE` | `CLI only` | external output file mode (choices: append, truncate) | `--working-directory` | `DIR` | `ROTARI_ADD_WORKING_DIRECTORY` | working directory for the job; by default, the directory where rotari run or retry is started | `--env` | `KEY=VALUE (repeatable)` | `ROTARI_ADD_ENV` | environment variable for the job; may be repeated | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | job name label | `--stage` | `NAME` | `ROTARI_ADD_STAGE` | stage that contains the job | `--depends-on` | `NAME (repeatable)` | `ROTARI_ADD_DEPENDS_ON` | name of a prerequisite job or stage; may be repeated | `--depends-on-finished` | `NAME (repeatable)` | `ROTARI_ADD_DEPENDS_ON_FINISHED` | name of a prerequisite job or stage that must finish, whatever its result; may be repeated | `--timeout` | `DURATION` | `CLI only` | stop the job this long after it starts, such as 90m or 2h; it then fails with exit code 124 | `--retry` | `N` | `CLI only` | retry the job up to N times when it fails, instead of the run's --retry; 0 disables retries | `--retry-delay` | `DURATION` | `ROTARI_ADD_RETRY_DELAY` | wait this long before the job's first retry, such as 30s; retries are immediate by default | `--retry-backoff` | `FACTOR` | `ROTARI_ADD_RETRY_BACKOFF` | multiply the retry delay by this factor for each further retry, such as 2 | `--retry-max-delay` | `DURATION` | `ROTARI_ADD_RETRY_MAX_DELAY` | upper limit of the retry delay, such as 10m | `--array` | `FIRST-LAST\|TASK[,TASK...]` | `ROTARI_ARRAY_RANGE` | create an array job range or selected tasks | `--matrix` | `KEY=VALUE[,VALUE...] (repeatable)` | `ROTARI_ADD_MATRIX` | expand a command into jobs from KEY=VALUE[,VALUE...] dimensions; may be repeated | `--matrix-exclude` | `KEY=VALUE[,KEY=VALUE...] (repeatable)` | `CLI only` | exclude matrix combinations matching KEY=VALUE[,KEY=VALUE...]; requires --matrix and may be repeated | `--quiet` | `` | `ROTARI_ADD_QUIET` | suppress success output | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari copy` copy the latest run's jobs into the queue Usage: `rotari copy [RUN_ID]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | source run ID; defaults to the latest run | `--to-project` | `NAME` | `CLI only` | copy into this project's queue instead, creating the project if needed; the copied jobs are unfinished there | `--failed` | `` | `ROTARI_COPY_FAILED` | short form of --filter-failed | `--unfinished` | `` | `ROTARI_COPY_UNFINISHED` | short form of --filter-unfinished | `--success` | `` | `ROTARI_COPY_SUCCESS` | short form of --filter-success | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | copy a job; may be repeated | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | copy a job by name | `--stage` | `STAGE` | `ROTARI_COPY_STAGE` | only copy jobs in this stage, narrowed by any result filter | `--matrix` | `NAME` | `ROTARI_COPY_MATRIX` | only copy jobs of this matrix, named by its base job name, narrowed by any result filter | `--append` | `` | `ROTARI_COPY_APPEND` | append to a non-empty queue | `--overwrite` | `` | `ROTARI_COPY_OVERWRITE` | replace a non-empty queue | `--quiet` | `` | `ROTARI_COPY_QUIET` | suppress success output | `--filter-failed` | `` | `CLI only` | select jobs with a failed result | `--filter-unfinished` | `` | `CLI only` | select jobs without a finished result | `--filter-success` | `` | `CLI only` | select jobs with a successful result | `--filter-exit-code` | `N (repeatable)` | `CLI only` | select jobs with this exit code; may be repeated | `--filter-failure-kind` | `KIND (repeatable)` | `CLI only` | select jobs of this failure kind; may be repeated (choices: timeout, cancelled, blocked, oom, signal, error) | `--filter-diagnosis` | `VALUE (repeatable)` | `CLI only` | select failed jobs matching a current diagnosis rule; may be repeated | `--filter-failure-cause` | `CAUSE (repeatable)` | `CLI only` | select failed jobs that failure summaries group under this cause; may be repeated | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-finished-after` | `TIME` | `CLI only` | select jobs finished at or after this time | `--filter-finished-before` | `TIME` | `CLI only` | select jobs finished before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari run` execute queued commands, optionally selecting jobs from a run; jobs that depend on a selected job execute too Usage: `rotari run [RUN_ID]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | build the run from this saved run without changing the next queue; without it, a result filter copies the latest run only into an empty queue and otherwise uses the queued jobs | `--to-project` | `NAME` | `CLI only` | start the run in this project instead, creating it if needed, from the selected jobs of the saved run (--run-id, else the latest run); all of them execute there and no result is carried | `--run-name` | `NAME` | `ROTARI_RUN_NAME` | run name label | `--actor` | `LABEL` | `ROTARI_ACTOR` | who starts the run, such as an agent's name; recorded with the run and shown by show, runs, lineage, and the Web Activity page | `--note` | `TEXT` | `CLI only` | why this run is made; recorded with the run and shown by show and lineage; add more later with rotari note | `--local-concurrency` | `N` | `ROTARI_RUN_LOCAL_CONCURRENCY` | local worker concurrency | `--batch-concurrency` | `N` | `ROTARI_RUN_BATCH_CONCURRENCY` | scheduler job concurrency (Slurm/PBS/LSF/SGE) | `--retry` | `N` | `ROTARI_RUN_RETRY` | retry failed jobs up to N times; explicit cancellations are not retried | `--failed` | `` | `ROTARI_RUN_FAILED` | short form of --filter-failed; only execute failed jobs, others carry forward their previous result | `--unfinished` | `` | `ROTARI_RUN_UNFINISHED` | short form of --filter-unfinished; only execute unfinished jobs, others carry forward their previous result | `--success` | `` | `ROTARI_RUN_SUCCESS` | short form of --filter-success; only execute successful jobs, others carry forward their previous result | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | only execute this job and the jobs that depend on it, through --depends-on or --depends-on-finished; may be repeated; not with a result filter; others carry forward their previous result | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | only execute this job by name | `--stage` | `STAGE` | `ROTARI_RUN_STAGE` | only execute jobs in this stage, narrowed by any result filter; others carry forward their previous result | `--matrix` | `NAME` | `ROTARI_RUN_MATRIX` | only execute jobs of this matrix, named by its base job name, narrowed by any result filter; others carry forward their previous result | `--partial-array` | `` | `ROTARI_RUN_PARTIAL_ARRAY` | with a result filter, select array jobs per task instead of all-or-nothing (default true); pass =false to re-execute the whole array when any task matches | `--async` | `` | `ROTARI_RUN_ASYNC` | return after starting the run | `--disconnect-action` | `ACTION` | `ROTARI_DISCONNECT_ACTION` | when the client is killed or its terminal closes, detach or cancel (default detach); Ctrl-D or the end of terminal input always detaches (choices: detach, cancel) | `--quiet` | `` | `ROTARI_RUN_QUIET` | suppress progress and completion output | `-e` / `--executor` | `EXECUTOR` | `ROTARI_EXECUTOR` | execution executor override (choices: local, lsf, pbs, sge, slurm, ssh) | `--env` | `ALL\|NONE` | `CLI only` | caller environment propagation mode (default ALL) (choices: ALL, NONE) | `--match-by` | `MODE` | `CLI only` | job identity matching (choices: job-id, fingerprint, id-and-fingerprint) | `--executor-option` | `OPTION (repeatable)` | `ROTARI_EXECUTOR_OPTIONS` | option passed to the executor (sbatch/qsub/bsub/ssh) of jobs without their own; each value is split into words by shell quoting rules; may be repeated | `--ssh-concurrency` | `N` | `ROTARI_RUN_SSH_CONCURRENCY` | SSH executor concurrency | `--ssh-options` | `OPTION (repeatable)` | `ROTARI_RUN_SSH_OPTIONS` | SSH executor dispatch options; may be repeated | `--slurm-concurrency` | `N` | `ROTARI_RUN_SLURM_CONCURRENCY` | Slurm executor concurrency | `--slurm-options` | `OPTION (repeatable)` | `ROTARI_RUN_SLURM_OPTIONS` | Slurm executor dispatch options; may be repeated | `--slurm-submit-interval` | `DURATION` | `ROTARI_RUN_SLURM_SUBMIT_INTERVAL` | minimum Slurm submission interval | `--slurm-submit-retry-limit` | `N` | `ROTARI_RUN_SLURM_SUBMIT_RETRY_LIMIT` | maximum retries for transient Slurm submission failures | `--pbs-concurrency` | `N` | `ROTARI_RUN_PBS_CONCURRENCY` | PBS executor concurrency | `--pbs-options` | `OPTION (repeatable)` | `ROTARI_RUN_PBS_OPTIONS` | PBS executor dispatch options; may be repeated | `--pbs-submit-interval` | `DURATION` | `ROTARI_RUN_PBS_SUBMIT_INTERVAL` | minimum PBS submission interval | `--pbs-submit-retry-limit` | `N` | `ROTARI_RUN_PBS_SUBMIT_RETRY_LIMIT` | maximum retries for transient PBS submission failures | `--lsf-concurrency` | `N` | `ROTARI_RUN_LSF_CONCURRENCY` | LSF executor concurrency | `--lsf-options` | `OPTION (repeatable)` | `ROTARI_RUN_LSF_OPTIONS` | LSF executor dispatch options; may be repeated | `--lsf-submit-interval` | `DURATION` | `ROTARI_RUN_LSF_SUBMIT_INTERVAL` | minimum LSF submission interval | `--lsf-submit-retry-limit` | `N` | `ROTARI_RUN_LSF_SUBMIT_RETRY_LIMIT` | maximum retries for transient LSF submission failures | `--sge-concurrency` | `N` | `ROTARI_RUN_SGE_CONCURRENCY` | SGE executor concurrency | `--sge-options` | `OPTION (repeatable)` | `ROTARI_RUN_SGE_OPTIONS` | SGE executor dispatch options; may be repeated | `--sge-submit-interval` | `DURATION` | `ROTARI_RUN_SGE_SUBMIT_INTERVAL` | minimum SGE submission interval | `--sge-submit-retry-limit` | `N` | `ROTARI_RUN_SGE_SUBMIT_RETRY_LIMIT` | maximum retries for transient SGE submission failures | `--filter-failed` | `` | `CLI only` | select jobs with a failed result | `--filter-unfinished` | `` | `CLI only` | select jobs without a finished result | `--filter-success` | `` | `CLI only` | select jobs with a successful result | `--filter-exit-code` | `N (repeatable)` | `CLI only` | select jobs with this exit code; may be repeated | `--filter-failure-kind` | `KIND (repeatable)` | `CLI only` | select jobs of this failure kind; may be repeated (choices: timeout, cancelled, blocked, oom, signal, error) | `--filter-diagnosis` | `VALUE (repeatable)` | `CLI only` | select failed jobs matching a current diagnosis rule; may be repeated | `--filter-failure-cause` | `CAUSE (repeatable)` | `CLI only` | select failed jobs that failure summaries group under this cause; may be repeated | `--filter-changed` | `` | `CLI only` | select queued jobs whose definition changed from the reference run | `--filter-new` | `` | `CLI only` | select queued jobs with no matching job in the reference run | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-finished-after` | `TIME` | `CLI only` | select jobs finished at or after this time | `--filter-finished-before` | `TIME` | `CLI only` | select jobs finished before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari retry` run failed and unfinished jobs; with --job-id, run those jobs; jobs that depend on them execute too Usage: `rotari retry [RUN_ID]` Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | build the retry from this saved run without changing the next queue; without it, retry copies the latest run only into an empty queue and otherwise uses the queued jobs | `--to-project` | `NAME` | `CLI only` | start the run in this project instead, creating it if needed, from the selected jobs of the saved run (--run-id, else the latest run); all of them execute there and no result is carried | `--run-name` | `NAME` | `ROTARI_RUN_NAME` | run name label | `--actor` | `LABEL` | `ROTARI_ACTOR` | who starts the run, such as an agent's name; recorded with the run and shown by show, runs, lineage, and the Web Activity page | `--note` | `TEXT` | `CLI only` | why this run is made; recorded with the run and shown by show and lineage; add more later with rotari note | `--local-concurrency` | `N` | `ROTARI_RUN_LOCAL_CONCURRENCY` | local worker concurrency | `--batch-concurrency` | `N` | `ROTARI_RUN_BATCH_CONCURRENCY` | scheduler job concurrency (Slurm/PBS/LSF/SGE) | `--retry` | `N` | `ROTARI_RUN_RETRY` | retry failed jobs up to N times; explicit cancellations are not retried | `--failed` | `` | `ROTARI_RUN_FAILED` | only execute failed jobs, instead of failed and unfinished jobs; others carry forward their previous result | `--unfinished` | `` | `ROTARI_RUN_UNFINISHED` | only execute unfinished jobs, instead of failed and unfinished jobs; others carry forward their previous result | `--success` | `` | `ROTARI_RUN_SUCCESS` | only execute successful jobs, instead of failed and unfinished jobs; others carry forward their previous result | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | only execute this job and the jobs that depend on it, through --depends-on or --depends-on-finished, instead of failed and unfinished jobs; may be repeated | `--job-name` | `NAME` | `ROTARI_JOB_NAME` | only execute this job by name | `--stage` | `STAGE` | `ROTARI_RUN_STAGE` | only retry jobs in this stage | `--matrix` | `NAME` | `ROTARI_RUN_MATRIX` | only retry jobs of this matrix, named by its base job name | `--partial-array` | `` | `ROTARI_RUN_PARTIAL_ARRAY` | with a result filter, select array jobs per task instead of all-or-nothing (default true); pass =false to re-execute the whole array when any task matches | `--async` | `` | `ROTARI_RUN_ASYNC` | return after starting the run | `--disconnect-action` | `ACTION` | `ROTARI_DISCONNECT_ACTION` | when the client is killed or its terminal closes, detach or cancel (default detach); Ctrl-D or the end of terminal input always detaches (choices: detach, cancel) | `--quiet` | `` | `ROTARI_RUN_QUIET` | suppress progress and completion output | `-e` / `--executor` | `EXECUTOR` | `ROTARI_EXECUTOR` | execution executor override (choices: local, lsf, pbs, sge, slurm, ssh) | `--env` | `ALL\|NONE` | `CLI only` | caller environment propagation mode (default ALL) (choices: ALL, NONE) | `--match-by` | `MODE` | `CLI only` | job identity matching (choices: job-id, fingerprint, id-and-fingerprint) | `--executor-option` | `OPTION (repeatable)` | `ROTARI_EXECUTOR_OPTIONS` | option passed to the executor (sbatch/qsub/bsub/ssh) of jobs without their own; each value is split into words by shell quoting rules; may be repeated | `--ssh-concurrency` | `N` | `ROTARI_RUN_SSH_CONCURRENCY` | SSH executor concurrency | `--ssh-options` | `OPTION (repeatable)` | `ROTARI_RUN_SSH_OPTIONS` | SSH executor dispatch options; may be repeated | `--slurm-concurrency` | `N` | `ROTARI_RUN_SLURM_CONCURRENCY` | Slurm executor concurrency | `--slurm-options` | `OPTION (repeatable)` | `ROTARI_RUN_SLURM_OPTIONS` | Slurm executor dispatch options; may be repeated | `--slurm-submit-interval` | `DURATION` | `ROTARI_RUN_SLURM_SUBMIT_INTERVAL` | minimum Slurm submission interval | `--slurm-submit-retry-limit` | `N` | `ROTARI_RUN_SLURM_SUBMIT_RETRY_LIMIT` | maximum retries for transient Slurm submission failures | `--pbs-concurrency` | `N` | `ROTARI_RUN_PBS_CONCURRENCY` | PBS executor concurrency | `--pbs-options` | `OPTION (repeatable)` | `ROTARI_RUN_PBS_OPTIONS` | PBS executor dispatch options; may be repeated | `--pbs-submit-interval` | `DURATION` | `ROTARI_RUN_PBS_SUBMIT_INTERVAL` | minimum PBS submission interval | `--pbs-submit-retry-limit` | `N` | `ROTARI_RUN_PBS_SUBMIT_RETRY_LIMIT` | maximum retries for transient PBS submission failures | `--lsf-concurrency` | `N` | `ROTARI_RUN_LSF_CONCURRENCY` | LSF executor concurrency | `--lsf-options` | `OPTION (repeatable)` | `ROTARI_RUN_LSF_OPTIONS` | LSF executor dispatch options; may be repeated | `--lsf-submit-interval` | `DURATION` | `ROTARI_RUN_LSF_SUBMIT_INTERVAL` | minimum LSF submission interval | `--lsf-submit-retry-limit` | `N` | `ROTARI_RUN_LSF_SUBMIT_RETRY_LIMIT` | maximum retries for transient LSF submission failures | `--sge-concurrency` | `N` | `ROTARI_RUN_SGE_CONCURRENCY` | SGE executor concurrency | `--sge-options` | `OPTION (repeatable)` | `ROTARI_RUN_SGE_OPTIONS` | SGE executor dispatch options; may be repeated | `--sge-submit-interval` | `DURATION` | `ROTARI_RUN_SGE_SUBMIT_INTERVAL` | minimum SGE submission interval | `--sge-submit-retry-limit` | `N` | `ROTARI_RUN_SGE_SUBMIT_RETRY_LIMIT` | maximum retries for transient SGE submission failures | `--filter-failed` | `` | `CLI only` | select jobs with a failed result | `--filter-unfinished` | `` | `CLI only` | select jobs without a finished result | `--filter-success` | `` | `CLI only` | select jobs with a successful result | `--filter-exit-code` | `N (repeatable)` | `CLI only` | select jobs with this exit code; may be repeated | `--filter-failure-kind` | `KIND (repeatable)` | `CLI only` | select jobs of this failure kind; may be repeated (choices: timeout, cancelled, blocked, oom, signal, error) | `--filter-diagnosis` | `VALUE (repeatable)` | `CLI only` | select failed jobs matching a current diagnosis rule; may be repeated | `--filter-failure-cause` | `CAUSE (repeatable)` | `CLI only` | select failed jobs that failure summaries group under this cause; may be repeated | `--filter-changed` | `` | `CLI only` | select queued jobs whose definition changed from the reference run | `--filter-new` | `` | `CLI only` | select queued jobs with no matching job in the reference run | `--filter-host` | `PATTERN (repeatable)` | `CLI only` | select jobs run on a matching host; may be repeated | `--filter-started-after` | `TIME` | `CLI only` | select jobs started at or after this time | `--filter-started-before` | `TIME` | `CLI only` | select jobs started before this time | `--filter-finished-after` | `TIME` | `CLI only` | select jobs finished at or after this time | `--filter-finished-before` | `TIME` | `CLI only` | select jobs finished before this time | `--filter-longer-than` | `DURATION` | `CLI only` | select jobs running at least this long | `--filter-shorter-than` | `DURATION` | `CLI only` | select jobs running less than this long | `--filter-command` | `RE` | `CLI only` | select jobs whose argv matches this Go regexp | `--filter-stage` | `NAME` | `CLI only` | select jobs in this stage; same as --stage | `--filter-not-stage` | `NAME (repeatable)` | `CLI only` | exclude jobs in this stage; may be repeated | `--filter-matrix` | `NAME` | `CLI only` | select jobs of this matrix, named by its base job name; same as --matrix | `--filter-not-matrix` | `NAME (repeatable)` | `CLI only` | exclude jobs of this matrix, named by its base job name; may be repeated | `--dry-run` | `` | `CLI only` | print what the command would change, and the project revision, without writing | `--if-revision` | `REVISION` | `CLI only` | apply only if the project is still at this revision, as printed by --dry-run | ### `rotari server` manage the background server Subcommand | Description | `status` | show server status | `list` | list servers | `shutdown` | shut down server | Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | server registry directory | ### `rotari web` serve the web status UI Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `--host` | `HOST` | `ROTARI_WEB_HOST` | HTTP listen host (live server only; cannot be combined with --static-dir); with --allow-exec or --allow-terminal, not read from a workspace, basedir, or project config | `--port` | `PORT` | `ROTARI_WEB_PORT` | HTTP listen port (live server only; cannot be combined with --static-dir) | `--detach` | `` | `CLI only` | start the live server in the background, where it outlives the session that started it, and return once it listens, printing its URL, PID, and log; if one already runs on this host for this user, report it instead, or fail if its options differ; stop it with --shutdown; cannot be combined with --static-dir | `--disconnect-action` | `ACTION` | `ROTARI_WEB_DISCONNECT_ACTION` | when the terminal of an attached rotari web closes, or its client gets SIGHUP or SIGTERM or is killed, stop the server or detach it (default stop); Ctrl-D at a terminal always detaches and Ctrl-C always stops; not with --detach (choices: stop, detach) | `--shutdown` | `` | `CLI only` | stop this host's detached server (see --detach): list what runs in its shells and ask first when anything does, send it SIGTERM, and wait for it to stop; takes no other server option | `--yes` | `` | `CLI only` | with --shutdown, stop the server without asking, even when its shells run something | `--static-dir` | `DIR` | `ROTARI_WEB_STATIC_DIR` | generate a static web UI | `--allow-control` | `` | `ROTARI_WEB_ALLOW_CONTROL` | enable job control (copy/change/remove/cancel/clear) in the live server; false makes it read-only; incompatible with --static-dir | `--auth-token` | `TOKEN` | `ROTARI_WEB_AUTH_TOKEN` | require this token in Authorization: Bearer or X-Rotari-Token on the live server; cannot be combined with --static-dir; prefer ROTARI_WEB_AUTH_TOKEN for secrets; with --allow-exec or --allow-terminal, not read from a workspace, basedir, or project config | `--notifications` | `` | `ROTARI_WEB_NOTIFICATIONS` | default state of the browser desktop-notification toggle; pass --notifications=false to default it off | `--static-artifact-contents` | `` | `CLI only` | copy previewable artifact files (up to 10 MiB each, 100 MiB in all) into the static export so previews work there; requires --static-dir | `--artifact-root` | `DIR (repeatable)` | `CLI only` | also serve recorded artifact files under this directory, besides each job's working directory (live server only; may be repeated; cannot be combined with --static-dir) | `--allow-exec` | `` | `ROTARI_WEB_ALLOW_EXEC` | let the Web UI run the commands registered in the global launchers.toml against artifacts; requires job control and a token (generated and printed when none is set); cannot be combined with --static-dir; read only from the command line, the environment, the global config, or --config FILE, not from a workspace, basedir, or project config | `--allow-terminal` | `` | `ROTARI_WEB_ALLOW_TERMINAL` | let the Web UI open a shell on this host, as you, for anyone who can sign in; requires job control and a token (generated and printed when none is set), and a direct localhost connection or HTTPS; cannot be combined with --static-dir; read only from the command line, the environment, the global config, or --config FILE, not from a workspace, basedir, or project config | `--terminal-idle-timeout` | `DURATION` | `ROTARI_WEB_TERMINAL_IDLE_TIMEOUT` | with --allow-terminal, end the shells this long after the last Web page closes: 0, the default, for no limit (shells then last as long as the server), or at least 2m | `--terminal-max-shells` | `COUNT` | `ROTARI_WEB_TERMINAL_MAX_SHELLS` | with --allow-terminal, how many shells may run at once (default 32) | `--terminal-max-shells-per-project` | `COUNT` | `ROTARI_WEB_TERMINAL_MAX_SHELLS_PER_PROJECT` | with --allow-terminal, how many shells of one project, or of one basedir's own pages, may run at once (default 8) | `--terminal-replay-size` | `SIZE` | `ROTARI_WEB_TERMINAL_REPLAY_SIZE` | with --allow-terminal, how much of each shell's recent output to show again after switching tabs or following a link, in bytes, KiB, or MiB, from 1KiB to 64MiB (default 256KiB) | `--terminal-shell` | `PATH` | `ROTARI_WEB_TERMINAL_SHELL` | with --allow-terminal, the shell to run (default: $SHELL, or /bin/sh) | `--terminal-shell-integration` | `` | `ROTARI_WEB_TERMINAL_SHELL_INTEGRATION` | with --allow-terminal, start bash and zsh with rotari's own startup files, which read yours and mark each prompt and command so that the terminal panel shows commands as blocks with their exit codes; your files are not changed, and other shells start as login shells either way (default true; pass --terminal-shell-integration=false to start bash and zsh as plain login shells) | `--allowed-host` | `NAME (repeatable)` | `ROTARI_WEB_ALLOWED_HOST` | with --allow-exec or --allow-terminal, also accept this Host name besides localhost, 127.0.0.1, ::1, and a specific --host (may be repeated); read only from the command line, the environment, the global config, or --config FILE, not from a workspace, basedir, or project config | ### `rotari tableview` view a delimited or JSON Lines table, a Markdown or script file, a PDF, or a directory's files in the Web UI's Table viewer Usage: `rotari tableview PATH` Option | Value | Environment | Description | `--host` | `HOST` | `CLI only` | HTTP listen host | `--port` | `PORT` | `CLI only` | HTTP listen port; without it, the next free port after the default | `--auth-token` | `TOKEN` | `ROTARI_WEB_AUTH_TOKEN` | require this token in Authorization: Bearer or X-Rotari-Token; prefer ROTARI_WEB_AUTH_TOKEN for secrets; cannot be combined with --static-dir | `--static-dir` | `DIR` | `CLI only` | write a static snapshot of the Table viewer for a delimited or JSON Lines file (up to 10,000 rows, with its media files up to 10 MiB each, 100 MiB in all) instead of serving; filters are fixed, and delimited files also keep their separator and header row; cannot be combined with --host, --port, or --auth-token | ### `rotari mcp` serve rotari's tools for agents over MCP on stdio Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `--masterdir` | `DIR` | `ROTARI_MASTERDIR` | master registry directory whose runs and basedirs the tools serve | ### `rotari completion` print shell completion script Subcommand | Description | `bash` | bash completion | `zsh` | zsh completion | `fish` | fish completion | `install` | install completion for the current shell | ### `rotari schema` print the CLI schema as JSON Option | Value | Environment | Description | `--json` | `` | `CLI only` | print the schema as JSON | ### `rotari guide` print a usage guide for coding agents ### `rotari version` print version ### `rotari env` list ROTARI environment variables ### `rotari bug-report` collect evidence for a rotari bug report, with secrets removed Option | Value | Environment | Description | `--config` | `FILE` | `CLI only` | config file to use | `-b` / `--basedir` | `DIR` | `ROTARI_BASEDIR` | state directory | `-p` / `--project-name` | `NAME` | `ROTARI_PROJECT_NAME` | project name | `-r` / `--run-id` | `ID` | `ROTARI_RUN_ID` | run to collect (default: the latest run; an attempt ID given with --job-id also names its run) | `-j` / `--job-id` | `ID (repeatable)` | `ROTARI_JOB_ID` | job or attempt to collect (default: the run's jobs that did not succeed); may be repeated | `--output` | `FILE` | `CLI only` | write a .tar.gz bundle to FILE instead of printing the Markdown summary | `--full-output` | `` | `CLI only` | include whole job output files, up to 64 MiB each, instead of their last 64 KiB | `--no-output` | `` | `CLI only` | include no job output | `--no-redact` | `` | `CLI only` | keep paths and hostnames; secrets are removed regardless | --- ## Concepts Source: https://rotari-dev.github.io/rotari/docs/CONCEPTS/ # Concepts Projects, queues, runs, IDs, dependencies, and how rotari resolves the state directory and project. ## Projects, queues, runs, and state ### Project and queue A project has one mutable queue of jobs ready to run and an immutable history of completed runs. The live queue is `queue.json`. A run takes the queue when it starts: its jobs move into `runs//commands.json`, and the queue is left empty, keeping its default executor settings. Retries and filtered reruns start new runs, so earlier history stays unchanged. The queue therefore always holds the next run's jobs, never the jobs of a run that has started: - While the project is `idle`, the queue is the current work target and the default place to add or edit jobs. - While a project is `running`, the run is the primary user-facing target, and `add`, `copy`, `change`, `remove`, `import`, and `reset` prepare the next run in the queue. `reset` clears only that queue; it does not affect the active run. - While a project is `interrupted`, the run remains the primary recovery target, and the queue can still be edited or reset independently. After previewing `unlock --dry-run`, recover only after confirming unknown work stopped; verified active execution blocks recovery. Unknown evidence needs explicit `--assume-stopped`. Failed and unfinished jobs are rerun from the run with `rotari retry --run-id RUN_ID`. ``` /projects// ├── queue.json # current queue ├── meta.json # latest project phase and run metadata ├── running.lock # while a run is active: run ID, PID, host, and PID namespace └── runs/ └── / # immutable run history ├── commands.json # command snapshot ├── context.json # execution context and config snapshot paths ├── sources.json # git or jj revision the executed jobs ran from ├── notes.jsonl # notes on the run and its jobs, appended only ├── heartbeat.json # rewritten every 30 s by the run's coordinator while it is active ├── cancels.jsonl # each cancel request: who asked, which jobs, what happened, appended only ├── stale_lock_removed.json # which command removed the lock of a run whose coordinator looked dead ├── summary.json # run result └── / └── attempts// ├── command.json ├── output # merged log by default; stdout/stderr when separate ├── stdout # separate-mode standard output ├── stderr # separate-mode standard error ├── status.json └── ... # executor-specific state ``` Files may appear incrementally while a run is active. When reading state directly, treat a missing optional file as an incomplete result, not as a success. ### Run and state Each run records its own command snapshot, success/failure status, logs, and metadata. The run empties the queue when it starts, and when it finishes, the runner updates the project state and leaves the completed run immutable, except for notes that `rotari note` appends, which makes retry loops and inspection easy to reason about without losing the earlier outcome. ``` flowchart LR add([rotari add]) --> queue[(queue.json)] queue --> run([rotari run]) run --> history[(runs/run-id/
commands, logs, results)] run --> empty[(queue.json: empty)] empty -. next run .-> add classDef command fill:#e0e7ff,stroke:#4f46e5,color:#1e1b4b class add,run command ``` Each added command has a stable job ID. Use `add --job-name NAME` to give a job a readable label, and `run --run-name NAME` (or `ROTARI_RUN_NAME`) to label a run; the generated IDs remain available for unambiguous commands and paths. `run` saves the complete command snapshot under `runs//`, together with a summary and each attempt's configured log. By default stdout and stderr are merged into `output`; `add --log-mode separate` stores them as `stdout` and `stderr`. Repeated `--output FILE` and `--error FILE` add external destinations without changing the internal log mode. If `--error` is omitted, stderr follows the `--output` destinations too. Missing parent directories are created on the execution host before the command starts; `--open-mode truncate` truncates destinations once, while append is the default. After it finishes, the queue is emptied, while the run can be inspected or used with selections such as `rotari retry`. The next `add` starts a new batch while keeping the previous run history. Use `delete` to remove saved run logs explicitly. Use `run --async` when an experiment should continue after the terminal returns. ### Reusing results across runs There are two ways to associate new-run jobs with earlier results: explicit carry-forward, using a saved run or `copy` to retain the source run/job/attempt, and fingerprint matching, comparing recorded command inputs when you add the jobs again with new IDs. Both then use the same result selection: `retry` reruns failed and unfinished jobs and carries successes forward; an unfiltered `run` executes all queued jobs. A fingerprint describes the command, explicit job environment and working directory, matrix values, and array task number. It is not a hash of scripts, data, inherited environment, or source revision, and it is not an artifact cache or file freshness check. See Rerunning a job-generating script (https://rotari-dev.github.io/rotari/docs/RECOVERING/#rerunning-a-job-generating-script) before relying on automatic matching. ### Workflow and execution environment A queue, a run's command snapshot, and an exported workflow describe the command layer only: each job's command, its own `--env` and `--working-directory`, and scheduling settings such as dependencies, timeouts, and retries. The working directory and environment a job otherwise sees come from the shell that runs `rotari run` or `rotari retry`, at the time it runs, as with any command started from that shell: ``` cd ~/exp-a && rotari run # jobs start in ~/exp-a with this shell's environment cd ~/exp-b && rotari retry # jobs start in ~/exp-b with this shell's environment ``` So the same queue or workflow can be run again from another directory, or after activating another environment, without editing it. Pin a job to a directory or variable with `add --working-directory` or `add --env` when it must not depend on where it is run from. `run` and `retry` default to `--env=ALL`; use `--env=NONE` to omit ordinary caller variables for a run. Job `--env` values still apply in either mode, and `PWD` always reflects the effective job working directory. `ALL` may propagate secrets to remote executors and scheduler records, so it is not secret management. This holds whatever else is running: every run has its own supervisor process, started by `run` or `retry` as its child, so one run never takes the directory or environment of another. The run records its caller's directory in `context.json`, and jobs see it as `ROTARI_CWD`; the caller's environment is not recorded in that context file. ### IDs and location resolution Rotari uses three different IDs: ID | Meaning | `run-id` | One execution of a project queue. It identifies the run snapshot, summary, and history. | `job-id` | A logical job in a queue or run. For an array, expanded task IDs look like `job-id-1`, `job-id-2`, and so on. | `attempt-id` | One concrete execution of one logical job, including a retry. It identifies the attempt output and status. | The `run-id` identifies a run and provides its project location. An `attempt-id` identifies one job execution and provides its `job-id` and `run-id`, so the command can resolve the same project location from the attempt alone. A run ID begins with the UTC second the run started, as in `20261112-030405-1a2b3c4d`. The latest run of a project, which commands use when you give no run, is the one the project last started. When that run has been deleted, it is the run that started last; runs begun in the same second are ordered by when they actually started. `latest` is the newest such run that has finished. The commands and the Web UI use this one order, whatever the runs' names or file times. `show` accepts a `RUN_ID`, `ATTEMPT_ID`, `JOB_ID`, or job name as its optional positional argument. The associated run, project, and basedir are resolved automatically when the selector identifies them. Selector | Information available for resolution | Options that can be omitted | `show RUN_ID` | `run-id`, `basedir`, and `project` | `--basedir/-b`, `--project-name/-p` | `show ATTEMPT_ID` | `attempt-id`, `job-id`, `run-id`, `basedir`, and `project` | `--basedir/-b`, `--project-name/-p`, `--run-id/-r` | `show JOB_ID` / `show JOB_NAME` | matching job in the relevant latest run or queue | `--job-id/-j`, `--job-name` | When a selector matches more than one project, run, or job, `show` reports an ambiguous-selector error instead of choosing silently. Use explicit options to disambiguate. The option forms remain available when composing commands or when an exact run/job context is required: ``` # These are equivalent exact selectors rotari show -b BASE_DIR -p PROJECT_NAME -r RUN_ID rotari show -r RUN_ID rotari show RUN_ID # ID can be passed positionally; -r can be omitted rotari show -b BASE_DIR -p PROJECT_NAME -r RUN_ID -j ATTEMPT_ID rotari show -j ATTEMPT_ID rotari show ATTEMPT_ID ``` The following commands accept an `ATTEMPT_ID` as their `--job-id/-j` selector: - `ATTEMPT_ID` supported: `show`, `cancel`, `suspend`, `resume`, `copy`, `run`, `retry`. - `ATTEMPT_ID` not supported: `add`, `change`, `remove`, `delete`, `wait`. These commands operate on queue definitions or whole runs, not individual attempts. `ATTEMPT_ID` and `RUN_ID` include the run and job context needed for resolution. `JOB_ID` does not, so the following `JOB_ID` forms are equivalent only when no other searched run or queue contains the same job ID. ``` rotari show -b BASE_DIR -p PROJECT_NAME -r RUN_ID -j JOB_ID rotari show -j JOB_ID rotari copy -b BASE_DIR -p PROJECT_NAME -r RUN_ID -j JOB_ID rotari copy -r RUN_ID -j JOB_ID ``` Projects, run IDs, and job IDs can also be passed positionally when a command accepts one. A positional argument means the same thing whatever options are given, and options may follow it, except in `add` and `change`: ``` rotari show PROJECT_NAME rotari show JOB_ID rotari copy -j JOB_ID RUN_ID rotari remove JOB_ID OTHER_JOB_ID rotari delete RUN_ID rotari unlock PROJECT_NAME --run-id RUN_ID rotari cancel JOB_ID OTHER_JOB_ID rotari cancel RUN_ID rotari suspend ATTEMPT_ID rotari resume ATTEMPT_ID rotari export RUN_ID_OR_PROJECT [OUTPUT_FILE] rotari import FILE PROJECT ``` These positional forms cannot be combined with the corresponding `--run-id/-r` or `--job-id/-j` option. For export, `TARGET` names a project or run; use `--project-name/-p` when explicitly combining a project and a run. `delete` without an ID still removes all saved runs. For `cancel`, `suspend`, and `resume`, a positional `JOB_ID` or `ATTEMPT_ID` selects jobs the same way `--job-id/-j` does; a bare `RUN_ID` only locates the target run through the run registry and is not itself a job selector, so it behaves like omitting `--job-id/-j` (all running jobs in that run). The run must be the project's active run: a finished run's ID is an error rather than acting on whatever run is active now. An array job's ID selects its running tasks, and without `--project-name/-p` a `JOB_ID` is looked for in the active run of every project. Without `--basedir/-b`, the read-only commands `show`, `wait`, `export`, `lineage`, `info`, and `check` search the basedir selected by options or defaults first. If they do not find the requested project or selector there, they also search the default and registered basedirs (see `rotari basedirs`). If multiple targets match in that fallback search, the error lists the candidates; pass `--basedir` to limit the search. Commands that run or change jobs, such as `run`, `copy`, `change`, and `cancel`, use only the state directory they resolve. With `-p`, a job selector stays within the named project; a project default from the environment or config is only preferred, so a missed job selector falls back across projects. ## Dependencies and stages Jobs can depend on other jobs or on a stage: a dependent job waits until its prerequisites succeed, or, with `--depends-on-finished`, until they finish regardless of result. Stages group jobs that may run concurrently and provide a convenient dependency barrier. See Dependencies and stages (https://rotari-dev.github.io/rotari/docs/RUNNING/#dependencies-and-stages) for usage and selection options. ## State and project resolution Rotari resolves the state directory before it resolves the project name. The first matching state-directory entry wins: The resolution order for the state directory is: 1. `--basedir/-b` option 2. `ROTARI_BASEDIR` environment variable 3. Cwd `.rotari.toml` `basedir`, then global config `basedir` 4. `./.rotari-state` (if it exists in the current directory) 5. Default location (`$XDG_STATE_HOME/rotari` or `~/.local/state/rotari`) The resolution logic for the project name when `--project-name/-p` is omitted is: 1. `--project-name/-p` option 2. `ROTARI_PROJECT_NAME` environment variable 3. Selected basedir, cwd workspace, then global config `project-name` 4. Automatically select if exactly one project exists in the state directory 5. Default project name (`default`) if no projects exist yet (if multiple projects exist, an error will prompt you to specify one) `rotari init [BASEDIR [PROJECT]]` writes cwd workspace defaults without creating state. Workspace discovery never searches parents. Normal config values merge global → workspace → basedir → project; location keys are restricted to avoid cycles. See Configuration (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#configuration-files). When a basedir that you name with `--basedir`, `ROTARI_BASEDIR`, or a config `basedir` does not exist, commands that only read state, such as `check`, `show`, `jobs`, and `projects`, warn that it does not exist and say where it came from, so a mistyped path does not look like an empty basedir. They otherwise treat it as empty, since a basedir exists only after its first run; commands that write state, such as `add`, create it. The default location reads as empty before your first run, without a warning. Commands that list every registered basedir warn about one whose directory was removed and list the rest; `rotari gc` removes it from the registry, and the Web UI marks it missing until then. These rules apply consistently to commands that do not identify an existing run through its run registry. Use `--basedir/-b` and `--project-name/-p` when a command must target a specific location explicitly. ## Internal execution model How `run` executes jobs through a per-run supervisor is described in Code architecture (https://rotari-dev.github.io/rotari/docs/ARCHITECTURE/#processes). --- ## Configuration Source: https://rotari-dev.github.io/rotari/docs/CONFIGURATION/ # Configuration Config files, environment variables, run completion webhooks, and shell completion. ## Configuration files Run the following command to choose a config file location interactively and generate a template. The available options and their descriptions are shown there. ``` rotari config ``` Use `rotari config --list` to list every existing config file—including `notifications.toml`—found in the global and basedir locations, cwd workspace `.rotari.toml`, plus every project below the basedir. It groups common files under `Common:` and project-specific files under `Projects:`, with each project name followed by indented paths. This is an inventory, including files in unselected projects. Supplying `--project-name` limits the project-specific entries to that project. ``` rotari config --list --basedir DIR ``` The resolution order is: ``` CLI option (e.g., --retry) environment variable (e.g., ROTARI_RUN_RETRY) configuration value (from merged files) built-in default ``` Commands that load configuration accept `--config FILE` to use a specific YAML, TOML, or JSON file instead of looking in the project, basedir, workspace, and global locations. Both `--config FILE` and `--config=FILE` are supported. An explicitly selected file must exist and parse successfully; `--config` itself cannot be set by an environment variable or another config file. This value precedence applies across commands; see the CLI contract (https://github.com/rotari-dev/rotari/blob/main/contracts/03-server-and-command-interfaces.md#cli-presentation). A value that an option cannot use is an error, not a reason to fall back to the default. For example, `retry = 1.5`, `quiet = "maybe"`, or `ROTARI_RUN_RETRY=lots` stops the command with a message naming the option, the value, and the variable or config file it came from: ``` invalid retry 1.5 in global config /home/me/.config/rotari/config.toml: want a whole number ``` This applies even when the command line gives the option, so a wrong setting does not stay unnoticed. A command reports only the options it has: a root `retry` value is checked by `run` and `retry`, not by `show`. An empty environment variable, such as `ROTARI_RUN_RETRY=`, leaves an option with a boolean, number, duration, or fixed set of choices unset. `--help` still works and lists each problem as a warning. Command help remains available if the selected configuration file is missing or malformed: for example, `rotari run --config missing.toml --help` prints a warning on stderr and help on stdout, exiting successfully. In that case, help uses built-in and environment defaults rather than configuration values. When the file loads successfully, help still shows the configured defaults. Normal execution continues to fail on configuration errors; `--help` used as an option value or inside an `add`/`change` job command is not a help request. Without `--config`, ordinary configuration merges global → workspace → basedir → project. Global, basedir, and project directories accept one of `config.yaml`, `config.toml`, or `config.json`; multiple formats in one scope are an error. Workspace configuration is only `.rotari.toml` in the current working directory: parent directories are never searched. Malformed or unreadable discovered files fail with their scope and path. Maps merge recursively; higher-scope scalars and arrays replace lower ones. `null` is unspecified and retains the lower value; `false`, `0`, and `""` are explicit values. After merging, a command section (such as `[run]`) overrides the root key, even when that section originated in a lower scope. CLI and environment overrides still win. Output paths such as `export --output` are command-line-only. A few `rotari web` options are read only from the global config and a file named with `--config`, besides the command line and the environment: `allow-terminal`, `allow-exec`, and `allowed-host`, and `host` and `auth-token` when the terminal or launchers are on. A workspace, basedir, or project config's value for them is ignored with a warning; see Setting them in a config or the environment (https://rotari-dev.github.io/rotari/docs/WEB/#setting-them-in-a-config-or-the-environment). ### Workspace defaults and initialization Use `rotari init` when you want one experiment working directory paired with its own job and log storage. Run it once in that directory to record the basedir and default project. Subsequent commands from the same directory automatically load those defaults: `add` and `run` use that storage, and `show` inspects the same experiment without repeating `--basedir` and `--project-name`. This is why `init` exists separately from `config`: `rotari config` generates a template for general configuration, while `rotari init` fills in the two location defaults that associate a working directory with its experiment history. They use the same configuration mechanism, not separate kinds of workspace. Run `rotari init [BASEDIR [PROJECT]]` from the experiment directory: ``` mkdir experiment-a cd experiment-a rotari init .rotari-state sweep rotari add python train.py --lr 0.1 rotari run rotari show # Limit the cross-workspace job listing to this experiment's storage. rotari jobs --basedir .rotari-state ``` It creates `.rotari.toml` with `basedir` and `project-name` filled in; other settings remain commented out, as in the template from `rotari config`: ``` basedir = ".rotari-state" project-name = "sweep" ``` Both arguments are optional: `BASEDIR` defaults to `.rotari-state` and `PROJECT` to `default`. The basedir must be a relative path; the project must be a single safe name (not `.` or `..`, and containing no `/` or `\\`). With the example above, job definitions, run history, and captured stdout and stderr logs live under `experiment-a/.rotari-state`. Initializing another experiment directory the same way gives it separate storage, even if it uses the same project name. `init` writes only the configuration file; state is created when needed by commands such as `add`. It refuses to overwrite an existing `.rotari.toml`; edit that file to change the defaults. The association applies only when invoking rotari from that directory, not its subdirectories. CLI options and environment variables can override it. It does not change the working directory in which jobs execute; see Workflow and execution environment (https://rotari-dev.github.io/rotari/docs/CONCEPTS/#workflow-and-execution-environment). ### Project defaults and listings The location defaults created by `rotari init` select the preferred storage and project for single-project commands such as `add` and `run`. Read-only commands such as `show` try that location first, then search other known basedirs if the requested target is not found. Multiple matches in the fallback search are reported as ambiguous; use `--basedir` to limit the search. The defaults do not narrow the cross-workspace listings `projects`, `runs`, and `jobs`: those commands still scan all known basedirs unless you explicitly select one. Use `--basedir .rotari-state` to inspect only the storage below the current experiment directory, and a command's project filter to narrow it further. For command examples, see Inspecting runs and jobs (https://rotari-dev.github.io/rotari/docs/INSPECT/). ### Inspecting and recording configuration `rotari show` lists the contributing source paths and scopes. The current Web `View config` lists actual source files by scope/path; select one if several exist, or open the single file directly. It never presents a merged current viewer/editor. Saves affect only the selected, validated source. Workspace context is the Web server's startup cwd, not a viewed job's working directory. Live and static views use the same source-selection UI; static writes remain disabled. On a run page, Settings still edits the current settings of its project, just as on the project page, including configuration generation and notification settings. These changes apply to future runs, not the saved run. Use View config snapshot in the run action toolbar, next to Cancel run (while running) and Delete run, to inspect the configuration saved with that run. It shows both ordinary and notification config as read-only text, and is disabled when no snapshot was recorded. Every run saves one canonical merged file configuration as `configs/config.toml`, from values captured by the client. It excludes CLI options, environment overrides, and built-in defaults, and does not reread sources when the supervisor starts. Source paths/scopes are recorded separately in `context.json`, independently of the snapshot file list. View config snapshot reads the saved copy, including older YAML/JSON snapshots. A retry is a new invocation using its current configuration, not the old run's. ## Environment variables The same environment can be used to configure the CLI and to inspect the currently running job. Variables with a matching CLI option are read as that option's default; an explicit command-line option always takes precedence. Job variables are injected into command processes and can also be passed explicitly to another rotari command. Each command's `--help` output identifies an option's matching environment variable, when one is available. For the per-executor options, such as `--slurm-concurrency`, it writes the variable once as `ROTARI_RUN__CONCURRENCY`, where `` is the executor in upper case, such as `SLURM`. To mark the runs a code agent starts, set `ROTARI_ACTOR` to a label in the agent's own environment, for example `"env": {"ROTARI_ACTOR": "claude-code"}` in Claude Code's settings, or in the shell profile it starts with. `run` and `retry` record it as the run's actor (`--actor LABEL` overrides it for one run), and `rotari mcp` records it for the runs it starts. `show`, `lineage`, `runs --json`, the MCP run summary, the Web run page, and the Activity page show it; the Activity page can narrow to one actor. rotari never guesses an actor: a run without one is unlabelled. See the environment variable reference (https://rotari-dev.github.io/rotari/docs/ENVIRONMENT_VARIABLES/) for the complete definitions and meanings. Use `rotari env` to print the same list with values from the current process. ## Notifications Webhook and browser notifications are configured in `notifications.toml`, which is separate from the command defaults above. Rotari uses the first one it finds in the project, the basedir, then the global config directory, without merging scopes. Unlike ordinary command configuration, it has no workspace scope and does not inherit lower-file settings. A project notification file replaces the global file entirely: an omitted webhook URL does not inherit a global destination; omitted fields use notification built-in defaults. Notification snapshots remain separate files and are included in the run's read-only View config snapshot view. The simplest way to edit it is Settings → Notification config in `rotari web`, which edits the file in effect as a form and can create one when none exists. From the command line, generate one with: ``` rotari config --notifications ``` `ROTARI_WEBHOOK_URL` overrides `webhook.url` so the endpoint can stay out of the file. For the event settings, fields, and Slack/Teams/Discord setup, see Notifications (https://rotari-dev.github.io/rotari/docs/NOTIFICATIONS/). ## Launcher commands `rotari web --allow-exec` can run the built-in services (TensorBoard, Jupyter Lab, MLflow, Aim, Streamlit, Datasette, marimo, Panel, Gradio, and VS Code for the Web; see Built-in services (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#built-in-services)) and the commands `launchers.toml` registers, against a job's artifacts from the Web UI (see Launching commands (https://rotari-dev.github.io/rotari/docs/WEB/#launching-commands)). An entry in the file with a built-in's name replaces it, for example to run TensorBoard from a particular environment. Rotari reads it only from the global config directory (`$XDG_CONFIG_HOME/rotari/launchers.toml`, by default `~/.config/rotari/launchers.toml`), never from a workspace, basedir, or project, and only when `rotari web --allow-exec` starts; edits take effect after a restart. Generate a commented template with: ``` rotari config --launchers ``` The Web UI's Settings menu does the same with Generate launcher config. Launcher config shows the file, why `rotari web --allow-exec` would refuse it, and the commands a restart would load, including whether each one's program is installed. With `--allow-control`, the same view can edit and save an existing trusted file; the Web UI validates the TOML and asks you to restart `rotari web --allow-exec` before changes take effect. Saving is disabled on a read-only server. A run's launcher config is still this server-wide file, not part of the run's config snapshot. The generated file has mode `0600` in a `0700` directory. Rotari refuses the file, and `rotari web --allow-exec` does not start, unless no other user can change it: the file and every directory above it, following symlinks, must be owned by you or root and not writable by group or others (a sticky directory such as `/tmp` is allowed). The error names the offending path and the `chmod` that fixes it. A missing file only means that only the built-in services are available; any unknown key, duplicate name, or setting that does not apply to an entry's mode is an error. `rotari config --list` shows the file when it exists. A command whose first program cannot be found on the Web server's `PATH` (or whose absolute path is not executable) is shown disabled in the Web UI with that reason, and does not start; this is checked whenever the list is shown, so installing the program needs no restart. Only the first program is checked: for `conda run -n ENV tensorboard ...` that is `conda`, not the environment's TensorBoard. A first word that is a shell builtin, an expansion, or a relative or `~` path is not checked. Each `[[launcher]]` entry registers one command: ``` [[launcher]] name = "Line count" # the button's label; unique command = 'wc -l "$ROTARI_LAUNCHER_ARTIFACT"' targets = ["file"] # "file", "directory", or both mode = "command" # "command" runs and exits; "service" serves HTTP cwd = "target" # "target" (default), "parent", or an absolute directory stop_grace = "5s" # SIGTERM to SIGKILL on Stop (default 5s) ``` `command` is shell source run with `/bin/sh -c` (not Bash and not a login shell) with empty standard input, in the Web server's environment, as the user running `rotari web`. Rotari never inserts paths into the command text; it sets these variables, which the command should quote: Variable | Value | `ROTARI_LAUNCHER_ARTIFACT` | absolute path of the selected file or directory | `ROTARI_LAUNCHER_CWD` | the working directory chosen by `cwd` | `ROTARI_LAUNCHER_PORT` | service mode: the port to listen on | `ROTARI_LAUNCHER_BASE_PATH` | service mode: the URL path prefix to serve under | `ROTARI_LAUNCHER_TOKEN` | service mode: a secret made for this launch (see Tokens for services (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#tokens-for-services)) | `ROTARI_LAUNCHER_TOKEN_FILE` | service mode: a file holding that secret, private to you and removed when the launch ends (see Tokens for services (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#tokens-for-services)) | `ROTARI_LAUNCHER_JUPYTER_CONFIG` | service mode: a Jupyter config file that makes that secret the login token (see Tokens for services (https://rotari-dev.github.io/rotari/docs/CONFIGURATION/#tokens-for-services)) | `cwd = "target"` is the selected directory, or a selected file's directory. Launched commands also get `127.0.0.1,localhost,::1` added to `NO_PROXY` and `no_proxy`, so loopback traffic never goes through an HTTP proxy, and do not receive `ROTARI_WEB_AUTH_TOKEN`. To use a tool from a particular environment, say so in the command, for example `conda run --no-capture-output -n ENV tensorboard ...`. ### Services `mode = "service"` registers a command that serves HTTP, such as the built-in TensorBoard command below. The Web UI opens it through the `rotari web` port itself, under `/_launch/ID/`, so no further SSH port forward is needed: ``` [[launcher]] name = "TensorBoard" command = '''tensorboard --logdir "$ROTARI_LAUNCHER_ARTIFACT" --host 127.0.0.1 --port "$ROTARI_LAUNCHER_PORT" --path_prefix "$ROTARI_LAUNCHER_BASE_PATH"''' targets = ["directory"] mode = "service" ready_path = "/" # under the base path; answers 2xx or 3xx when ready (default "/") ready_timeout = "60s" # default 60s ``` The service must listen on exactly `127.0.0.1:$ROTARI_LAUNCHER_PORT`, not `0.0.0.0`, and serve everything under `$ROTARI_LAUNCHER_BASE_PATH`, which is how requests arrive; rotari does not rewrite paths or pages, so a program that cannot serve under a path prefix does not work. Requests carry `X-Forwarded-Host` and `X-Forwarded-Proto` with the address the browser used, for a program that builds absolute URLs. Rotari picks the port. It counts the service as ready only when the process listening on the port belongs to the launch and `ready_path` answers, so another program that took the port first is never shown; that, a bind to another address, or no answer within `ready_timeout` fails the launch and stops it, with the reason and the service's output. A service that exits without ever listening, as when another process took its port, is restarted once on a new port. #### Built-in services These are registered without an entry in `launchers.toml`; each is shown disabled while its program is not on the Web server's `PATH`, and an entry with the same name replaces it: Name | Offered for | Notes | TensorBoard | directories | `tensorboard --logdir` on the directory | Jupyter Lab | directories | rooted at the directory; requires the launch token (below) | MLflow | directories named `mlruns` | file-store tracking data (`MLFLOW_ALLOW_FILE_STORE=true` is set for it) | MLflow (SQLite) | files named `mlflow.db` | `sqlite:///` tracking database | Aim | directories | an Aim repository (`aim init`); Aim refuses other directories | Streamlit | `*.py` files | runs the app | Datasette | `*.db`, `*.sqlite`, and `*.sqlite3` files | browses and queries a SQLite file, read-only | marimo | `*.py`, `*.md`, `*.markdown`, and `*.qmd` files, and directories | opens the notebook, other Markdown as a new one (which changes the file only when saved from marimo), or a directory's list of notebooks; requires the launch token (below) | Panel | `*.py` files | runs the app | Gradio | `*.py` files | runs the app; one that sets its own address or port in `launch()` does not work | VS Code for the Web | directories | opens the folder in the browser; needs the `code-cli` program (below) and requires the launch token | MLflow is limited to those names because it creates its default experiment, or its tables, in whatever it opens. Each was checked through the proxy, including Jupyter's kernel and Streamlit's and marimo's WebSocket connections: TensorBoard 2.21, JupyterLab 4, MLflow 3.17, Aim 3, Streamlit 1.65, Datasette 0.65, marimo 0.25, Panel 1.9, Gradio 6.31, and VS Code for the Web 1.145. VS Code for the Web needs the standalone VS Code CLI on `PATH` under the name `code-cli`. The `code` in a Remote SSH terminal is a different program without `serve-web`, and it comes first on `PATH` there, so the built-in does not use that name. On x86-64 Linux, with `~/.local/bin` on `PATH` (for other systems, see the download page (https://code.visualstudio.com/Download)): ``` curl -fL -o vscode_cli.tar.gz 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' tar -xzf vscode_cli.tar.gz install -m 755 code ~/.local/bin/code-cli ``` Installing it under that name accepts the VS Code Server license terms (https://aka.ms/vscode-server-license): the built-in passes `--accept-server-license-terms`. They limit hosting or sharing the software for others to use, so check them before you let other people sign in to a server that offers it. The first launch downloads the Web server, about 700 MB; reload the page until the editor opens. VS Code for the Web can run commands as you, like Jupyter Lab. Up to v0.1.32 this built-in was named VS Code. An entry of that name in `launchers.toml` no longer replaces it and is listed beside it; rename the entry to `VS Code for the Web` to replace it. #### Tokens for services A service listens on a loopback port that other users of the same host can connect to directly, without rotari's token. Each service launch therefore gets a secret, `ROTARI_LAUNCHER_TOKEN`, and `proxy_headers` makes rotari's proxy present it on every request, so a service that requires it serves only through the proxy. The built-in Jupyter Lab, which runs code, uses it: ``` [[launcher]] name = "Jupyter Lab" command = '''jupyter lab --no-browser --ip=127.0.0.1 --port="$ROTARI_LAUNCHER_PORT" --ServerApp.base_url="$ROTARI_LAUNCHER_BASE_PATH" --config="$ROTARI_LAUNCHER_JUPYTER_CONFIG" --ServerApp.root_dir="$ROTARI_LAUNCHER_ARTIFACT" --ServerApp.allow_remote_access=True --ServerApp.allow_origin='*'''' targets = ["directory"] mode = "service" ready_path = "/api" proxy_headers = { Authorization = "token $ROTARI_LAUNCHER_TOKEN" } ``` Other users of the host can read a process's arguments, so no built-in passes the token in one. `$ROTARI_LAUNCHER_JUPYTER_CONFIG` is a file, private to you and holding no secret, that reads your `jupyter_server_config.py` files and then sets the token from the environment, so a `token = ''` of yours cannot turn authentication off. Setting `JUPYTER_TOKEN` alone would let it. A service that takes the token as an HTTP Basic password uses `$ROTARI_LAUNCHER_BASIC_AUTH`, which `proxy_headers` replaces with the Base64 of `rotari:` and the token; it is not in the command's environment. The built-in marimo does (`-q` keeps the sign-in URL out of the launch's output, and the token goes through standard input because other users of the host can read a process's arguments): ``` [[launcher]] name = "marimo" command = '''marimo -q edit "$ROTARI_LAUNCHER_ARTIFACT" --headless --skip-update-check --host 127.0.0.1 --port "$ROTARI_LAUNCHER_PORT" --base-url "$ROTARI_LAUNCHER_BASE_PATH" --token --token-password-file - <_