Skip to main content
The output CLI is how you create projects, start development services, run workflows, and debug executions. It’s the main way you interact with Output during development.

Quick Start

Command Reference

Project Commands

output init

Create a new Output project with the standard file structure:
string
Name of the project folder to create. Required with --scaffold-only.

output dev

Start all development services via Docker Compose:
This starts:
Worker hot-reload does not watch package.json. After adding or changing dependencies, run npm install, then bring the stack down and start output dev again so the worker container reinstalls into its node_modules volume. Quitting a foreground output dev that owns the stack tears it down and is enough; if the stack is still running (an attached session, or one started with output dev -d), run output dev down first, then output dev again.

Running multiple dev stacks

You can run multiple isolated Output stacks on the same machine — useful when working across several projects simultaneously or testing against different versions. Each stack needs a unique project name and non-conflicting host ports. Set these in the project’s .env:
DOCKER_SERVICE_NAME isolates Docker networks, volumes, and container names so the stacks don’t interfere with each other. OUTPUT_CATALOG_ID keeps each stack’s workflow catalog separate. The three OUTPUT_*_HOST_PORT vars control which ports are exposed on your machine — the container-internal ports are unchanged, so workers in either stack still reach Temporal at temporal:7233. Run npx output dev in each project directory. Project A’s API is at http://localhost:3001 and Project B’s at http://localhost:3002. If a port is already in use, output dev names the conflicting port and the env var to override.

Attaching to a running stack

If services are already running for this project, output dev attaches and monitors them instead of reporting a port collision on our own containers. An attached session does not own the stack: quitting the dashboard leaves the services running. The footer reads ctrl+c detach (keeps running) so you can tell which mode you’re in. Stop an attached stack explicitly:
A stack whose containers are all stopped is not an attach — output dev starts it in the foreground and tears it down on quit, as a fresh start would.

output dev down

Stop the development services started by output dev:
Use this after output dev -d, or when an attached output dev session left the services running on quit.

output dev eject

Export the Docker Compose configuration so you can customize it:

output update

Update the Output CLI and agent configuration:
With no flags, updates everything. Use flags to update specific components:

output fix

Align the project’s package.json with the current project template:
The command adds missing Output scripts, replaces outdated ones, removes deprecated ones, replaces an @outputai/output dependency with @outputai/core (dependency) and @outputai/cli (dev dependency) at the same version, and drops outputai.hookFiles entries that point to @outputai/credentials. It prints the planned changes and asks for confirmation before writing. If dependencies changed, reinstall afterwards.

Workflow Commands

output workflow plan

Generate a workflow plan from a natural language description. The command prompts for a description, generates a plan using AI, and lets you iterate on it interactively. Type ACCEPT to save.

output workflow generate

Generate workflow code from a plan or description:
string
required
Name of the workflow to generate

output workflow list

List available workflows from the catalog:

output workflow runs list

List recent workflow runs, optionally filtered by workflow name:
string
Filter by workflow name (optional)

output workflow run

Run a workflow synchronously and wait for the result:
string
required
Name of the workflow to execute
string
Scenario name — resolved from the workflow’s scenarios/ directory

output workflow start

Start a workflow asynchronously — returns the workflow ID immediately without waiting:
string
required
Name of the workflow to start
string
Scenario name — resolved from the workflow’s scenarios/ directory
Add --monitor to start a workflow and watch it in one command, instead of copying the workflow ID into a separate workflow monitor call:
Monitoring attaches to the exact run that was just started, so a rapid re-start can’t leave you watching a different execution. Everything else matches workflow monitor — Ctrl+C detaches without stopping the workflow (exit 130), and the command exits 1 if the workflow fails. The stream reports progress, not the return value, so the command closes by naming the follow-up: workflow result after a run that completed, workflow debug after one that failed. If monitoring itself drops — the API restarts, the connection resets — a transient failure is retried a few times before the command gives up. Once it does, the workflow it started keeps running, so the command says so and exits 3 rather than 1. Retry logic keyed on a failed workflow therefore can’t re-submit a workflow that is already in flight:
--monitor cannot be combined with --json. Under --json the CLI suppresses progress output and prints a single JSON object when the command finishes, which would silently swallow every streamed update and leave the command looking hung until the workflow ended. Use workflow run --json to wait for a result as JSON, or workflow monitor <id> --format json to stream newline-delimited JSON. These flags tune the stream and require --monitor:

output workflow status

Check whether a workflow is still running, completed, or failed:
string
required
The workflow execution ID

output workflow monitor

