> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: Run commands
description: Reference for executing functions, workflows, tools, and agents from the CLI, and for listing registered components.
category: CLI
last_verified: 2026-07-24
hideRightSidebar: true
---

**`agnt5 run`** executes a function, workflow, tool, or agent and prints its output. By default it routes to your local `agnt5 dev` worker; pass `--env` to run against a deployed environment instead. **`agnt5 components`** lists what's registered for the current project.


**Commands**: `agnt5 run [type] <component> [options]`, `agnt5 components [options]`
**Key flags**: `--input`/`-i`, `--env`/`-e`, `--type`/`-t`, `--deployment-id`
**Required**: a running local worker (`agnt5 dev`) or a target environment/deployment


## `agnt5 run`

```bash
agnt5 run <component> [options]
agnt5 run <type> <component> [options]
```

Runs a component and prints its output. Accepts either a bare component name or a positional `type component` pair. If `--type` is omitted and the component isn't found as a function, the CLI auto-detects the type from the gateway response and retries.

| Flag | Description |
| --- | --- |
| `--input <json>`, `-i` | JSON input for the component. Default: `{}`. |
| `--env <environment>`, `-e` | Target environment, e.g. `production`, `staging`. If unset, routes to the local dev worker. |
| `--type <type>`, `-t` | `function` (default), `workflow`, `tool`, or `agent`. |
| `--deployment-id <id>` | Target a specific deployment instead of the local dev deployment. Mutually exclusive with `--env`. |

Output shape depends on `--type`: `function` streams output as it runs; `workflow` returns the final output; `tool` returns the tool result; `agent` returns the agent's reply (`--input` must include `"message"`).

```bash
agnt5 run my-workflow
agnt5 run data-processor --input '{"file": "data.json"}'
agnt5 run workflow my-workflow --env staging
agnt5 run agent support-bot --input '{"message": "reset my password"}'
agnt5 run my-workflow --deployment-id <deployment-id>
```

## `agnt5 components`

```bash
agnt5 components [options]
```

Lists registered components — functions, workflows, agents, and tools — for the current project.

| Flag | Description |
| --- | --- |
| `--type <type>`, `-t` | Filter by component type: `function`, `workflow`, `agent`, or `tool`. |

```bash
agnt5 components
agnt5 components --type workflow
```

## Next steps

- [Local development](/docs/cli/dev.md): start the worker `agnt5 run` targets by default.
- [Inspect & logs](/docs/cli/inspect.md): look up the run ID a `run` invocation produced and trace it.
- [Deploy commands](/docs/cli/deploy.md): deploy before running against a remote environment.
- [Evals](/docs/cli/evals.md): run components at scale against a dataset instead of one at a time.
