Skip to main content
Create a snapshot from your config and source database. Authentication is required. basecut snapshot create always needs an API key before extraction starts. Provide it with --api-key, BASECUT_API_KEY, or a saved profile from basecut login.

Usage

basecut snapshot create --config <path> [flags]

Flags

FlagRequiredDescription
--config <path>, -cYesPath to basecut.yml.
--name <string>, -nNoSnapshot name. Must be provided via --name or name in config.
--source <url>, -sLocalSource connection string for local execution. Required whenever the command runs locally (the default). Optional only when using --async with a non-local output provider.
--connect-timeout <duration>10sTimeout for initial source DB connection in local mode (for example 5s, 30s).
--asyncNoQueue for agent execution (TEAM plan). Ignored when output provider is local (for example output: ./snapshots), and the command runs locally instead.
--tag <string>, -tNoVersion tag.
--gitNoAttach git metadata.
--profile <name>NoCredential profile used to resolve API key.
--api-key <key>NoAPI key override (otherwise uses BASECUT_API_KEY or the selected profile).

Examples

Basic Local Example

basecut snapshot create \
  --config basecut.yml \
  --source "$DATABASE_URL" \
  --name "dev-seed"

Agent Example

basecut snapshot create \
  --config basecut.yml \
  --name "nightly-seed" \
  --async
--async only queues an agent job when the config output provider is non-local. If your config uses local output (for example output: ./snapshots), --async is ignored and local execution still requires --source or BASECUT_DATABASE_URL. Track async job progress with:
basecut snapshot status <job-id>

Config Example

version: '1'
name: 'dev-seed'

from:
  - table: users
    where: 'id = :id'
    params:
      id: 1

traverse:
  parents: 10
  children: 2

limits:
  rows:
    per_table: 1000
    total: 100000

anonymize: auto
output: ./snapshots
See YAML Reference for full config options.