Attach to a workflow run and stream status updates until it ends — a step starts, completes, or fails is printed as it happens, so you don’t have to re-run workflow status in a loop to watch a long-running workflow:
string
required
The workflow execution ID
Exits 0 when the workflow completes, 1 when it fails, is canceled, terminated, or times out, and 130 if you detach with Ctrl+C — detaching never stops the workflow itself. monitor also exits 1 after 5 consecutive transient poll failures (network errors, 5xx/408/429 responses), printing a warning before each retry — this is API/network trouble, not a workflow outcome, but shares the same exit code.
To start a workflow and attach in a single step, use workflow start --monitor instead of copying the ID between two commands.
--format json here is not the same thing as the native --json flag used by workflow run, workflow status, and other commands migrated in OUT-419 (see the changelog). Native --json suppresses all in-progress log output and prints a single JSON object once the command finishes. monitor has no single final result to print — it’s a long-running command that emits a stream of discrete events (a step starting or finishing, a continue-as-new notice, a final summary) while the workflow is still running. --format json prints each event as its own line of newline-delimited JSON as it happens, so the output can be piped into jq or read incrementally by another process — often another automated or agent process rather than a person, which is the primary reason this command keeps its own JSON mode instead of adopting --json.

output workflow result

Get the output of a completed workflow:
string
required
The workflow execution ID

Workflow result JSON format

Use --json with output workflow run or output workflow result to print the full structured workflow result:

JSON error format

When a command run with --json fails, it writes a JSON error to stderr and leaves stdout empty, so a script can read results from stdout and failures from stderr without mixing them. This applies to run, start, status, result, list, runs list, cost, input, test, and dataset list. debug always prints JSON on stdout and reports failures as plain text on stderr with a non-zero exit code.
The exit code tells you what kind of failure it was, and is the same as in text mode: 1 for API and network failures, and 2 for usage errors such as invalid flag combinations on workflow start. Without --json, errors are printed as plain text, as before.

output workflow stop

Stop a running workflow gracefully:
string
required
The workflow execution ID

output workflow terminate

Force-stop a workflow immediately. Use this for stuck workflows or cleaning up after branch switches:
string
required
The workflow execution ID
Unlike stop (which cancels gracefully), terminate kills the workflow immediately.

output workflow reset

Rerun a workflow from after a specific completed step. The current run is terminated and a new run is created that replays up to the given step (reusing its output), then re-executes every step after it. Useful when iterating on a late step without re-paying the cost of earlier LLM or API calls:
string
required
The workflow execution ID
The command prints the original workflowId and a new runId for the fresh execution. Use output workflow status <workflowId> and output workflow result <workflowId> to track it.
Find valid step names with output workflow debug <workflowId>. A step is an activity named <workflowName>#<stepName>, and the --step value is the part after the #. To list them: output workflow debug <workflowId> | jq -r '.workflows[0].events[] | select(.eventType == "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED") | .activityTaskScheduledEventAttributes.activityType.name'.

output workflow debug

Read one workflow run from Temporal and print its history, for debugging. The output is one JSON document with an entry for every workflow: the one you asked for, then each child workflow it started. Every entry holds that workflow’s own Temporal history events. The command talks to Temporal directly, so it needs no API, no trace files and no S3, and it behaves the same in development and production.
string
required
The workflow execution ID (the id printed by workflow start, not the workflow name)
Generated workflow ids can start with -, and the CLI then reads the id as a flag (Nonexistent flag: -Ab...). Quoting does not help, because the shell removes the quotes. Put -- before the id: output workflow debug --address localhost:7233 -- -Ab.... The same applies to every command that takes a workflow id.
The output is always JSON. --json is accepted and does nothing, so scripts that pass it keep working.

Connecting to Temporal

Connection settings follow Temporal’s standard client configuration, the same one the temporal CLI uses, so one profile file can point workflow debug at any backend. Highest priority first:
  1. The --address and --namespace flags
  2. Environment variables: TEMPORAL_ADDRESS, TEMPORAL_NAMESPACE, TEMPORAL_API_KEY and the other TEMPORAL_* variables Temporal defines for TLS (empty TEMPORAL_* values are treated as unset)
  3. The profile chosen with --profile (or TEMPORAL_PROFILE, then default) in temporal.toml
  4. The defaults: localhost: plus the dev stack’s Temporal port (OUTPUT_TEMPORAL_HOST_PORT, 7233 unless overridden), and the namespace default
