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

# Commands

> Run, inspect, and create migrations from the command line

<Info>
  **Prerequisites**:

  * A `clisma.hcl` config file in the current directory, or pass `--config`
</Info>

Clisma ships a CLI for applying and inspecting migrations.

## Commands

### run

Apply pending migrations.

```bash theme={null}
clisma run --env local
```

### status

Show applied and pending migrations.

```bash theme={null}
clisma status --env local
```

### create

Create a new migration file.

```bash theme={null}
clisma create --name create_users_table
```

If you omit `--name`, the CLI will prompt you.

Migration filenames use the `YYYYMMDDhhmmss_<name>.sql` format.

### checksum

Print the SHA-256 checksum for a migration file.

```bash theme={null}
clisma checksum ./migrations/20240101123045_create_users.sql
```

## Flags

* **`--env <name> — environment from config file.`**

  Example: `--env production`
* **`--config <path> — path to config file.`**

  Example: `--config ./clisma.hcl`
* **`--var <key=value> — set variable value (repeatable).`**

  Example: `--var ttl_days=30 --var replication_factor=3`
* **`--env-file <path> — load env vars from file.`**

  Example: `--env-file .env`

## Advanced usage

Run with a custom config path and multiple variables:

```bash theme={null}
clisma run --config ./infra/clisma.hcl --env staging --var ttl_days=30 --var replication_factor=2
```
