Skip to content

Starting a run ​

Last updated Nov 30, 2026 View as Markdown

pandra run takes one reference, the agent to run, and the options that say how:

terminal
sh
pandra run github.com/pandra-io/pandra/examples/reviewer \
    --prompt "Review only the error handling."
pandra run . --headless --workspace new --prompt "Write a script that prints the date."

The first command opens the harness's interface on a terminal, and --prompt replaces the prompt the agent starts with. In the second, --headless prints only the agent's answer instead of opening the interface, and --workspace new runs the agent in a new, empty directory instead of the current one.

Before the agent takes its first step, Pandra checks that everything the agent needs is in place, asks on a terminal for what is missing, and otherwise stops with the steps that fix it. The later examples use two made-up agents: github.com/acme/reviewer has no prompt and uses the GitHub MCP server, and github.com/acme/changelog has a prompt.

What you can run ​

  • A local project, built from its lockfile: ., ./agents/reviewer, or /home/me/agents/reviewer.
  • A Git repository, with an optional subdirectory and an optional @ref, a tag, branch, or commit: github.com/acme/agents/reviewer@v1.2.0. On GitLab and self-hosted servers, // ends the repository's part, as the longer forms below show (Git references).
  • A package in an OCI registry, with a tag or a digest: ghcr.io/acme/reviewer:1.2.0. oci:// forces OCI.
  • A package file: ./reviewer.agent.tar.
  • A local name in your store, never fetched: reviewer, or reviewer@sha256:<digest>.
  • A package in your store by digest: sha256:<digest>.

The longer forms of a Git reference and an OCI reference by digest:

text
gitlab.com/acme/tools/agents//reviewer@v1.2.0
https://git.example.com/team/agents.git//reviewer@v1.2.0
ghcr.io/acme/reviewer@sha256:<digest>

A Git reference without @ref stands for the default branch: the first run fetches it, and later runs use the package in your store until you pull it again. An OCI reference needs a tag or a digest, so pandra run ghcr.io/acme/reviewer fails with reference_without_tag. Settings in your configuration are keyed by the agent's identity, which has no ref, tag, or digest, such as [agents."github.com/acme/reviewer"], so they apply to every version (agent identity).

A remote agent or a package file runs only after you approve it, and packages built from your local projects never need approval (trusting agents).

Headless, TUI, and ACP ​

A run has three modes:

ModeWhat it is forOption
TUIWorking with the agent in the harness's own interface on your terminal.--tui
HeadlessScripts and CI: the agent works on its prompt, and Pandra prints only its final answer.--headless
ACPAn editor, such as Zed, that runs the agent in its agent panel.--acp

Without one of these options, Pandra chooses by whether a terminal is attached: on a terminal, the run opens the TUI, and the prompt becomes the interface's first message. Anywhere else, such as in a CI job, in a pipe, or with stdout redirected to a file, the run is headless. A headless run writes everything but the answer to stderr: progress, warnings, errors, and the fields that name the session and which skills the agent loaded. So > review.md captures exactly the answer:

terminal
sh
pandra run github.com/acme/reviewer@v1.2.0 \
    --prompt "Review PR 12." > review.md
text
✓ Prepared · 0.0s
  Session:  9f2c4e1a7b3d (reviewer)
✓ Started claude-code 2.1.285 · 0.5s
✓ Ran reviewer · 41s
  Skills not loaded:  pandra

Pass --headless to get the answer on a terminal. Pass it also to a pandra run inside a script you start from your terminal, or under docker run -t or ssh -t, which would otherwise open the TUI and wait for a person:

terminal
sh
pandra run github.com/acme/reviewer@v1.2.0 --headless --prompt "Review PR 12."

A run on a terminal is also headless:

  • with an option only a headless run accepts: --events, --output-schema, --prompt -, --json outside a dry run, or --detach
  • with --no-interactive or PANDRA_NO_INTERACTIVE
  • inside another Pandra run

