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

> Validate a Fjall application's infrastructure.ts on AWS, catching parse and type errors before you deploy

<Info>
  **Read-only command.** Parses an application's `infrastructure.ts` with the codemod engine and reports whether it is valid. It does not query AWS or change any files.
</Info>

<Accordion title="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).
  * For `--deep` validation, the application's TypeScript toolchain must resolve (`fjall` workspace dependencies installed). Node 22 or later is required.
</Accordion>

## Validate an application

```bash theme={null}
fjall validate --app <name>
```

Validate the `infrastructure.ts` for a single application:

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

Run a deep check that also type-checks the file with `tsc --noEmit`:

```bash theme={null}
fjall validate --app web --deep
```

The `--app` flag is required. Without `--deep`, the command parses the file only. With `--deep`, it additionally surfaces any TypeScript type errors.

## What Happens

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. Reports `Parse: OK` when the file is structurally valid.
4. With `--deep`, runs `tsc --noEmit` and reports `Typecheck: OK` or `Typecheck: FAILED` with the type errors.

The command reads local files only. It never contacts AWS, writes to `infrastructure.ts`, or touches the `.fjall` history directory. There is nothing to dry-run, because nothing is mutated.

A successful parse prints the file path:

```
Parse: OK (fjall/api/infrastructure.ts)
Validated
```

A deep run appends the type-check result:

```
Parse: OK (fjall/web/infrastructure.ts)
Typecheck: OK
Validated
```

A failed parse or type-check exits with a non-zero status and prints the offending error, so you can wire `fjall validate` into a CI gate before `fjall deploy`.

### Agent mode

Pass `--agent` to emit structured output for AI agents. The result includes `parse`, `typecheck` (`ok`, `failed`, or `skipped` when `--deep` is absent), and the resolved file `path`. A failed deep type-check exits non-zero.

## Options

| Option              | Description                                            | Default |
| ------------------- | ------------------------------------------------------ | ------- |
| `-a, --app <name>`  | Application to validate. **Required.**                 | None    |
| `--deep`            | Also run `tsc --noEmit` and surface any type errors.   | `false` |
| `-v, --verbose`     | Enable verbose logging.                                | `false` |
| `--non-interactive` | Force plain CLI output (no UI).                        | `false` |
| `--agent`           | Enable agent output mode.                              | `false` |
| `--budget <level>`  | Output budget: `minimal`, `compact`, or a token count. | None    |
| `--fields <fields>` | Request additional fields in the output.               | None    |
| `--full`            | Disable content truncation.                            | `false` |

## 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 list" icon="list" href="/cli/list">
    List the resources declared in an application's infrastructure.
  </Card>

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

  <Card title="Add resources" icon="layer-group" href="/deployment/add-resources">
    Learn how resources are declared and managed.
  </Card>
</CardGroup>
