indra CLI
Nodes and orchestration
Run agents on this machine and over SSH, and chain them into workflows.
Agents can run on this machine and on other machines. A node is one such machine; local is
always there. The easy way to add one is joining: one command
on that machine, no SSH. Machines you already reach over SSH can be listed instead:
[local]
max_parallel = 4 # agents at once on this machine
[[node]]
name = "build-box"
ssh = "ci@build-box.internal" # host, user@host, or a Host alias from ~/.ssh/config
max_parallel = 2
targets = ["/srv/api", "/srv/web"] # codebases on that machine
Each remote node needs indra on its PATH (or set indra = "/path/to/indra"), and
ssh <destination> must work without a password prompt (keys or an agent). Then:
$ indra nodes
local ok laptop (macos aarch64, 10 cpus, indra 0.1.0, max 4 agents) runners: claude
build-box ok ci-7 (linux x86_64, 16 cpus, indra 0.1.0, max 2 agents) runners: claude, codex
gpu-box DOWN me@gpu-box ssh: Could not resolve hostname gpu-box: Name or service not known
In the console, Machines shows each machine, its runners, its capacity and the review runs on
its disk (over SSH, or over the link for a machine that dials in). Click a remote run to copy its
text files to the hub (<data dir>/fetched/<node>/<run>) and open it like a local one: findings,
triage, comparison, memory, publish and post work on the copy, and changes stay in the copy.
Run an agent can start an agent on any node. A remote agent streams into the same
live view as a local one, with its subagents and tool calls, and Stop stops it on the remote.
Machines that dial in (no SSH)
A machine can join the hub instead of being reached over SSH. On the Machines page, click Add a machine and paste the command it shows on that machine. Nothing else to fill in:
# Linux or macOS: installs indra if needed, then joins
curl -fsSL https://raw.githubusercontent.com/dmdhrumilmistry/indra/main/install.sh | INDRA_JOIN="http://192.168.1.20:7878 ABCDE-FGHJK" sh
# Windows (PowerShell)
$env:INDRA_JOIN="http://192.168.1.20:7878 ABCDE-FGHJK"; irm https://raw.githubusercontent.com/dmdhrumilmistry/indra/main/install.ps1 | iex
# indra already installed
indra join http://192.168.1.20:7878 ABCDE-FGHJK # optional: --name build-box --target /srv/api
indra join names the machine after its host name (taking name-2 if that is in use), reports
its system, CPUs and installed agents, lets agents work in the folder it ran in, and keeps the
link running in the background, started again at log-in or boot (a systemd user service on Linux,
a launchd agent on macOS, a sign-in entry on Windows; --foreground stays in the terminal). The
console shows the machine as soon as it joins. The folders agents work in are changed on its card
(Change, with a folder browser that walks the machine's folders over its link); they need
not be where indra is installed. On the machine, indra node status says which hub
it joined and how its link runs, indra node folders lists or changes the folders agents may use,
and indra node leave undoes it all. Remove on its card in the console disconnects it and
deletes its key. The step-by-step guide, with troubleshooting, is
Adding machines.
Many machines at once: Add many machines makes an enrollment key (valid up to a year, an
optional machine limit, revocable; the hub keeps only its SHA-256) with ready-made scripts for
Jamf, Intune and Linux. Organization-wide settings come from defaults.toml (under the user's) and
managed.toml (enforced) in /Library/Application Support/indra, /etc/indra or
C:\ProgramData\indra; a [join] section there lets indra join run with no arguments. See
Rolling out with MDM.
Joining works when the console listens on the network (--bind 0.0.0.0:7878) even though its
settings are then locked against browser edits: a joining machine adds only its name to
indra.toml, never a command. A console started with --read-only or --lock-config refuses
joins.
- Outbound only. The node opens a WebSocket to the hub (
/agent/connect); it needs no open port and no SSH account. The hub needs to be reachable by the node: bind it with--bind(and--allow-remote-configif you also want to edit settings remotely), ideally behind a TLS reverse proxy so the node useshttps:///wss://. - Enrolment. The code works once, for an hour, and only an admin can make one. The node then gets its own random key,
stored in the hub's encrypted secret store (never given to agents) and in an owner-only
agent.jsonin the node's config folder. Direct when possible. The WebSocket carries signaling; hub and node then open a WebRTC data channel (DTLS-encrypted) and job traffic moves onto it. On the same network that needs nothing; across NATs add STUN servers (
[server] ice_servers = ["stun:stun.example.org:3478"], or Settings > General) and TURN servers with their credentials:[[server.ice]] urls = ["turn:turn.example.org:3478", "turns:turn.example.org:5349"] username = "indra" credential = "secret:turn" # resolved on the hub, sent to nodes over their linkWhen there is no direct path, traffic is relayed over the WebSocket.
[server] webrtc = false, orindra join --no-webrtc, keeps everything on the relay. The Machines page shows which path each node uses.- Reconnects on its own. Heartbeats every 5 s; a link silent for 15 s is dead. The node retries with exponential backoff and jitter (1 s up to 60 s). Jobs keep running through a drop: their output is numbered, the node keeps what the hub has not acknowledged and sends it again, and the hub drops duplicates, so each line arrives once, in order.
- No orphans. The hub fails a node's jobs if it stays away for 2 minutes; the node stops its jobs if the hub is gone for 10 minutes, or comes back as a different hub process.
- SSH stays as the fallback. A
[[node]]with ansshdestination is used over SSH whenever it has no live link.
The node runs only runners from its own configuration, in directories that exist on it, exactly
as with SSH. Builds without the webrtc feature (cargo install --no-default-features) relay
everything over the WebSocket.
Workflows
A workflow is a graph of agent tasks, each on a node, run in dependency order:
[[workflow]]
name = "nightly"
description = "Review the services on the build box and the web app here, then summarise."
[[workflow.task]]
id = "api"
node = "build-box"
target = "/srv/api"
prompt = "/indra full security review of {target}"
retries = 1 # one more attempt if it fails
[[workflow.task]]
id = "web"
node = "local" # the default
target = "../web" # local targets are relative to indra.toml
prompt = "/indra full security review of {target}"
[[workflow.task]]
id = "summary"
target = "."
prompt = "Summarise tonight's reviews and list new critical findings."
needs = ["api", "web"] # runs only if both succeed
- A task starts when everything it
needshas succeeded; if one of them failed, it is skipped. - Tasks start only while their node has room (
max_parallel, counting every agent there). - A failed task is retried up to
retriestimes. - Cancelling stops the running agents and cancels what has not started.
{target}and{node}are filled into the prompt;runnerdefaults toclaude.- Workflows are checked when the config loads: unique task ids, known nodes,
needsthat exist, and no cycles.
Run one from the terminal (cron, CI) or from the console's Workflows page:
$ indra run nightly
17:01:29 workflow 'nightly' started
17:01:29 api build-box running (process #1, attempt 1)
17:01:29 web local running (process #2, attempt 1)
17:14:52 web local succeeded
17:21:07 api build-box succeeded
17:21:07 summary local running (process #3, attempt 1)
17:23:40 summary local succeeded
17:23:40 workflow 'nightly' succeeded
Inputs. A workflow can ask for values when it runs, and its tasks use them as
{input.NAME} in their prompt, target, profile or model:
[[workflow]]
name = "triage-pr"
[[workflow.input]]
name = "pr"
label = "Pull request"
required = true
pattern = '[0-9]{1,9}' # text inputs may require a form
[[workflow.input]]
name = "target"
kind = "target" # one of the harness's targets
[[workflow.input]]
name = "depth"
kind = "choice"
options = [{ value = "", label = "auto" }, { value = "--tier=2", label = "standard" }]
[[workflow.input]]
name = "dry_run"
kind = "bool"
default = "true"
when_true = "--dry-run" # what {input.dry_run} becomes when ticked
[[workflow.input]]
name = "profile"
kind = "profile" # a configured profile, or none
[[workflow.task]]
id = "review"
target = "{input.target}"
profile = "{input.profile}"
prompt = "/sh-pr-review {input.pr} {input.depth} {input.dry_run}"
Kinds are text (the default), choice, bool, target and profile. Each value is checked
when the workflow starts: required ones present, text matching its pattern and on one line,
choices and targets among their options, profiles configured. An empty input leaves no gap in
the prompt.
Built in: with the indra harness, three workflows are always there (a configured workflow of
the same name replaces one): pr-review (pull request, checkout, profile, depth, fail-on,
deep, dry run; dry run is on by default), security-review (codebase, optional focus such as
since:main, profile) and threat-model (codebase, optional since:<ref> or
design:<file>, profile). Run any workflow from Runs > Run a workflow or the Workflows page (both ask for
its inputs), or from the terminal:
indra run pr-review --input pr=https://github.com/acme/shop/pull/7 --input target=$PWD --input depth=--tier=2
indra run # lists the workflows and their inputs (* required)
The graph editor. Workflows > New workflow (or Edit graph on a workflow) opens a
canvas: drag tasks, skills, saved tasks and other workflows in from the palette (or select one
and press Enter), drag from a step's right edge to another step to make it run after the first,
and edit the selected step on the right. Remove a step with its Delete step button, the x on
the selected step, or the Delete key (Undo brings it back); remove an arrow by selecting it
and pressing Delete. Saving writes the same [[workflow]] TOML, with each step's position, so
indra run and the text editor keep working.
Decisions, loops and schedules are drawn in the graph too:
- If (from the palette) checks something and has a green Yes and a red No edge: drag each to the step that runs on that answer. Its question is picked from lists (a step before it succeeded, failed, its output contains a text, its exit code is a number, or an input is a value), or written by hand. A step both sides lead to runs after whichever side ran.
- For each and Repeat until are dropped on a step. They show on it as a band ("for each: api, web", "repeat until its output contains PASS, at most 3"), Repeat with an arrow back to the step's start; click the band to change or remove the loop.
- Click an arrow to choose when the next step runs: when this one succeeds, when it fails, or either way.
- Click Start to schedule the workflow: only when started, every hour, every day, every weekday or every week at a time, or any cron schedule. Start then shows it ("weekdays 09:00"), and so does the workflow's card.
Skills as steps. A step can run one of the harness's skills instead of a free prompt: drag it
from Skills in the palette, or write skill = "<name>". For Claude Code it runs as the
skill's slash command, /<skill> <prompt>, so prompt holds the skill's arguments (default
{target}); other runners are told to use the skill.
[[workflow.task]]
id = "recon"
skill = "sh-security-review"
prompt = "{target} stage:recon" # becomes: /sh-security-review {target} stage:recon
Saved tasks ([[component]] in the file) are tasks kept for reuse: a task, a skill step or a
prompt with its profile, runner, node and target, that any workflow can drag in. A step that
starts from one overrides any field, and changing the saved task changes every workflow that
uses it. The editor's Save for reuse turns a step into one. (A task is one step of one
workflow; a saved task is a template for steps. Where a step runs is its node and
target, the repository or folder.)
[[component]]
name = "review"
prompt = "/indra full security review of {target}"
profile = "worker"
retries = 1
[[workflow.task]]
id = "api"
component = "review"
node = "build-box"
target = "/srv/api"
Shell steps. A step with run runs a command instead of an agent: bash (else sh;
PowerShell on Windows), in its target, on any node. It succeeds with exit code 0, and its output
is what later steps and conditions see. No value is ever pasted into a command: inputs, the loop
item and earlier results arrive as environment variables, so an input cannot change what runs.
[[workflow.task]]
id = "test"
run = "cargo test 2>&1"
| Variable | What it holds |
|---|---|
INDRA_INPUT_<NAME> | an input's value (name in upper case) |
INDRA_ITEM | the item of a foreach copy |
INDRA_OUTPUT_<STEP>, INDRA_EXIT_<STEP>, INDRA_STATUS_<STEP> | a finished step's output (last 8000 characters), exit code and state (- becomes _) |
INDRA_TARGET, INDRA_NODE, INDRA_WORKFLOW, INDRA_STEP | where and what is running |
A command cannot contain {input.}, {item} or {steps.}; agent prompts can ({steps.test.output}
writes an earlier step's result into the prompt). A node refuses shell steps with
[local] shell_steps = false in its own indra.toml.
Schedules. schedule runs a workflow by itself while indra serve runs, in that computer's
local time: standard cron (minute hour day month weekday), with ranges, lists, steps, names
(mon, jan) and @hourly, @daily, @weekly, @monthly. Its inputs take their defaults, so
give required ones a default; a run that cannot start is logged.
[[workflow]]
name = "nightly"
schedule = "0 2 * * 1-5" # 02:00 on weekdays
If steps. An If step runs nothing: it checks a condition and answers yes or no. A step
after it says which answer it follows with branch; the other side is skipped (without failing
the workflow), and a step that both sides lead to runs after the side that ran.
[[workflow.task]]
id = "passed"
needs = ["test"]
if = "test.output contains 'test result: ok'"
[[workflow.task]]
id = "ship"
needs = ["passed"]
branch = "yes"
run = "make release"
[[workflow.task]]
id = "fix"
needs = ["passed"]
branch = "no"
profile = "worker"
prompt = "The tests fail:\n{steps.test.output}\nFix the code."
[[workflow.task]]
id = "report"
needs = ["ship", "fix"] # after whichever side ran
run = "echo done"
Conditions and failure handling.
[[workflow.task]]
id = "test"
run = "cargo test 2>&1"
allow_failure = true # a failure here does not fail the workflow
[[workflow.task]]
id = "fix"
needs = ["test"]
when = "test.failed and input.autofix == 'true'"
profile = "worker"
prompt = "The tests fail:\n{steps.test.output}\nFix the code."
[[workflow.task]]
id = "tell"
needs = ["fix"]
on = "failure" # only if something it needs failed
run = "echo \"fix failed: $INDRA_OUTPUT_FIX\" | mail -s ci team@example.com"
[[workflow.task]]
id = "clean"
needs = ["test", "fix"]
on = "always" # once they finish, however they went
run = "rm -rf target/tmp"
whenis a condition on the step itself (the If step above is the same, drawn in the graph): a condition on earlier steps and inputs:<step>.succeeded,.failed,.skipped,.status,.output,.exit_code, andinput.<name>, with==,!=,contains,<,<=,>,>=,and,or,notand parentheses. False: the step is skipped. A step it reads must run before it (in itsneeds, directly or through others), so its result is known.on:success(the default: every step it needs succeeded, or failed withallow_failure),failure(one of them failed) oralways.- Skipped steps, a branch not taken, do not fail the workflow; a failure fails it unless that
step has
allow_failure.
Stop steps end the workflow early, as a success or a failure. One is usually guarded by a condition; when it is reached, steps that have not started are skipped and running ones are stopped. In the editor it is the Stop block, and the graph is drawn between a Start and an End block (Start leads to the steps that need nothing, the steps nothing needs lead to End).
[[workflow.task]]
id = "nothing-to-fix"
needs = ["test"]
when = "test.succeeded"
stop = "success" # or "failure"
prompt = "Tests pass; nothing to fix." # shown on the run page
Targets. In indra.toml, a step on this machine without a target runs in the harness's first
target (the folder the Terminal page shows); in a repository's workflow file, in that repository.
A step on another node needs its target.
Loops.
[[workflow.task]]
id = "lint"
foreach = ["api", "web", "worker"] # or "{input.services}": commas or new lines
run = "make -C services/$INDRA_ITEM lint"
[[workflow.task]]
id = "make-green"
prompt = "Run the tests and fix what fails."
until = "self.output contains 'all tests pass'"
max_runs = 3 # default 3, at most 20
foreachmakes one copy of the step per item (lint-1,lint-2, ...), run in parallel within the node's capacity;{item}in a prompt or target,$INDRA_ITEMin a command. Whatever needs the step waits for every copy. At most 50 items; none, and the step drops out.untilruns the step again after each success until the condition holds (self.output,self.exit_code, or other steps), at mostmax_runstimes, then fails. A failed run usesretriesas before.- The run page shows each step's condition, loop item, run count, exit code and output.
Create a workflow from a description. Workflows > Create with Claude: describe what it should do and where to save it, and Claude Code builds it with indra's MCP server. It reads the format and this machine's profiles, nodes, repositories and skills, looks at the repository if it needs to (build and test commands), validates the workflow until it is right, and saves it; the page then offers it in the editor. Claude Code runs with only the indra tools and read-only file tools allowed; anything else it asks for waits for your answer on its process page.
indra mcp is that MCP server, for any MCP client. In your own Claude Code:
claude mcp add indra -- indra mcp # then: "make me a workflow that ..."
Its tools: workflow_guide (the format and what this machine has), list_workflows,
get_workflow, validate_workflow (checked exactly as indra serve loads it) and
save_workflow (to indra.toml, keeping its comments, or to a repository's
.indra/workflows/). It never runs a workflow or a command.
Workflows as code. A workflow can live in the repository it works on, as
.indra/workflows/<name>.toml, to be reviewed, committed and shared like any other code. Every
console and indra run with that repository as a harness root or target picks it up, and a
git pull that changes the files is seen without a restart.
# api/.indra/workflows/triage.toml
[[workflow]]
name = "triage"
[[workflow.task]]
id = "recon"
skill = "sh-security-review"
prompt = "{target} stage:recon"
profile = "planner" # a built-in profile, so it works for everyone
[[workflow.task]]
id = "lint"
component = "lint" # a saved task kept in the same file
needs = ["recon"]
[[component]]
name = "lint"
prompt = "Run the linters on {target} and fix what they report."
- A step without a target runs in that repository; a relative target is inside it.
- The file holds
[[workflow]]and[[component]]tables, in the same format asindra.toml. - In the editor, Saved in chooses between this machine's
indra.tomland a repository (the file's path is shown); saving to a repository also copies in the saved tasks the workflow uses, so the file stands on its own. Moving a workflow between the two moves it. - A workflow in your
indra.tomlwith the same name wins. A file that cannot be used (bad TOML, or a profile or node only its author has) is listed on the Workflows page and never stops the console; the built-in profiles exist everywhere, so shared workflows that use them just work. - Saving to a repository needs the admin role, like other settings.
Workflows compose. A task with workflow = "<name>" runs that workflow as one step: its
first tasks start after the step's needs, and anything that needs the step waits for its last
tasks. Its tasks show up as <step>__<task> in the run. A workflow cannot include itself.
indra run exits 0 only if every task succeeded; Ctrl-C cancels the run and stops its agents.
indra run without a name lists the configured workflows.
The Workflows page also has fan-out: one prompt across any set of targets on any nodes, in parallel within each node's capacity. That is the quickest way to review ten repositories spread over three machines.
How remote execution stays safe
- SSH does the transport. No daemon, no open port: authentication, encryption and host-key
checking are SSH's. indra calls
sshwithBatchMode=yes, so it never prompts and never accepts an unknown host key. - Nothing you type reaches a remote shell. The only remote command is the fixed
indra node exec; the job (runner name, prompt, target) travels as JSON on stdin. A prompt containing$(...)is just text. - The remote decides what runs.
indra node execruns only runners from its own configuration, by name, in a directory that must exist on it. The console can launch only into a node's configuredtargets. - Stop means stop. The hub keeps the job's stdin open for its lifetime; when it closes (Stop, cancel, or a dropped connection), the node terminates the agent's whole process tree.
- Destinations are validated, so a config value cannot smuggle in an ssh option such as
-oProxyCommand=....
Remote nodes need a POSIX shell (Linux, macOS, BSD). local works everywhere.