CLI ReferenceCLI reference

Seedmancer CLI Documentation

Save PostgreSQL snapshots as CSVs in your project, restore them anytime, connect your Seedmancer account, and generate state-based test data with cloud AI.

Overview

Reset your database to a saved state in seconds. Each dataset is a folder of CSVs plus schema.json. Name datasets what you like (baseline, api-test, a timestamp). Push to the cloud when you want backups or to share with your team.

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 generation (cloud)

Describe the data you need in plain English. Uses your plan's monthly AI allowance.

Cloud push & pull

Upload a dataset from your machine or download one someone else pushed.

MCP Server

Built-in Model Context Protocol server so AI agents (Cursor, Claude Code) can drive Seedmancer through typed tool calls.

Installation

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

Linux (arm64)

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

Linux (x86_64)

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

macOS (arm64)

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

Windows (x86_64) — PowerShell

curl.exe -L https://github.com/KazanKK/seedmancer/releases/latest/download/seedmancer_Windows_x86_64.exe -o seedmancer.exe
# Move to a folder on your PATH, e.g.:
Move-Item seedmancer.exe "$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps\seedmancer.exe"

Any platform — Go install

go install github.com/KazanKK/seedmancer@latest

Quick Start

From your project root (where seedmancer.yaml will live), run:

1

Initialize the project

seedmancer init

Creates seedmancer.yaml and .seedmancer/. Add a database URL when prompted, or use seedmancer env add later.

2

Sign in (cloud features)

seedmancer login

Opens the browser; saves your API token to ~/.seedmancer/credentials. Skip if you only export/seed offline.

3

Export a snapshot

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

If you omit --id, the CLI picks a timestamp id so repeated exports never overwrite by accident.

4

Restore that snapshot

seedmancer seed \
  --dataset-id baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

Uses --dataset-id (alias --id). Add --yes for CI. Named envs: configure seedmancer env then seedmancer seed --dataset-id baseline --env local.

Plans and limits

Free and Pro include different limits for cloud AI generation and how many dataset versions you keep synced. Working only on your machine (export, seed) does not use those cloud limits. See your live numbers on Billing. Typical defaults:

LimitFreePro
AI generations / month5200
Cloud synced dataset versions5200
Max rows per table (generated)100100,000

Authentication

Commands that talk to Seedmancer online (generate, push, pull, and remote list) need an API token. Run seedmancer login to sign in from the browser (token is saved to ~/.seedmancer/credentials), or create a token under Dashboard → API token and set SEEDMANCER_API_TOKEN. Some optional features need a Pro plan.

seedmancer login
# or
export SEEDMANCER_API_TOKEN="sk_..."

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
default_env: local
database_url: postgres://user:pass@localhost:5432/mydb

# Named databases for seedmancer seed --env local,staging
environments:
  local:
    database_url: postgres://user:pass@localhost:5432/mydb
KeyDescriptionDefault
storage_pathDirectory for schema folders and datasets.seedmancer
default_envUsed when you omit --env on export/seed
database_urlSingle database URL (optional if you use environments)
environments.<name>.database_urlNamed database URL (see seedmancer env)

On-disk layout

Every export is stored under .seedmancer/schemas/<fp-short>/ where fp-short is the first 12 characters of a SHA-256 hash of your schema. Multiple datasets share one schema folder — two projects with identical schemas share the same fingerprint.

.seedmancer/
  schemas/
    a1b2c3d4e5f6/
      schema.json
      meta.yaml
      *_func.sql
      *_trigger.sql
      datasets/
        baseline/
          users.csv
          orders.csv
        20260420153022/
          users.csv
          ...
  • You can hand-edit the CSV files to curate test data. Never edit schema.json by hand.
  • The .seedmancer folder is safe to commit to git — it contains no secrets.
  • seedmancer pull places downloaded datasets in the same layout so seedmancer seed works immediately.
Commands

Global Flags

FlagDescriptionEnv
--debugShow detailed debug output for any commandSEEDMANCER_DEBUG

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-urlDefault PostgreSQL connection URLNo(prompted)

Example

seedmancer init

# Non-interactive (CI)
seedmancer init \
  --storage-path .seedmancer \
  --database-url "postgres://user:pass@localhost:5432/mydb"
  • After the first export, Seedmancer knows your schema from the files on disk.

seedmancer export

Export your database into your project: table data as CSVs, plus schema.json and any function/trigger SQL files. Data lives under .seedmancer/schemas/<short-id>/datasets/<dataset-id>/.

