---
title: "Fleet & Machines"
canonical: https://trickest.com/docs/developer-tools/cli/fleet
description: "List fleets, inspect machines, and watch fleet status from the trickest CLI."
---

# Fleet & Machines

**Fleets** are pools of execution machines: managed (Trickest-hosted) or
self-hosted. Workflow runs target a fleet via `run execute --fleet`.

<Info>
Concepts and UI: [Machines & Fleet](/docs/key-concepts/machines-and-fleet) and
[Using self-hosted machines](/docs/using-the-app/private-execution-networking/using-self-hosted-machines).
</Info>

## Command summary

| Subcommand | Description |
|---|---|
| `fleet ls` | List fleets |
| `fleet info\|get <id>` | Fleet details |
| `fleet create <name>` | Create a fleet |
| `fleet machines [fleet-id]` | List machines |
| `fleet watch [fleet-id]` | Live machine status (Ctrl+C to stop) |
| `fleet rm <id>` | Delete (not supported yet) |
| `fleet scale <id> <count>` | Scale (not supported yet) |

## `fleet ls`

```bash
trickest fleet ls
```
```json
[{"id":"ed56ede8-…","name":"Self-hosted fleet","type":"HOSTED","machines":{"active":1,"inactive":2,"max":3},"default":false},
 {"id":"0ca38cb7-…","name":"Managed fleet","type":"MANAGED","machines":{"active":0,"inactive":200,"max":200}}]
```

Each fleet reports machine counts (`active`, `deleting`, `inactive`, `max`) and
whether it is the default fleet for runs.

## `fleet info` / `machines` / `watch`

```bash
trickest fleet info ed56ede8-…
trickest fleet machines ed56ede8-…
trickest fleet watch ed56ede8-…
```

Use `fleet watch` during provisioning or teardown to see machines transition
without polling `fleet machines` manually.

## `fleet create`

```bash
trickest fleet create "Edge scanners"
```

Run `trickest fleet create --help` for host-type and cluster options on your
version.

## Platform limitations

<Warning>
`fleet rm` and `fleet scale` exist in the CLI but the platform does not support
them yet. The CLI help text directs you to provision or destroy
machines individually instead. Treat 405 / "not supported" responses as a platform
gate, not an auth failure.
</Warning>

## `trickest attach`

Enroll the machine you are running on as a self-hosted worker. This is the same
flow the **Connect a machine** panel in **Settings > Infrastructure > Fleet**
copies for you:

```bash
trickest attach
trickest attach --name lab-01 --timeout 5m
trickest attach --wait --yes --api-base https://api.trickest.io
trickest attach --no-install     # provision only; prints the install script
```

`attach` resolves your self-hosted fleet (and creates one when none exists),
provisions a machine slot, installs the Trickest Agent on the current host, and
waits until the machine reports **ACTIVE** (polls every 5s, default timeout
`2m`).

| Flag | Description |
|---|---|
| `--fleet <id>` | Self-hosted fleet to attach to (default: your only hosted fleet, created if none) |
| `--name <name>` | Display name for the machine (default: hostname) |
| `--no-install` | Provision the machine and print the install command instead of running it |
| `--wait` / `--no-wait` | Wait for ACTIVE after install (waiting is the default) |
| `--timeout <duration>` | Max time to wait for ACTIVE (default `2m`) |
| `--yes` | Run the installer non-interactively |
| `--agent-version <version>` | Agent version channel to install (default `latest`) |
| `--api-base <url>` | Hive API the agent registers with (default: resolved from this platform, else `https://api.trickest.io`) |

Docker must be running on the host. See
[Using Self-Hosted Machines](/docs/using-the-app/private-execution-networking/using-self-hosted-machines)
for host requirements and the in-app connect panel.

## `trickest machine`

Inspect attached machines:

| Subcommand | Description |
|---|---|
| `machine ls` | List machines in a fleet |
| `machine status <id>` | Show one machine's connectivity state (`ACTIVE`, `INACTIVE`, `DELETING`) |
| `machine watch <id>` | Follow a machine's status live (Ctrl+C to stop) |

## Using a fleet in runs

```bash
trickest run execute --fleet "Managed fleet" --watch
trickest run get <run-id> | jq '.fleet'
```

## Related

<CardGroup cols={2}>
  <Card title="Runs & Outputs" icon="play" href="/docs/developer-tools/cli/runs">
    Execute workflows on a chosen fleet.
  </Card>
  <Card title="Machines & Fleet (concepts)" icon="gear" href="/docs/key-concepts/machines-and-fleet">
    Managed vs self-hosted fleets and machine lifecycle.
  </Card>
</CardGroup>

---
_Markdown source of https://trickest.com/docs/developer-tools/cli/fleet._
