CLI Referencev0.1

Seedmancer CLI Documentation

A CLI tool to manage and reset database test data. Export database snapshots as CSV, seed them back on demand, fetch from the cloud, and generate realistic data with AI.

Overview

Seedmancer helps developers reset databases to a known state instantly. It stores test data as plain CSV files versioned by name, making it easy to check in, share, and restore across machines and CI pipelines.

Fast Database Reset

Restore your database to any saved version in seconds.

Test Data Versioning

Save and manage multiple named test data versions locally and in the cloud.

AI-Powered Generation

Generate realistic seed data from a natural language prompt using OpenAI.

Cloud Sync

Fetch pre-built versions from Seedmancer cloud with a single command.

Installation

Download the pre-built binary for your platform from GitHub Releases.

Linux (arm64)

curl -L https://github.com/KazanKK/seedmancer/releases/download/v0.1.0/seedmancer_Linux_arm64 -o seedmancer
chmod +x seedmancer
mv seedmancer /usr/local/bin/seedmancer

Linux (x86_64)

curl -L https://github.com/KazanKK/seedmancer/releases/download/v0.1.0/seedmancer_Linux_x86_64 -o seedmancer
chmod +x seedmancer
mv seedmancer /usr/local/bin/seedmancer

macOS (arm64)

curl -L https://github.com/KazanKK/seedmancer/releases/download/v0.1.0/seedmancer_Darwin_arm64 -o seedmancer
chmod +x seedmancer
sudo mv seedmancer /usr/local/bin/seedmancer

Quick Start

Get up and running in three commands.

1

Initialize project

seedmancer init

Creates seedmancer.yaml and the storage directory in your project root.

2

Export database snapshot

seedmancer export \
  --database-name mydb \
  --version-name baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

Saves schema.json and one CSV per table under .seedmancer/databases/mydb/baseline/.

3

Restore to that snapshot

seedmancer seed \
  --database-name mydb \
  --version-name baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

Wipes existing data and reloads from the exported CSV files.

Configuration File

Seedmancer reads seedmancer.yaml from your project root. All flag values can be set here so you don't need to repeat them on every command.

storage_path: .seedmancer
database_name: mydb
database_url: postgres://user:pass@localhost:5432/mydb
KeyDescriptionDefault
storage_pathDirectory where exported data is stored.seedmancer
database_nameDefault database name used by export / seed / generate
database_urlPostgreSQL connection URL
Commands

seedmancer init

Initialize a new Seedmancer project. Creates seedmancer.yaml and the storage directory. When run interactively in a terminal, prompts for each value. Existing values in seedmancer.yaml are used as defaults.

FlagDescriptionRequiredEnv / Default
--storage-pathDirectory to store exported data filesNo(prompted)
--database-nameDefault database name for export / seed commandsNo(prompted)
--database-urlDefault PostgreSQL connection URLNo(prompted)

Example

seedmancer init

# Non-interactive (CI)
seedmancer init \
  --storage-path .seedmancer \
  --database-name mydb \
  --database-url "postgres://user:pass@localhost:5432/mydb"

seedmancer export

Export the current database schema and data to local CSV files. Creates schema.json (table definitions) and one .csv file per table inside the version directory.

FlagDescriptionRequiredEnv / Default
--database-nameLogical name for this database (used as directory name)Yes
--version-nameVersion label for this snapshotNounversioned
--db-urlPostgreSQL connection URLNoSEEDMANCER_DATABASE_URL

Example

seedmancer export \
  --database-name mydb \
  --version-name baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

# Output: .seedmancer/databases/mydb/baseline/
#   schema.json
#   users.csv
#   orders.csv
#   ...
  • You can directly edit the exported CSV files to adjust test data.
  • Do not manually edit schema.json — it is read by the seed command to recreate the correct structure.
  • --db-url falls back to database_url in seedmancer.yaml when omitted.

seedmancer seed

Restore the database to a previously exported version. Drops existing data in each table and reloads it from the saved CSV files in the version directory.

