SDODS
ReferenceCLI commands

sdods data, db

Import and preview datasets; migrate, inspect and switch the platform database.

data

sdods data preview <file> [--limit <n>]
sdods data import <dataset> <file> -p <slug> [-e <env>] [--to db|table] [--truncate]
sdods data list -p <slug>
sdods data seed -p <slug> [-e <env>] [--to db|table]
CommandPurpose
previewfirst rows and inferred columns of a CSV, JSON or YAML file
importload a file into datasets/dataset_rows (--to db) or into a td_<project>_<dataset> table (--to table); -e scopes rows to an environment (default *); --truncate replaces rows for that environment
listdatasets stored in the database for a project
seedimport every file under projects/<slug>/data/<env>/ and data/common/

db

sdods db migrate [--to <name>] [--down]
sdods db status
sdods db sync
sdods db reset --yes                                                     # sqlite only
sdods db switch <sqlite|postgres> [--target-url <url>] [--target-path <file>] [--dry-run] [--truncate] [--env-file <file>] [--yes]
sdods db export <dir>
sdods db import <dir>
sdods db prune [--keep-runs <n>] [--keep-days <n>] [-p <slug>] [--dry-run]
sdods db stats
sdods db retention [--keep-runs <n>] [--keep-days <n>] [--auto on|off]
sdods db backup [--out <dir>]
sdods db backups [--dir <dir>]
sdods db restore <dir> --yes
sdods runs rm <id...> [--dry-run] [--yes]
CommandPurpose
migrateapply pending migrations (creates the SQLite file on first use); --to targets one migration, --down rolls back one
statusapplied and pending migrations
syncupsert organization, workspaces, projects, modules and processes from sdods.workspace.yaml and the project YAML files
resetdrop every SDODS table (SQLite only); see Reinstall or reset
switchmigrate the target, copy every table, verify row counts and rewrite DB_DRIVER / DATABASE_URL / SQLITE_PATH in the env file (--dry-run only verifies)
exportone JSONL file per table
importload JSONL files with ON CONFLICT DO NOTHING
prunedelete old runs and their artifact directories; runs still queued or running are skipped, and every delete is audited
statswhich database is in use (SQLite path or redacted Postgres URL), its size, artifact size, row counts, oldest and newest run, migration state
retentionshow or set how much run history to keep; with --auto on, sdods serve applies it once a day (0 clears a limit)
backupwrite every table to .sdods/backups/<timestamp>/ (JSONL + manifest.json)
backupslist backups, newest first
restorereplace the database contents with a backup; a pre-restore backup of the current data is taken first
runs rmdelete specific runs, their results and artifact folders; --dry-run previews

Environment: DB_DRIVER (sqlite default, postgres), DATABASE_URL, SQLITE_PATH (default .sdods/sdods.db), SDODS_ARTIFACTS_DIR (default .sdods/runs), SDODS_BACKUPS_DIR (default .sdods/backups).

Every one of these is also in the web UI under Settings → Data & storage (admins), and runs can be deleted from the Runs page.

Using an AI coding agent? Install SDODS:

Install the SDODS plugin in Claude Code: skills, subagents, commands and the MCP server.

  1. /plugin marketplace add YarlisAISolutions/sdods-skills
  2. /plugin install sdods@sdods
Learn more about using SDODS with AI tools

On this page