Developers

CLI

Manage Cairn from your terminal. Datasets, backups and webhooks — every part of the platform that fits a script.

Built for automation

Script the parts of Cairn that aren't visual by nature

Branching and schema modelling stay in the Dashboard — that's where they belong. The CLI covers everything else: generating typed code, managing datasets and backups, wiring webhooks into CI, and validating a schema before it ships.

  • Generate typed code with a single command
  • Scriptable for CI and deploy pipelines
  • JSON output for piping into other tools
terminal
$ cairn --help

  typegen   generate typed code from your schema
  dataset   list and switch datasets
  backups   list, create, restore
  webhooks  manage endpoints
  schema    check schema before you merge

Fits your pipeline

Run schema checks before you merge

Add a single CLI call to CI to validate a branch's schema changes against existing content — read-only, the same check the Dashboard runs, available anywhere a shell script can run.

.github/workflows/cairn.yml
- name: Validate schema
  run: npx cairn schema check --branch ${{ github.head_ref }}

Command groups

The automation-friendly half of Cairn, from a shell

typegen

Generate real TypeScript types from your schema, on demand — by hand, in CI, or as a predev script.

dataset

List and switch datasets for any environment or locale.

backups

List, create and restore snapshots on demand or on a schedule.

Install the CLI

It ships with every project created via npm create cairn.