temporal.toml lives in temporalio/ under your user config directory (~/Library/Application Support on macOS, $XDG_CONFIG_HOME or ~/.config on Linux, %APPDATA% on Windows). Set TEMPORAL_CONFIG_FILE to use another path.
An explicit --profile that does not exist is an error. API keys and TLS material come only from the profile or the environment, never from a flag.
The profile’s credentials stay attached when you override the address. --profile prod --address other:7233 sends the prod API key to other:7233, and so does TEMPORAL_ADDRESS. Override the address only with hosts you trust.

Output

The output is compact JSON on a single line, with a summary first and then the workflows. Pipe it to jq . to read it indented, or to jq -c '.workflows[].events[]' to get one event per line. It is shown split over several lines below:
At the top:
  • complete is true when everything was read. Scripts should check this and nothing else.
  • warnings is a list of sentences about what could not be read (see below). It is empty when complete is true. The wording can change, so do not parse it.
  • temporal is the address and namespace that were used.
Each entry in workflows has:
  • workflowId, runId and workflowType.
  • status, Temporal’s name for it: WORKFLOW_EXECUTION_STATUS_RUNNING, ..._COMPLETED, ..._FAILED, ..._CANCELED, ..._TERMINATED, ..._CONTINUED_AS_NEW or ..._TIMED_OUT. It is null for a workflow that was not read.
  • parent (workflowId and runId), on child workflows only.
  • pendingActivities is what shows a stuck run: each entry has the activity, its state, its attempt number and the last failure. pendingChildren lists the child workflows Temporal reports as open when it describes the workflow, each as { workflowId, runId, workflowType }. On a closed parent that list can be out of date, so take a child’s status from its own entry. status and both pending lists are read after the events, so they are never older than the events. A running workflow shows WORKFLOW_EXECUTION_STATUS_RUNNING with no closing event, which is how you debug it live. If a workflow finishes while it is being read, a warning says its events stop before the end, and running the command again gives the full history.
  • events, the history, last in the entry.
The first entry is the workflow you asked for. Children follow in the order their parent reports them started, and every child, however deep, is in the same flat list. A workflow that uses continueAsNew has one entry per run, all with the same workflowId (and the same parent, for a child) and different runIds. Entries are ordered by when they started, so a run follows the run that continued into it. Runs of the workflow you asked for have no parent. For a step that failed once and is waiting to retry, pendingActivities looks like this:
Events are exactly what Temporal’s own JSON renders (the same shape the Temporal UI exports), and the command adds nothing to them: EVENT_TYPE_* names, string ids, ISO timestamps, durations like "30s", and attributes under <eventName>EventAttributes.
  • Payloads (inputs, results, failure details, memo) are decoded from Temporal’s base64 form into plain JSON and truncated, see below.
  • Event ids restart in every workflow, so an event is identified by its workflow entry plus eventId.
  • Related events point at each other through ids such as scheduledEventId and startedEventId. The command does not pair them or compute durations, statuses or attempts.
  • Steps are activities named <workflowName>#<stepName>. Activities named __internal#... belong to the framework.
  • A parent’s EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_* events mark where each child started and ended, and they name the child. The child’s own entry holds the child’s events.
  • A step that throws shows its error as failure (message, source, stackTrace, applicationFailureInfo.type and details) on EVENT_TYPE_ACTIVITY_TASK_FAILED. The workflow then ends with EVENT_TYPE_WORKFLOW_EXECUTION_FAILED, whose failure.cause chain holds the same error. With a child workflow, the child’s own failed event is followed by the parent’s EVENT_TYPE_CHILD_WORKFLOW_EXECUTION_FAILED with the cause nested one level deeper.
  • Every run that continues as new ends with EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW and its newExecutionRunId. The next run is read automatically and gets its own entry, so the chain from the run you start at is in the output, and the page limit below applies to all of it. Without --run-id you start at the latest run, so there is no chain after it; pass the first run’s id to read the whole chain.
  • Payloads that cannot be decoded, for example when you use an encryption codec, print as [Undecodable Payload: <encoding>].
The output works with jq:
Events are grouped by workflow and not merged, so the output has no single timeline. When you need to see what the parent and its children did at the same moment, build one:

Truncation

Long values are cut so a large LLM response does not bury the failure. The limits always apply, there is no flag to lift them, and full payloads stay in Temporal: Error stacks keep their first 10 lines. Error messages are never cut. Nothing is redacted: the output contains what your workflow handled.

Long histories and missing children