FlagDescriptionRequiredEnv / Default
--idDataset id (omit for a timestamp id so repeat exports do not overwrite)Notimestamp
--env, -eNamed environment to read fromNo
--db-urlSource PostgreSQL URL (overrides --env for this run)NoSEEDMANCER_DATABASE_URL
--force, -yOverwrite an existing dataset without confirmationNofalse
--tokenAPI token (needed for some Pro-only options)NoSEEDMANCER_API_TOKEN

Example

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

# Files appear under .seedmancer/schemas/<short-id>/datasets/baseline/
  • Exports from the same database layout reuse the same folder.
  • Edit CSVs if you like; do not edit schema.json by hand.
  • Use seedmancer env when you have several databases to target.

seedmancer seed

Load a saved dataset into PostgreSQL: tables are cleared and refilled from CSVs, and SQL for functions/triggers is reapplied.

FlagDescriptionRequiredEnv / Default
--dataset-id, --id, -dDataset id to restoreYes
--env, -eComma-separated env names (e.g. local,staging)No
--db-urlSingle ad-hoc target URL (mutually exclusive with --env)NoSEEDMANCER_DATABASE_URL
--yes, -y, -fSkip confirmation prompts (CI)No
--continue-on-errorContinue with remaining envs after a failureNo
--tokenAPI token (for some Pro-only options)NoSEEDMANCER_API_TOKEN

Example

seedmancer seed \
  --dataset-id baseline \
  --db-url "postgres://user:pass@localhost:5432/mydb"

seedmancer seed --dataset-id baseline --env local --yes

export SEEDMANCER_DATABASE_URL="postgres://user:pass@db:5432/mydb"
seedmancer seed --dataset-id baseline --yes
  • Use a unique dataset id per project. If two copies collide, rename one.
  • PostgreSQL only today.

seedmancer list

Show all datasets on your machine and in your account.

FlagDescriptionRequiredEnv / Default
--tokenSeedmancer API token (required for remote listing)NoSEEDMANCER_API_TOKEN

Example

seedmancer list

export SEEDMANCER_API_TOKEN=<your-api-token>
seedmancer list
  • Local entries come from your .seedmancer folder.
  • Remote listing needs a token.

seedmancer pull

Download a dataset from the Seedmancer cloud into your local storage. Replaces any existing local folder for that dataset under the resolved schema.

FlagDescriptionRequiredEnv / Default
--dataset-id, --id, -dDataset id to downloadYes
--tokenSeedmancer API tokenNoSEEDMANCER_API_TOKEN

Example

seedmancer pull \
  --dataset-id baseline

export SEEDMANCER_API_TOKEN=<your-api-token>
seedmancer pull --dataset-id baseline
  • Then run seedmancer seed with the same dataset id.
  • Files are laid out like a local export.

seedmancer generate

Send your schema and a short prompt to Seedmancer; new CSVs are saved as a new dataset when the job finishes. Uses your monthly AI allowance.

FlagDescriptionRequiredEnv / Default
--promptNatural language description of the data to generateYes
--schema-idShort id for this schema on disk (skip if you only have one)No
--tokenAPI token (falls back to ~/.seedmancer/credentials, then SEEDMANCER_API_TOKEN)NoSEEDMANCER_API_TOKEN

Example

seedmancer generate \
  --prompt "50 users with realistic names and emails, 200 orders linked randomly to users" \
  --schema-id a1b2c3d4e5f6

# CLI prints the new dataset id, e.g. 20260428120000
seedmancer seed --dataset-id 20260428120000 --yes
seedmancer push --dataset-id 20260428120000
  • Run seedmancer export first so a local schema folder exists.

seedmancer push

Upload one local dataset to your Seedmancer account. Uploading the same name again replaces the previous copy.

FlagDescriptionRequiredEnv / Default
--dataset-id, --id, -dLocal dataset id to uploadYes
--tokenSeedmancer API tokenNoSEEDMANCER_API_TOKEN

Example

seedmancer push --dataset-id baseline

export SEEDMANCER_API_TOKEN=<your-api-token>
seedmancer push --dataset-id baseline
  • Counts toward your plan's synced dataset limit.
  • Open the dashboard → Schemas to see what’s online.

seedmancer schemas

List schemas, rename how they appear in the UI, or delete them. Use --local, --remote, or both.

FlagDescriptionRequiredEnv / Default
listShow local, remote, or both; add --json for scriptsNo
rename <ref> <name>Set or clear a friendly name (--clear)No
rm <ref>Delete (--local / --remote; --force skips the prompt)No
--tokenAPI token for remote list/rename/rmNoSEEDMANCER_API_TOKEN