A dry run shows the mode a command would use and why. A headless run never reads standard input unless you pass --prompt -.

In the TUI:

  • Claude Code and Codex receive the first prompt as if typed, so a prompt that they would run as their own command, such as one that starts with / on Claude Code or ! on either, fails with prompt_is_command. Reword it, or pass --headless. Pi receives the prompt as text.
  • The interface opens at once, without waiting for the MCP servers and without first-run questions, such as Claude Code's workspace trust and Codex's Folder access screen, and shows the servers' state.

When the harness exits, Pandra names which skills the agent loaded. It then prints how to resume the session, unless --rm removed the session or it cannot be resumed. Use that command rather than the harness's own, such as claude --resume ID, which does not find the session:

text
Skills not loaded:  pandra
To resume this session:
  pandra resume 9f2c4e1a7b3d5c6e8f90a1b2c3d4e5f6 --tui

--acp serves the agent over the Agent Client Protocol (ACP) on stdin and stdout (running an agent in an editor).

Prompts ​

In headless and TUI mode, a new session starts with the agent's prompt, if it has one. Options change it:

OptionEffect
--prompt TEXTSend TEXT instead of the agent's prompt.
--prompt -Read the prompt from standard input until end of file.
--prompt ""Send only the --prompt-append parts, without the agent's prompt.
--prompt-append TEXTAdd TEXT after the agent's prompt or --prompt, separated by a blank line. Repeatable.
terminal
sh
pandra run github.com/acme/changelog@v2.0.0 \
    --prompt-append "Group the entries by component."
git diff main | pandra run github.com/acme/reviewer@v1.2.0 --prompt - \
    --prompt-append "Review this diff."

A headless run with nothing to send fails with a hint to pass --prompt TEXT, and a TUI run with nothing to send opens idle. The agent's prompt applies only when a session is created, never when you resume one. --prompt - needs a headless run; in the TUI, pass a file's contents with --prompt "$(cat FILE)". A headless run sends a prompt that starts with / as text, not as a harness command, except on Pi, where a prompt that starts with one of Pi's commands, such as /mcp, fails with prompt_is_command.

What a run checks ​

Pandra checks everything it can before the agent starts, and fails rather than run a degraded agent. It checks the configuration, gets the package (from your store, fetched if remote, built if local), selects the harness, checks the approval, and then checks the rest together:

  • the harness is installed and supports what the agent needs, such as an MCP transport, a structured answer, and the permission mode;
  • every required input and environment variable has a value, and every MCP server is allowed to receive its values;
  • the runners the servers need (npx, uvx, docker) are installed;
  • the workspace, session name, prompt, and options are valid.

On a terminal, Pandra asks about what it can fix: approving the package, installing a missing harness, servers to allow, and missing inputs. A missing input's question names the server and where the value goes, and lets you pick a saved secret, type the value without echo, or give its source. The answer is for this run only, unless you choose to save it (supplying values).

Without a terminal, Pandra reports every problem in one error, with the commands that fix them in order:

text
error: github.com/acme/reviewer@v1.2.0 cannot start: 2 problems
  github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d has not been approved
  --worktree needs a Git repository, and none contains /home/me
  To show what the agent contains:
    pandra agent inspect github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d
  To approve the agent, and later revisions that keep its MCP servers and pre-approve no new tool:
    pandra agent trust github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d
  To run it in the current directory instead, without a worktree:
    pandra run github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d --headless --prompt 'Review PR 12.'

Then Pandra creates the session and prints its ID, starts the harness, and, outside the TUI, waits for the MCP servers before it sends the prompt: up to 30 seconds when every server is remote, and up to 120 seconds when one runs from a package, whose first start downloads it. A server that has not connected by then is a warning, or a failure for a required server (servers that do not connect). A failure at this point comes after the session exists, so its ID is already printed. Troubleshooting lists the failures and their fixes.