The run and its children are read to the end. Reading stops after 100,000 events or 1,000 pages (of 1,000 events) across the whole tree, whichever comes first. A single Temporal history never exceeds about 51,200 events. When it stops early, or when a child’s history is gone (Temporal deletes closed histories after the namespace retention period), the output still succeeds. complete is false and warnings says what is missing, naming each workflow:
A child workflow or later run whose history cannot be read for another reason, such as a permission or network error, is reported the same way, with the error message in the warning:
A workflow that was not read (its history is gone, it could not be read, or the limit was reached first) still has an entry, with events empty, status set to null and empty pendingActivities and pendingChildren. When the limit is reached in the middle of a workflow’s history, its entry keeps the events read so far and a warning says it was read only in part. If a workflow’s status and pending lists cannot be read, its events are kept and a warning says they may be missing or out of date.

Errors and exit codes

Standard behavior: stdout carries only data, errors go to stderr, and a failure exits non-zero with nothing on stdout. That covers a workflow or run that is not found, a Temporal server that cannot be reached or does not answer within 30 seconds, a missing profile and a bad namespace, and failing to read the first page of the workflow you asked for. Failures on children and later runs are warnings instead. A partial result (complete is false) exits 0.
Temporal’s history records an activity’s start only for the attempt that ran last. Earlier attempts do not have their own events. The last retry shows up as attempt and lastFailure on EVENT_TYPE_ACTIVITY_TASK_STARTED (the failure of the attempt before it), and on pendingActivities while the step is still retrying.

output workflow cost

Calculate the estimated dollar cost of a workflow execution from its trace. Covers LLM token costs and API service costs. See Cost Estimation for details on pricing configuration and the config/costs.yml override file.
string
required
Workflow ID to calculate cost for
string
Path to a local trace JSON file. If omitted, fetches the latest trace for the workflow.
When the trace is fetched from the API, remote traces over 256 MB are not loaded. The command stops with Trace file is too big for this feature. Max size 256 MB, file size <size>.
If the report shows “Unknown models”, add them to config/costs.yml in your project root. See Cost Estimation — Pricing Configuration for the format.

Evaluation Commands

These commands run offline evaluations against your workflows using the @outputai/core/evals module. You define evaluators, write dataset YAML files, and use these commands to execute and manage them.

output workflow test

Run evaluations against a workflow using its datasets:
string
required
Name of the workflow to test

Dataset Commands

output workflow dataset list

List datasets for a workflow:
string
required
Workflow name to list datasets for

output workflow dataset generate

Generate a dataset case for a workflow from a scenario, inline JSON, or a completed run read from Temporal:
string
required
Name of the workflow (its type). It decides which workflow’s tests/datasets directory the case is written to
string
Scenario name — resolved from the workflow’s scenarios/ directory
With --workflow-id, the command reads the run’s start input and its result from Temporal and writes them as a case. It connects like workflow debug, so it works on local and remote Temporal. Values are not truncated, and secrets are redacted as in the other modes. The run must be a completed run of <workflowName>, given by its own name and not by an alias. A run of another workflow, a run that is not completed, a missing run and an unreachable Temporal stop the command with a message and write nothing. A run that continued as new is not completed, so omit --run-id or pass the id of the last run. For a continuation, the case takes the input of the first run of the chain (a continuation only holds the continuation arguments) and the result of the run read. The command prints both run ids, and fails if the first run can no longer be read. The case is named after the workflow id unless --name is given. A run that started without input is saved with an empty input, and a run that returned nothing with a null output. If the dataset file already has a case with that name, its input and last_output are replaced and its other fields (such as ground_truth) are kept. The file goes to the workflow’s tests/datasets directory. The folder is src/workflows/<workflowName> or workflows/<workflowName> under the current directory (or OUTPUT_WORKFLOWS_DIR), or, for a nested workflow, the one the API’s workflow catalog reports. If neither is found, for example for a nested workflow when the API is not reachable, a new src/workflows/<workflowName>/tests/datasets folder is created.

Credentials Commands

These commands manage the encrypted credentials files read by @outputai/core/credentials. Every command targets the global credentials by default and accepts these flags to pick another scope:
--environment and --workflow are mutually exclusive.

output credentials init

Create an encryption key and an encrypted credentials file:

output credentials edit

Decrypt the credentials file, open it in $EDITOR, and re-encrypt it on save:

output credentials set

Set a credential value by dot-notation path:
string
required
Dot-notation path to the credential (e.g. anthropic.api_key)
string
required
Value to set

output credentials get

Print a single credential value by dot-notation path:
string
required
Dot-notation path to the credential (e.g. anthropic.api_key)

output credentials show

Print all decrypted credentials, for debugging:

Environment Configuration

By default, the CLI loads environment variables from .env in the current directory. To use a different env file: