> ## 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 list

> List the infrastructure resources defined in a Fjall application on AWS

<Info>
  **Read-only command.** Lists the resources declared in an application's `infrastructure.ts`. It does not query AWS or change anything.
</Info>

## Overview

`fjall list` reads an application's `infrastructure.ts` and prints every resource the codemod engine manages: databases, storage, compute, and the rest. Use it to confirm what a `fjall add` or `fjall remove` left behind before you deploy.

For an organisation or application overview, use `fjall apps` (lists applications) or `fjall status` (shows deployment status). `fjall list` works on a single application's resource declarations only.

## Prerequisites

* An application created with `fjall create app`, so an `infrastructure.ts` file exists.
* Run the command from your project root (where the `fjall/` directory lives).

## Usage

```bash theme={null}
fjall list [type] --app <name>
# or use the alias
fjall ls [type] --app <name>
```

The `--app` flag is required. The optional `[type]` positional filters the output to one resource type.

## Options

| Option              | Description                                                       |
| ------------------- | ----------------------------------------------------------------- |
| `-a, --app <name>`  | Application that owns the `infrastructure.ts` file. **Required.** |
| `[type]`            | Filter to one resource type (positional argument).                |
| `--json`            | Emit the resource list as JSON to stdout.                         |
| `-v, --verbose`     | Enable verbose logging.                                           |
| `--non-interactive` | Force plain CLI output (no UI).                                   |
| `--agent`           | Enable agent output mode.                                         |
| `--budget <level>`  | Output budget: `minimal`, `compact`, or a token count.            |
| `--fields <fields>` | Request additional fields in the output.                          |
| `--full`            | Disable content truncation.                                       |

### Resource types for `[type]`

| Value               |                         |
| ------------------- | ----------------------- |
| `database`          | `messaging`             |
| `storage`           | `cdn`                   |
| `compute`           | `network`               |
| `pattern`           | `vpc-peer`              |
| `vpc-peer-accepter` | `cross-plan-connection` |

## Examples

### List every resource

```bash theme={null}
fjall list --app api
```

Output:

```
Resources in api: 3
  AppDatabase           database    fjall/api/infrastructure.ts
  AssetBucket           storage     fjall/api/infrastructure.ts
  ApiService            compute     fjall/api/infrastructure.ts
```

The header shows the application name and the resource count. Each row lists the resource name, its type, and the file it lives in.

### Filter by type

Pass a resource type to narrow the output:

```bash theme={null}
fjall list database --app api
```

Output:

```
Resources in api (type=database): 1
  AppDatabase           database    fjall/api/infrastructure.ts
```

### JSON output

For scripts and tooling, emit the resource list as JSON:

```bash theme={null}
fjall list --app api --json
```

```json theme={null}
[
  {
    "name": "AppDatabase",
    "type": "database",
    "filePath": "fjall/api/infrastructure.ts"
  }
]
```

### Empty application

A newly created application with no added resources prints a zero count:

```bash theme={null}
fjall list --app web
```

```
Resources in web: 0
```

## How it works

1. Resolves the `infrastructure.ts` path for the application you pass to `--app`.
2. Parses the file with the codemod engine (an AST parser, no AWS calls).
3. Collects every managed resource declaration.
4. Applies the `[type]` filter if you passed one.
5. Prints the result as a table, or as JSON with `--json`.

The command reads local files only. It never contacts AWS and never reports deployment status.

## Common workflows

### Confirm an added resource

```bash theme={null}
fjall add database --name AppDatabase --type Aurora --app api
fjall list --app api
# Shows: AppDatabase    database    fjall/api/infrastructure.ts
```

### Confirm a removed resource

`fjall remove` deletes a resource from `infrastructure.ts`. List afterwards to verify the file no longer declares it:

```bash theme={null}
fjall remove storage --name OldBucket --app api
fjall list storage --app api
```

### Inspect before deploying

```bash theme={null}
fjall list --app api
fjall deploy api
```

## Troubleshooting

### "Application is required"

The `--app` flag is mandatory. Pass the application name:

```bash theme={null}
fjall list --app api
```

### Resource missing from the list

If a resource you expected does not appear:

* Confirm you passed the right application to `--app`.
* Check the `[type]` filter is not hiding it. Run `fjall list --app api` with no type to see everything.
* Verify the resource was added to `infrastructure.ts` (re-run `fjall add` if needed).

<Note>
  `fjall list` reflects only what is declared in `infrastructure.ts`. To check what is actually deployed to AWS, use `fjall status`.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="fjall add" icon="plus" href="/cli/add">
    Add a resource to an application's infrastructure.
  </Card>

  <Card title="fjall create" icon="folder-plus" href="/cli/create">
    Create an application with its `infrastructure.ts` file.
  </Card>

  <Card title="fjall deploy" icon="rocket" href="/cli/deploy">
    Deploy an application's infrastructure to AWS.
  </Card>

  <Card title="fjall destroy" icon="trash" href="/cli/destroy">
    Tear down deployed infrastructure for a target.
  </Card>
</CardGroup>
