This page summarizes the current command surface exposed by ditto.
ditto [command]
Global flags:
| Flag | Meaning |
|---|---|
--config <path> |
Path to ditto.yaml |
--db <path> |
Path to the SQLite metadata database |
--version |
Print version information |
Create a clean copy from the latest dump or from --dump.
ditto copy create
ditto copy create --format=json --ttl 30m
ditto copy create --dump s3://bucket/latest.gzFlags:
| Flag | Meaning |
|---|---|
--dump <uri> |
Restore from a local path, s3://, or https:// source |
--format <mode> |
Output style: auto, pipe, or json |
--label <name> |
Run identifier override |
--obfuscate |
Apply configured obfuscation post-restore |
--ttl <duration> |
Override lifetime for this copy |
--server <url> |
Use a remote ditto host |
Create a copy, run one command with DATABASE_URL injected, and destroy the copy on exit.
ditto copy run -- go test ./...
ditto copy run --ttl 30m -- migrate -database "$DATABASE_URL" upInjected environment variables:
DATABASE_URLDITTO_COPY_ID
Flags:
| Flag | Meaning |
|---|---|
--dump <uri> |
Restore from a specific dump source |
--label <name> |
Run identifier override |
--obfuscate |
Apply configured obfuscation post-restore |
--ttl <duration> |
Override lifetime for this copy |
--server <url> |
Use a remote ditto host |
ditto copy list
ditto copy delete <id>
ditto copy logs <id>Use copy list to inspect active copies and copy logs for lifecycle events tied to a specific ID.
Refresh the local dump immediately:
ditto reseedThis command succeeds only after a new dump completes successfully.
Keep the host ready for CI:
ditto daemonResponsibilities:
- refresh the dump on the configured schedule
- delete copies after TTL expiry
- refill the warm pool when enabled
Expose the copy lifecycle over HTTP:
ditto serveClients use --server=http://host:8080 plus DITTO_TOKEN when required.
Show dump freshness and copy capacity:
ditto statusThis is the first command to run when you want to verify host health.
Use env when you want shell-friendly environment management.
Create a copy and print shell export lines:
eval "$(ditto env export)"This sets DATABASE_URL and DITTO_COPY_ID in the current shell.
Destroy a copy created with env export:
ditto env destroy "$DITTO_COPY_ID"Run one command with DATABASE_URL injected:
ditto env -- pytest tests/env -- is effectively the same lifecycle as copy run.
Generate an ERD from a temporary copy or directly from the source database:
ditto erd
ditto erd --format=dbml --output schema.dbml
ditto erd --sourceFlags:
| Flag | Meaning |
|---|---|
--format <type> |
Output format: mermaid or dbml |
--output <path> |
Write output to a file |
--source |
Connect to the source database directly |
--server <url> |
Create the temporary copy via a remote ditto host |