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

# fjall accounts

> List the connected AWS accounts Fjall can deploy to, read each account's stage and ID, and emit strict JSON for scripts and agents.

`fjall accounts` lists the provider accounts in your organisation that carry a workload stage. It is read-only and never touches AWS.

<Warning>
  **`accounts` (plural) lists. `account` (singular) deploys.**

  `fjall accounts` prints provider accounts. `fjall account deploy` and `fjall account destroy` operate on the account tier's infrastructure. The two commands are one character apart and do completely different things.
</Warning>

<Accordion title="Prerequisites">
  * Node.js 22 or later with the Fjall CLI installed
  * A signed-in session (`fjall login`), because the account list comes from your organisation config over the Fjall API
  * At least one connected AWS account (`fjall connect`)

  No project directory and no `infrastructure.ts` are required. Run this command from anywhere.
</Accordion>

## List connected accounts

```bash theme={null}
fjall accounts [subcommand]
```

`list` is the only supported subcommand, and it is the default when the positional is omitted.

```bash theme={null}
# List provider accounts
fjall accounts

# Same thing, written out
fjall accounts list

# Machine-readable output for scripts and agents
fjall accounts list --output json
```

Pipe the JSON form into `jq` to pull a single field:

```bash theme={null}
fjall accounts list --output json | jq -r '.accounts[].name'
```

## What Happens

The command runs two steps, then prints and exits.

| Step              | Action                                              |
| ----------------- | --------------------------------------------------- |
| `fetch-config`    | Fetches your organisation config from the Fjall API |
| `filter-accounts` | Keeps only accounts whose tier is `account`         |

Organisation-tier and platform-tier accounts are filtered out. What remains is the set of accounts that hold workloads, which is why the command is an alias surface for non-structural deployment targets.

### Human output

```
Provider accounts (2):
  production  [production]  id=123456789012
  staging  [staging]  id=210987654321 (managed)
```

Each line carries the account name, the workload stage in brackets, and the AWS account ID. An account with no stage recorded prints `[no stage]`. A `(managed)` suffix appears when the account record carries the managed flag.

With no matching accounts, the command prints:

```
No deployable accounts. Connect an AWS account first with 'fjall connect'.
```

### JSON output

`--output json` writes exactly one line of strict JSON to stdout, with no banners or progress lines:

```text theme={null}
{"accounts":[{"id":"123456789012","name":"production","environment":"production"}]}
```

| Field         | Type             | Description                                           |
| ------------- | ---------------- | ----------------------------------------------------- |
| `id`          | string           | AWS account ID                                        |
| `name`        | string           | Account name                                          |
| `environment` | string or `null` | Workload stage, `null` when none is recorded          |
| `managed`     | boolean          | Present only when the account record carries the flag |

### Failures

A failed fetch (not signed in, no organisation, network error) exits `1`.

* Human mode writes `Failed to list accounts: <message>` to stderr.
* JSON mode writes one line of `{"ok":false,"error":"<message>"}` to stdout.

### Agent mode

`fjall accounts` has no agent output path. Passing `--agent`, `--budget`, `--fields`, or `--full` is refused with an error naming the alternative rather than silently printing a human table. Use `fjall accounts list --output json` instead, which is the same surface the Fjall MCP server parses.

## Options

| Flag                | Description                                                            | Default |
| ------------------- | ---------------------------------------------------------------------- | ------- |
| `--output <format>` | Output format: human or json (json emits a single line of strict JSON) | `human` |
| `--non-interactive` | Force plain CLI output (no UI)                                         | off     |
| `-v, --verbose`     | Enable verbose output                                                  | off     |

The command always prints plain text, so `--non-interactive` changes nothing about its output.

## Next Steps

<CardGroup cols={2}>
  <Card title="fjall connect" icon="plug" href="/cli/connect">
    Connect an AWS account so it appears in this list.
  </Card>

  <Card title="Deploy an account" icon="layer-group" href="/deployment/deploy-account">
    Use `fjall account deploy` (singular) to deploy the account tier.
  </Card>

  <Card title="fjall deploy" icon="rocket" href="/cli/deploy">
    Deploy an application into one of these accounts.
  </Card>

  <Card title="Deploy an organisation" icon="sitemap" href="/deployment/deploy-organisation">
    Set up the organisation and platform tiers above your accounts.
  </Card>
</CardGroup>