pandra agent list runs the checks that need only local state for every agent in your store, and its BLOCKERS column lists the codes of what would stop each one, such as package_not_approved or input_missing. --offline makes Pandra fetch nothing it manages.

Where the agent runs ​

A run starts the harness on your computer as you. On a Mac with Apple Silicon, --backend vm runs it in a Linux microVM of its own instead, which sees only the workspace and reaches only the destinations you allow; --cpus N and --memory SIZE, such as --memory 8GiB, set the VM's resources:

terminal
sh
pandra run github.com/acme/reviewer@v1.2.0 --backend vm --cpus 2 --memory 8GiB \
    --prompt "Review PR 12."

A session keeps the backend it started on, so pandra resume takes --cpus and --memory but no --backend. Running in a microVM covers images, network rules, credentials, and how to make the VM an agent's default.

Dry runs ​

--dry-run on run and resume shows how that invocation would run, with every flag applied, and starts nothing. It asks nothing, reads no secret, and writes no configuration, lockfile, or session. A remote agent you name must already be in your store, so pandra pull it first:

terminal
sh
pandra run github.com/acme/reviewer@v1.2.0 --model claude-opus-5-5 \
    --workspace new --prompt "Review PR 12." --dry-run

It prints the plan, with a ... line where lines are left out:

text
Run plan for github.com/acme/reviewer@v1.2.0 (nothing was started)

Agent       github.com/acme/reviewer (sha256:9f2c1a7b3d5c)  approved 2026-11-02
Harness     claude-code                                 target work
Backend     host
Target      work                                        agent settings
Model       claude-opus-5-5                             --model
Effort      high                                        target work
Permission  auto
Mode        tui                                         terminal
Prompt      --prompt
Workspace   new empty directory                         --workspace

Environment variables
  DISABLE_TELEMETRY  1                               harness settings
  HTTPS_PROXY        http://proxy.corp.example:8080  defaults
  GITHUB_REPOSITORY  -                               shell

MCP servers
  github
    Server:         io.github.github/github-mcp-server 1.4.0 (MCP Registry, registry.modelcontextprotocol.io)
    URL:            https://api.githubcopilot.com/mcp/
    Inputs:         Authorization  secret github-token (command gh auth token) as "Bearer {}", through Pandra's proxy
    Configuration:  github
  slack
    Server:         com.slack/slack-mcp 2.0.0 (MCP Registry, registry.modelcontextprotocol.io)
    URL:            https://mcp.slack.com/mcp
    Inputs:         tenant-id      missing
                    token          missing

Checked when the run starts: model and effort support, secret values, harness version support, MCP server connections

Would not start (2 problems):
  slack needs input "tenant-id"
    To print a template to fill in:
      pandra config setup github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d --template
    To apply the filled-in template:
      pandra config setup github.com/acme/reviewer@82e4bb23c92b5f84820a42e9ad5f75716ce0519d --file FILE
  slack needs input "token"
    ...

The last line is the verdict: Ready to run., or Would not start (N problems): with each problem and its fix. What the run would ask on a terminal, such as an approval or a missing input, is listed as a problem. --json prints the plan as one document (use by AI agents).

The word on the right of a value says where it came from:

OriginMeaning
--model, --workspace, ...A flag of this invocation.
target work, agent settings, harness settings, defaultsYour configuration: the target in use (a harness with a provider, a model, and a login, chosen as a unit), the agent's table, the harness's table, or [defaults].
profile cross-reviewThe guild profile that pandra guild run applies.
packageThe agent's own definition.
shellA variable the agent declares that only your shell sets, shown without its value.
kept from the sessionOn a resume, the target, the harness, and the workspace the session had.
terminal, not a terminal, nested, ...For Mode, what chose the interaction mode.
(none)A built-in default.

A dry run fetches what the run would fetch, such as a local project's locked dependencies, and keeps it, so the run after it does not fetch it again. It downloads no harness.

Released under the Apache License 2.0