> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefused.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run an agent locally

> Invoke the compiled root agent without starting an HTTP server.

Enable the CLI interface in `config.yaml`:

```yaml theme={null}
spec:
  interfaces:
    cli: true
```

Run one turn in the agent's compiled runtime:

```bash theme={null}
harnest run support-agent "Summarize the open incidents"
```

For multiline or sensitive input, pipe the message. Harnest always sends it to
the generated runtime through stdin, not process arguments.

```bash theme={null}
printf '%s\n' 'Continue the incident review' \
  | harnest run support-agent --session incident-review
```

| Option            | Behavior                                            |
| ----------------- | --------------------------------------------------- |
| `--session ID`    | Open an existing local-runtime session              |
| `--output text`   | Stream assistant text; tool progress goes to stderr |
| `--output json`   | Write one terminal JSON object                      |
| `--output ndjson` | Write ordered events and one terminal record        |

The command requires that explicit opt-in, compiles to an ephemeral artifact,
invokes the final ADK or LangGraph runtime pipeline in-process, and exits. It
can execute queued tasks but does not activate cron schedules.

<Warning>
  Human approvals and client tools need a connected serving transport. Local
  invocation fails closed if the model requests either one.
</Warning>

Run a retained artifact directly with the same contract:

```bash theme={null}
harnest compile support-agent --output .harnest/support-agent
printf '%s\n' 'Hello' | .harnest/support-agent/harnest-agent run
```

Use [Serve a project](/harnest/get-started/serve) when the agent needs HTTP,
SSE, WebSocket, approvals, client tools, or cron ownership.
