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

# Installation and Quickstart

> Install clisma and run your first ClickHouse migration

<Info>
  **Prerequisites**:

  * Access to a ClickHouse instance and credentials
  * A project directory where you can add `clisma.hcl`
</Info>

clisma is a ClickHouse migration tool with templating support and environment configuration.

## Installation

```bash theme={null}
npm install --save-dev clisma
```

Or install it globally:

```bash theme={null}
npm install -g clisma
```

## Quickstart

<Steps>
  <Step title="Create a config">
    Create `clisma.hcl` in your project root:

    ```hcl theme={null}
    env "local" {
      url = "http://default:password@localhost:8123/mydb"

      migrations {
        dir = "migrations/clickhouse"
      }
    }
    ```
  </Step>

  <Step title="Create your first migration">
    ```bash theme={null}
    clisma create
    ```
  </Step>

  <Step title="Run it">
    ```bash theme={null}
    clisma run --env local
    ```
  </Step>

  <Step title="Check status">
    ```bash theme={null}
    clisma status --env local
    ```
  </Step>
</Steps>

## Advanced usage

You can pass variables and load environment files when you run migrations:

```bash theme={null}
clisma run --env local --var ttl_days=30 --env-file .env
```
