ColdPlaneDocs
CLI Reference

Commands

All available ColdPlane CLI commands.

auth set-key

Set your API key for authentication.

coldplane auth set-key --key <api-key>
OptionRequiredDescription
--key, -kYesAPI key (recommended format: <id>:<secret>)

Your credentials are saved to ~/.coldplane/config.json.

auth whoami

Show the currently authenticated user.

coldplane auth whoami

backup create

Archive one or more tables from your database.

coldplane backup create [options]
OptionRequiredDescription
--db-url, -dYesDatabase connection string (postgres:// or mysql://)
--tablesYesComma-separated list of table names to archive
--nameNoHuman-friendly name for the backup (auto-generated if omitted)
--chunk-sizeNoRows per chunk (default: 2500000)
--workersNoNumber of parallel workers (default: 4)
--format, -fNoExport format (default: parquet)
--whereNoSQL WHERE clause to filter rows (e.g. "created_at < '2025-01-01'")
--localNoStore backup locally instead of uploading to ColdPlane Cloud. No account or API key required.

Example:

coldplane backup create \
  --db-url "postgres://user:pass@host:5432/mydb" \
  --tables "events,logs"

Local backup (no account required):

coldplane backup create --local \
  --db-url "postgres://user:pass@host:5432/mydb" \
  --tables "events,logs"

Local backups are saved to ~/.coldplane/backups/<name>/ as Parquet files.

backup list

List existing backups. Aliases: backup ls

coldplane backup list [options]
OptionRequiredDescription
--limit, -nNoMax number of backups to display (default: 10)
--allNoShow all backups (overrides --limit)
--statusNoFilter by status: running, completed, failed
--dbNoFilter by database name
--tableNoFilter by table name
--nameNoFilter by backup name
--localNoList local backups only

backup describe

Show detailed information about a backup. Aliases: backup get

coldplane backup describe <backup-id> [--json]
OptionRequiredDescription
--jsonNoOutput raw JSON instead of formatted table

backup delete

Delete a backup. Aliases: backup rm

coldplane backup delete <backup-id>
OptionRequiredDescription
--localNoDelete a local backup by name

Delete a local backup:

coldplane backup delete --local my_backup_name

backup restore

Restore archived data into a target database.

coldplane backup restore [options]
OptionRequiredDescription
--backup-idYesBackup ID to restore from
--tableYesTarget table name in the destination database
--toYesTarget database connection string (postgres:// or mysql://)

Example:

coldplane backup restore \
  --backup-id bck_abc123 \
  --table events_restored \
  --to "postgres://user:pass@host:5432/mydb"

query run

Execute a SQL query against an archived backup.

coldplane query run [options]
OptionRequiredDescription
--backup-id, -bYesBackup ID to query
--table, -tNoTable name
--sql, -sYesSQL query (a default LIMIT is applied if omitted)
--output, -oNoOutput format: table, json, or csv (default: table)
--exportNoExport full results to a downloadable file
--formatNoExport file format: csv or parquet (default: csv)
--localNoQuery a local backup directly on your machine. No account or API key required.

Example:

coldplane query run \
  --backup-id bck_abc123 \
  --table events \
  --sql "SELECT user_id, COUNT(*) FROM events GROUP BY user_id" \
  --output table

Local query (no account required):

coldplane query run --local \
  --backup-id events_20250101_120000 \
  --sql "SELECT user_id, COUNT(*) FROM restore_input GROUP BY user_id" \
  --output table

For local queries, --backup-id accepts the backup name or path. The default table view is restore_input.

convert

Convert a backup into a different database engine (e.g. MySQL to PostgreSQL).

The convert command requires a Pro plan or higher.

coldplane convert [options]
OptionRequiredDescription
--backup-idYesBackup ID to convert
--toYesTarget database connection string

Example:

coldplane convert \
  --backup-id bck_abc123 \
  --to "postgres://user:pass@host:5432/newdb"

analyze

Analyze database tables to find old data. Connects read-only to your database and reports how much data is older than a given threshold. No data leaves your machine. No account required.

Old data is not necessarily stale — you know your data best. Use the results to decide what to archive.

coldplane analyze [options]
OptionRequiredDescription
--db-url, -dYesDatabase connection string (postgres:// or mysql://)
--tables*Comma-separated list of tables to analyze
--all*Analyze all tables in the database
--older-thanNoAge threshold (default: 18m). Supports 18m, 1y, 6m, 90d, 1y6m
--date-columnNoColumn to use for age detection (auto-detected if omitted)
--jsonNoOutput results as JSON

* Either --tables or --all is required.

Analyze specific tables:

coldplane analyze \
  --db-url "postgres://user:pass@host:5432/mydb" \
  --tables "orders,events"

Analyze all tables with custom threshold:

coldplane analyze \
  --db-url "mysql://user:pass@host:3306/mydb" \
  --all --older-than 1y

Override the date column:

coldplane analyze \
  --db-url "postgres://user:pass@host:5432/mydb" \
  --tables "users" \
  --date-column "last_login"

JSON output for CI/CD:

coldplane analyze \
  --db-url "postgres://user:pass@host:5432/mydb" \
  --all --json

The command prints a summary table with row counts, detected date columns, and estimated archive sizes. It ends with a copy-paste-ready backup create command including the --where clause to archive only the old data.

version

Print the CLI version and build information.

coldplane version

completion

Generate shell completion scripts.

coldplane completion [bash|zsh|fish|powershell]