Example

seedmancer schemas list
seedmancer schemas list --remote --json

seedmancer schemas rename a3f2b1 "Billing v2"
seedmancer schemas rename a3f2b1 --clear

seedmancer schemas rm a3f2b1 --force
  • <ref> is an id from the list, or the first few characters of the schema id.
  • Renaming only changes the label you see, not your files.

MCP Server (AI Agents)

Seedmancer includes a Model Context Protocol server so tools like Cursor or Claude Code can run Seedmancer actions for you.

Running the server

seedmancer mcp

# Optional: HTTP transport or log file — see seedmancer mcp --help
seedmancer mcp --transport http --addr :7801
seedmancer mcp --log-file /tmp/seedmancer-mcp.log

Cursor / Claude Code config

Add Seedmancer to your MCP host config. Cursor reads ~/.cursor/mcp.json (or project-level .cursor/mcp.json). Claude Code uses claude_code_config.json with the same mcpServers shape.

{
  "mcpServers": {
    "seedmancer": {
      "command": "seedmancer",
      "args": ["mcp", "--log-file", "/tmp/seedmancer-mcp.log"],
      "env": {
        "SEEDMANCER_API_TOKEN": "<optional; falls back to ~/.seedmancer/credentials>"
      }
    }
  }
}

Restart the host, then ask the agent something like:

Use the Seedmancer MCP to reset my database to the api-test dataset before running Playwright.

Your client lists every tool (export, seed, push, pull, and the rest). Destructive steps may ask for confirmation; seeding blocks obvious production-style database names unless you explicitly allow it.

Environment Variables

seedmancer login saves your token to ~/.seedmancer/credentials. You can also set SEEDMANCER_API_TOKEN. A --token flag on a command wins over both.

VariableEquivalent flagUsed by
SEEDMANCER_DATABASE_URL--db-urlexport, seed
SEEDMANCER_API_TOKEN--tokengenerate, push, pull, remote list, some Pro features
export SEEDMANCER_DATABASE_URL="postgres://user:pass@localhost:5432/mydb"
export SEEDMANCER_API_TOKEN="your-api-token"

seedmancer export --id v1
seedmancer push   --dataset-id v1
seedmancer pull  --dataset-id v1
seedmancer seed   --dataset-id v1 --yes
seedmancer list

Playwright

Reset your database to a known dataset once before the whole suite (via globalSetup), or before each test file. Every run starts from the same deterministic snapshot — no hand-written fixtures.

1. Global setup

// playwright.config.ts
import { defineConfig } from "@playwright/test"
import * as path from "node:path"

export default defineConfig({
  globalSetup: path.resolve(__dirname, "tests/global-setup.ts"),
})
// tests/global-setup.ts
import { spawnSync } from "node:child_process"
import * as path from "node:path"

export default async function globalSetup() {
  const result = spawnSync(
    "seedmancer",
    ["seed", "--id", "api-test", "--yes"],
    { cwd: path.resolve(__dirname, ".."), stdio: "inherit" }
  )
  if (result.status !== 0) {
    throw new Error(`seedmancer seed exited with status ${result.status}`)
  }
}

2. API test

// tests/api/users.spec.ts
import { test, expect } from "@playwright/test"

test("GET /api/users returns seeded rows", async ({ request }) => {
  const res = await request.get("/api/users")
  expect(res.ok()).toBeTruthy()
  const users = await res.json()
  expect(users.length).toBeGreaterThan(0)
})

test("POST /api/users creates a user", async ({ request }) => {
  const res = await request.post("/api/users", {
    data: { email: "new@example.com", name: "New User" },
  })
  expect(res.status()).toBe(201)
})

3. Browser test

// tests/browser/login.spec.ts
import { test, expect } from "@playwright/test"

test("login with seeded user", async ({ page }) => {
  await page.goto("/login")
  await page.fill('[name="email"]', "test@example.com")
  await page.fill('[name="password"]', "SeedmancerTest1!")
  await page.click('[type="submit"]')
  await expect(page).toHaveURL("/dashboard")
})

package.json scripts

{
  "scripts": {
    "test": "playwright test",
    "test:no-reset": "SEEDMANCER_RESET_DATABASE=0 playwright test"
  }
}
  • Guard globalSetup with if (process.env.SEEDMANCER_RESET_DATABASE === "0") return; to skip the reset during rapid local iteration.
  • The default password for all auth users recreated by Seedmancer is SeedmancerTest1!