FlagDescriptionRequiredEnv / Default
--database-nameName of the database (matches the export directory)Yes
--version-nameVersion to restoreYes
--db-urlPostgreSQL connection URLNoSEEDMANCER_DATABASE_URL

Example

seedmancer seed \
  --database-name mydb \
  --version-name baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

# CI / Docker Compose (env var)
export SEEDMANCER_DATABASE_URL="postgres://user:pass@db:5432/mydb"
seedmancer seed --database-name mydb --version-name baseline
  • Only PostgreSQL is supported in this release.
  • The seed command reads from .seedmancer/databases/<database-name>/<version-name>/.

seedmancer list

List all available databases and test data versions. By default shows both local (on disk) and remote (cloud) versions. Use --local or --remote to filter.

FlagDescriptionRequiredEnv / Default
--localShow only local databases and versionsNofalse
--remoteShow only remote (cloud) databases and versionsNofalse
--tokenSeedmancer API token (required for remote listing)NoSEEDMANCER_API_TOKEN

Example

# List both local and remote
seedmancer list --token <your-api-token>

# Local only
seedmancer list --local

# Remote only
export SEEDMANCER_API_TOKEN=<your-api-token>
seedmancer list --remote

seedmancer fetch

Download a database schema and test data version from the Seedmancer cloud API and extract it into your local storage directory. Replaces any existing local version with the same name.

FlagDescriptionRequiredEnv / Default
--database-nameDatabase name to fetch (must match the cloud database name)Yes
--versionVersion name to fetchYes
--tokenSeedmancer API tokenYesSEEDMANCER_API_TOKEN

Example

seedmancer fetch \
  --database-name mydb \
  --version baseline \
  --token <your-api-token>

# Using environment variable
export SEEDMANCER_API_TOKEN=<your-api-token>
seedmancer fetch --database-name mydb --version baseline
  • After fetching, run seedmancer seed to apply the downloaded version to your database.
  • Fetched files are saved under .seedmancer/databases/<database-name>/<version>/.

seedmancer generate

Generate realistic seed data from a natural language prompt using OpenAI. Reads the live database schema, asks GPT-4o to produce a Go script, runs it, and saves the output as CSV files ready to be seeded.

FlagDescriptionRequiredEnv / Default
--promptNatural language description of the data to generateYes
--api-keyOpenAI API key (persisted to ~/.seedmancer/config.yaml for future use)NoOPENAI_API_KEY
--db-urlPostgreSQL connection URL to read the schema fromNoSEEDMANCER_DATABASE_URL
--database-nameLogical database name (overrides database_name in seedmancer.yaml)No
--version-nameVersion label for the generated dataNoYYYYMMDDHHMMSS_<db>

Example

seedmancer generate \
  --prompt "50 users with realistic names and emails, 200 orders each with a random user" \
  --api-key sk-... \
  --db-url "postgres://user:pass@localhost:5432/mydb" \
  --database-name mydb \
  --version-name ai-generated

# Then seed it
seedmancer seed --database-name mydb --version-name ai-generated
  • Requires Go to be installed on the machine — the generated script is executed with go run.
  • The OpenAI API key is persisted to ~/.seedmancer/config.yaml after the first use, so --api-key is only needed once.
  • Only PostgreSQL is supported for schema export in this release.
  • Generated data is deterministic: the script uses math/rand seeded with 42.

Environment Variables

All sensitive values can be provided as environment variables instead of flags. Environment variables take lower priority than explicit flags.

VariableEquivalent FlagUsed by
SEEDMANCER_DATABASE_URL--db-urlexport, seed, generate
SEEDMANCER_API_TOKEN--tokenlist, fetch
OPENAI_API_KEY--api-keygenerate
export SEEDMANCER_DATABASE_URL="postgres://user:pass@localhost:5432/mydb"
export SEEDMANCER_API_TOKEN="your-api-token"
export OPENAI_API_KEY="sk-..."

seedmancer export --database-name mydb --version-name v1
seedmancer seed   --database-name mydb --version-name v1
seedmancer fetch  --database-name mydb --version v1
seedmancer list   --remote
Seedmancer CLI — MIT LicenseGitHubTelegramUpdated March 25, 2026