# pier config

> pier.yaml lifecycle: init, sync, diff, validate

URL: https://pier.run/docs/cli/reference/config

```bash
pier config <command>
```

pier.yaml lifecycle: init, sync, diff, validate.

## Subcommands

### pier config init

```bash
pier config init [flags]
```

Create a new project and write its pier.yaml.

| Flag             | Value    | Default     | Description                                                                                                                                                    |
| ---------------- | -------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-o`, `--output` |          | `pier.yaml` | Output file path                                                                                                                                               |
| `--name`         | `STRING` |             | Project name for the new project (default: directory name). Required non-interactively — creating a server project should never be a silent side effect in CI. |

### pier config validate

```bash
pier config validate [<file>]
```

Validate pier.yaml syntax and references.

| Argument | Required | Description                              |
| -------- | -------- | ---------------------------------------- |
| `<file>` | no       | Path to pier.yaml (default: auto-detect) |

### pier config diff

```bash
pier config diff [<file>]
```

Show differences between pier.yaml and platform state.

| Argument | Required | Description                              |
| -------- | -------- | ---------------------------------------- |
| `<file>` | no       | Path to pier.yaml (default: auto-detect) |

### pier config sync

```bash
pier config sync [<file>] [flags]
```

Pull server state into pier.yaml (adopt an existing project, or update an existing file).

| Argument | Required | Description                              |
| -------- | -------- | ---------------------------------------- |
| `<file>` | no       | Path to pier.yaml (default: auto-detect) |

| Flag          | Value | Default | Description              |
| ------------- | ----- | ------- | ------------------------ |
| `-y`, `--yes` |       |         | Skip confirmation prompt |

[Global flags](/docs/cli/reference#global-flags) apply to every command.