Cypress

Use cy.task() to call seedmancer seed from within Cypress, either once in cypress/support/e2e.ts or at the start of a specific spec.

1. Register the task

// cypress.config.ts
import { defineConfig } from "cypress"
import { execSync } from "node:child_process"

export default defineConfig({
  e2e: {
    setupNodeEvents(on) {
      on("task", {
        resetDb(datasetId = "api-test") {
          execSync(`seedmancer seed --id ${datasetId} --yes`, {
            stdio: "inherit",
          })
          return null
        },
      })
    },
  },
})

2. Reset before the suite

// cypress/support/e2e.ts
before(() => {
  cy.task("resetDb")
})

// Or before each spec file:
// beforeEach(() => { cy.task("resetDb") })

3. API test

// cypress/e2e/api/users.cy.ts
describe("Users API", () => {
  it("returns seeded users", () => {
    cy.request("/api/users").then((res) => {
      expect(res.status).to.eq(200)
      expect(res.body.length).to.be.greaterThan(0)
    })
  })

  it("creates a user", () => {
    cy.request("POST", "/api/users", {
      email: "new@example.com",
      name: "New User",
    }).then((res) => {
      expect(res.status).to.eq(201)
    })
  })
})

4. Browser test

// cypress/e2e/browser/login.cy.ts
describe("Login", () => {
  it("logs in with a seeded user", () => {
    cy.visit("/login")
    cy.get('[name="email"]').type("test@example.com")
    cy.get('[name="password"]').type("SeedmancerTest1!")
    cy.get('[type="submit"]').click()
    cy.url().should("include", "/dashboard")
  })
})
  • Pass a different dataset id to cy.task('resetDb', 'other-dataset') to seed a specific state mid-suite.
  • The default password for all auth users recreated by Seedmancer is SeedmancerTest1!

CI / CD

The recommended CI workflow is pull then seed: download the dataset from the cloud and restore it into the test database. Datasets can be large, so avoid committing .seedmancer/ to git. Store SEEDMANCER_API_TOKEN as a CI secret instead.

GitHub Actions

# .github/workflows/test.yml
name: Test

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest

    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432

    steps:
      - uses: actions/checkout@v4

      - name: Install Seedmancer
        run: |
          curl -L https://github.com/KazanKK/seedmancer/releases/latest/download/seedmancer_Linux_x86_64 -o seedmancer
          chmod +x seedmancer && sudo mv seedmancer /usr/local/bin/seedmancer

      - name: Pull and seed database
        env:
          SEEDMANCER_API_TOKEN: ${{ secrets.SEEDMANCER_API_TOKEN }}
          SEEDMANCER_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
        run: |
          seedmancer pull --id api-test
          seedmancer seed --id api-test --yes

      - name: Run tests
        run: npm test

GitLab CI

# .gitlab-ci.yml
test:
  image: node:20
  services:
    - postgres:16
  variables:
    POSTGRES_PASSWORD: postgres
    SEEDMANCER_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
  before_script:
    - curl -L https://github.com/KazanKK/seedmancer/releases/latest/download/seedmancer_Linux_x86_64 -o /usr/local/bin/seedmancer
    - chmod +x /usr/local/bin/seedmancer
    - seedmancer pull --id api-test
    - seedmancer seed --id api-test --yes
  script:
    - npm test

Docker Compose (local / CI)

# docker-compose.test.yml
services:
  db:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: postgres
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
      interval: 5s
      retries: 5

  seed:
    image: alpine
    depends_on:
      db:
        condition: service_healthy
    volumes:
      - /usr/local/bin/seedmancer:/usr/local/bin/seedmancer
    command: sh -c "seedmancer pull --id api-test && seedmancer seed --id api-test --yes"
    environment:
      SEEDMANCER_API_TOKEN: ${SEEDMANCER_API_TOKEN}
      SEEDMANCER_DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
  • Do not commit .seedmancer/ to git. Dataset CSVs can be large — use the cloud as the source of truth and pull in CI.
  • Add SEEDMANCER_API_TOKEN to your CI secrets (GitHub → Settings → Secrets, GitLab → CI/CD Variables).
  • Use --yes to skip the confirmation prompt in non-interactive environments.
  • Push a new dataset version with seedmancer push --id api-test whenever your test data changes, then CI picks it up on the next run.
Seedmancer CLI — MIT LicenseGitHubUpdated April 2026