Manage PloyDB with the CLI
Create and manage databases, tables, columns, and rows from the command line. You can also duplicate data asynchronously and import typed CSV files.
Databases
ploy database list [--json]
Lists the current workspace's databases.
ploy database list
ploy database list --json--jsonprints{ "databases": [...] }instead of tab-separated database ID and name lines.
ploy database create --name <name> [options]
Creates an empty database, or asynchronously duplicates another database when --from is supplied.
ploy database create --name "Content"
ploy database create --name "Content copy" --from <databaseId>
ploy database create --name "Content copy" --from <databaseId> --operation-key <uuid> --json| Option | Meaning |
|---|---|
--name <name> | Required display name for the new database. |
--from <databaseId> | Duplicates an existing database, including its tables and rows. |
--operation-key <uuid> | Reuses or rejoins a duplication operation. Requires --from. The CLI generates a UUID when omitted. |
--json | Prints the created database or duplication receipt as JSON. |
ploy database rename <databaseId> --name <name> [--json]
Changes a database's display name.
ploy database rename <databaseId> --name "Customer content"<databaseId>identifies the database to rename.--name <name>is the required new display name.--jsonprints the updated database as JSON.
ploy database archive <databaseId> [--json]
Archives a database without permanently deleting its stored data.
ploy database archive <databaseId>There is currently no command for permanently deleting a database.
ploy database operation <operationId> [--json]
Reads the status of an asynchronous database or table duplication.
ploy database operation <operationId> --jsonPossible statuses are in_progress, succeeded, and failed. A failed operation returns exit code 1.
Tables
ploy database table list <databaseId> [--json]
Lists the tables in a database.
ploy database table list <databaseId>--json prints { "tables": [...] } instead of tab-separated table ID and name lines.
ploy database table create <databaseId> --name <name> [--json]
Creates a table using the product's starter columns and placeholder rows.
ploy database table create <databaseId> --name "Contacts"ploy database table duplicate <databaseId> <tableId> [options]
Asynchronously duplicates a table, including its columns and rows.
ploy database table duplicate <databaseId> <tableId> --operation-key <uuid> --json--operation-key <uuid>reuses or rejoins a duplication operation. The CLI generates a UUID when omitted.--jsonprints the duplication receipt as JSON.
Use ploy database operation <operationId> to inspect progress.
ploy database table rename <databaseId> <tableId> --name <name> [--json]
Changes a table's name.
ploy database table rename <databaseId> <tableId> --name "Customers"ploy database table delete <databaseId> <tableId> [--json]
Permanently deletes a table, including its columns and rows.
ploy database table delete <databaseId> <tableId>Columns
ploy database column list <databaseId> <tableId> [--json]
Lists a table's columns, including each field ID, label, and type.
ploy database column list <databaseId> <tableId>--json prints { "columns": [...] } instead of tab-separated field ID, label, and type lines.
ploy database column add <databaseId> <tableId> --name <name> [options]
Adds a column to a table. The type defaults to TEXT.
ploy database column add <databaseId> <tableId> --name "Company"
ploy database column add <databaseId> <tableId> --name "Contract value" --type CURRENCY
ploy database column add <databaseId> <tableId> --name "Private notes" --type LONG_TEXT --secret| Option | Meaning |
|---|---|
--name <name> | Required column name. |
--type <type> | Column type. Defaults to TEXT. |
--secret | Marks the new column as secret. |
--json | Prints the created column as JSON. |
Supported column types
TEXT
LONG_TEXT
NUMBER
CURRENCY
PERCENT
CHECKBOX
SELECT
MULTI_SELECT
STATUS
PEOPLE
DATE
URL
EMAILploy database column rename <databaseId> <tableId> <fieldId> --name <name> [--json]
Changes a column's display name.
ploy database column rename <databaseId> <tableId> <fieldId> --name "Account name"ploy database column retype <databaseId> <tableId> <fieldId> --type <type> [--json]
Changes a column's type and automatically converts all existing values.
ploy database column retype <databaseId> <tableId> <fieldId> --type NUMBERploy database column secret <databaseId> <tableId> <fieldId> <state> [--json]
Marks or unmarks a column as secret. Set <state> to on or off.
ploy database column secret <databaseId> <tableId> <fieldId> on
ploy database column secret <databaseId> <tableId> <fieldId> offploy database column delete <databaseId> <tableId> <fieldId> [--json]
Permanently deletes a column and every value stored in it.
ploy database column delete <databaseId> <tableId> <fieldId>Rows
ploy database row list <databaseId> <tableId> [options]
Lists and paginates rows, with optional text search, filters, and ordered sorting.
ploy database row list <databaseId> <tableId>
ploy database row list <databaseId> <tableId> --limit 100 --search "enterprise"
ploy database row list <databaseId> <tableId> --filter <fieldId>:contains:software --sort <fieldId>:asc
ploy database row list <databaseId> <tableId> --cursor <cursor> --json| Option | Meaning |
|---|---|
--limit <n> | Maximum rows to return. Must be from 1 through 500. |
--search <text> | Case-insensitive substring search across text-based columns. |
--filter <fieldId>:<operator>[:<value>] | Filters rows. Repeat up to 50 times. |
--sort <fieldId>:<asc|desc> | Sorts rows in the supplied order. Repeat up to 10 times. |
--cursor <cursor> | Continues from the cursor returned by a previous list request. |
--json | Prints the complete { rows, nextCursor, hasMore } page as one JSON line. |
Without --json, each row is printed as one JSON object:
{"id":"row_...","fields":{"fld_...":"value"}}Supported row filters
| Column types | Operators |
|---|---|
| Text, long text, URL, email | contains, eq, neq, is_null, is_not_null |
| Number, currency, percent, date | eq, neq, gt, gte, lt, lte, is_null, is_not_null |
| Select, status, checkbox | eq, neq, is_null, is_not_null |
| Multi-select, people | list_contains, list_not_contains, is_null, is_not_null |
Filter values may contain colons because the CLI splits only the first two colons.
is_nullandis_not_nulldo not accept a value.
ploy database row add <databaseId> <tableId> [options]
Adds one row to a table. If neither value source is supplied, the command creates an empty row.
ploy database row add pdb_123 tbl_456 --values '{"fld_name":"Ada","fld_active":true}'
ploy database row add <databaseId> <tableId> --file ./row.json
cat ./row.json | ploy database row add <databaseId> <tableId> --file ---values <json>accepts a JSON object keyed by column field ID.--file <path>reads that JSON object from a file. Use-for standard input.--valuesand--fileare mutually exclusive.--jsonprints the created row as JSON.
ploy database row update <databaseId> <tableId> <rowId> [options]
Updates selected fields in one row. Fields omitted from the input remain unchanged.
ploy database row update <databaseId> <tableId> <rowId> --values '{"fld_active":false}'
ploy database row update <databaseId> <tableId> <rowId> --file ./changes.jsonSupply exactly one useful value source: a non-empty JSON object through
--values, or a file through--file. The two options are mutually exclusive.
ploy database row delete <databaseId> <tableId> <rowId> [--json]
Deletes one row.
ploy database row delete <databaseId> <tableId> <rowId>CSV import
ploy database import <databaseId> (--table-name <name> | --table-id <tableId>) [options]
Imports a CSV into a newly created or existing table and automatically determines column types.
ploy database import <databaseId> --table-name "Records" --file ./records.csv
ploy database import <databaseId> --table-id <tableId> --file ./records.csv --dry-run
cat ./records.csv | ploy database import <databaseId> --table-name "Records" --idempotency-key <key>| Option | Meaning |
|---|---|
--table-name <name> | Creates a new table with this name and imports into it. |
--table-id <tableId> | Imports into an existing table. |
--file <path> | Reads CSV from a file. When omitted, reads CSV from standard input. |
--idempotency-key <key> | Sets an explicit retry-deduplication key. When omitted, the CLI derives a stable key from the target, headers, and rows. |
--dry-run | Validates and describes the import without writing data. |
--json | Prints the import result as JSON. |
Give exactly one of
--table-nameor--table-id. The first CSV row is treated as the header.
Get built-in help
ploy database --help
ploy database create --help
ploy database table --help
ploy database column --help
ploy database row --help
ploy database import --helpKeep going
- Check the complete CLI contract for global options, environment variables, saved state, and exit codes.
- Manage workspaces and sites, including domains, routing, publishing, and Code Sync.
- Equip local agents with Ploy skills and inspect a site's design-system context.
- Run the CLI from remote agents and CI with API tokens and non-interactive commands.
