Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.archal.ai/llms.txt

Use this file to discover all available pages before exploring further.

Usage

archal run [scenario] [options]
If you omit the scenario argument, Archal looks for .archal.json in the current directory.

Arguments

ArgumentDescription
[scenario]Path to a scenario .md file. Optional if using --task or .archal.json.

Common options

These are the flags you’ll use most of the time. Run archal run --advanced to see the full set. Inline --task runs still execute your configured agent. Use .archal.json to tell Archal how to start that process, then pair --task with --twin when you want a one-off smoke test without writing a scenario file first.
FlagDescriptionDefault
-c, --config <path>Path to .archal.json config fileauto-discovered in cwd
--task <description>Run an inline task instead of a scenario file. Still needs a runnable agent path.
--twin <name>Twin(s) for --task mode (repeatable or comma-separated)
--read-onlyForce the generated --task scenario into the read-only (single-criterion) scaffold, bypassing the heuristic classifier. Only meaningful with --task.false
--harness <path>Path to a runnable headless harness (e.g. ./.archal/harness.ts). Omit to auto-discover a top-level harness.{ts,js,mjs,cjs}, or set agent in .archal.json.auto-discovered
-n, --runs <count>Number of runs1
-t, --timeout <seconds>Timeout per run in seconds180
-o, --output <format>Output format: terminal, jsonterminal
--seed <name-or-path>Seed name or file path (.json / .md)from scenario config
--tag <tag>Only run if scenario has this tag (exits 0 if no match)
--reuse-session [session-id]Reuse an active archal twin start session instead of provisioning a new one. Does not tear down the session at end.
--keep-stateSkip the scenario’s named-seed re-apply on a reused session. Alias: --no-reseed.false
--fresh-seedForce the scenario’s named seed to be re-applied on a reused session, wiping existing twin state first. Opposite of --keep-state.false
-q, --quietSuppress non-error outputfalse
-v, --verboseEnable debug loggingfalse

Advanced options

These are available but hidden from default --help output. Use archal run --advanced to see them.
Advanced flags are internal or back-compat (.hideHelp() in cli/src/commands/run.ts). They exist for debugging, CI integration, or legacy callers and can change or be removed without a deprecation window. Don’t script against them from a production CI path — prefer the Common options above.
FlagDescriptionDefault
-m, --model <model>Evaluator model for probabilistic criteriafrom config
--pass-threshold <score>Minimum passing satisfaction score (0-100)0
--api-key <key>API key for the model providerfrom env
--agent-model <model>Agent model identifierfrom env
--rate-limit <count>Max total requests before 429unlimited
--preflight-onlyValidate config and exit without runningfalse
--seed-cacheReuse cached dynamic seedsfalse
--clear-seed-cacheClear cached seeds before runningfalse
--no-failure-analysisSkip LLM failure analysis on imperfect scoresfalse
--run-project-id <id>Attach run to a dashboard project
--proxy / --no-proxyForce the TLS proxy on or off (on by default for local harness runs)on
--allow-empty-stateLet a run proceed when the reused-session state probe fails. Debug-only.false
--sandboxRun agent in sandboxed container with TLS proxyfalse

Examples

# Run with .archal.json in the current directory
archal run

# Use a specific config file
archal run --config path/to/.archal.json

# Run a single scenario
archal run scenario.md

# Three ways to supply the runnable agent path:

# 1. Explicit --harness flag
archal run --task "Create an issue titled 'hello'" --harness ./.archal/harness.ts --twin github

# 2. Repo-local auto-discovery — with a top-level harness.ts in the repo,
#    no --harness flag needed.
#    Note: a file at `.archal/harness.ts` is NOT auto-discovered — pass --harness explicitly.
archal run --task "Create an issue titled 'hello'" --twin github

# 3. .archal.json with { "agent": { "command": "npx", "args": ["tsx", "./.archal/harness.ts"] } } — the agent field
#    can point anywhere, including `.archal/harness.ts`.
archal run --task "Create an issue titled 'hello'" --twin github

# Run 5 times and require 80% satisfaction
archal run scenario.md --runs 5 --pass-threshold 80

# JSON output for CI
archal run scenario.md -o json -q

Exit codes

CodeMeaning
0Run succeeded and score met --pass-threshold (or scenario skipped by --tag)
1Runtime error or satisfaction below threshold
2Validation error (bad flags, missing scenario, invalid config)

Environment variables

These configure archal run itself:
VariableDescription
ARCHAL_TOKENAuth token (alternative to archal login)
ARCHAL_ENGINE_API_KEYAPI key for the model under test
ARCHAL_ENGINE_MODELDefault agent model identifier
These are set automatically for your agent process (see Test your agent for the full list):
VariableDescription
ARCHAL_ENGINE_TASKThe task or scenario prompt
ARCHAL_<TWIN>_URLMCP endpoint per twin
ARCHAL_<TWIN>_BASE_URLREST base URL per twin

Local run artifacts

Every archal run also writes local artifacts under .archal/cache/:
  • .archal/cache/last-run.json
  • .archal/cache/runs/*.json
Use --output json when you want machine-readable stdout. It is not required to save traces locally.