Skip to main content
bt datasets manages remote Braintrust datasets directly from the CLI.

Subcommands

bt datasets list

Lists all datasets in the current project.

bt datasets create

Create a dataset, optionally seeding it with records from a file, stdin, or inline JSON.

Flags

When rows omit an id field, bt datasets auto-generates stable record IDs.

bt datasets update

Upsert records into an existing dataset. Also available as bt datasets add and bt datasets refresh.

Flags

Each row must have a stable ID via the id field or --id-field. Rows without IDs are rejected.update, add, and refresh upsert rows directly — rows not in the input are not deleted. refresh fails if the dataset does not exist.--id-field uses dot-separated paths (e.g., metadata.case_id). Escape literal dots as \. and literal backslashes as \\.Input may also be a JSON object with a top-level rows array (matching bt datasets view --json output). Each row in rows is validated against the accepted fields: id, input, expected, metadata, tags, and origin.

bt datasets view

Display dataset metadata and preview records in the terminal.

Flags

bt datasets delete

Permanently delete a dataset and all its records.
This operation is irreversible. All records in the dataset are permanently deleted.

bt datasets pipeline

Transform project logs into dataset rows using a pipeline declared with DatasetPipeline(...) in a TypeScript or Python file. See Dataset pipelines for how to write a pipeline definition.
Beta — This feature is subject to change.
Dataset pipelines require bt CLI v0.10.0 or later, plus the braintrust SDK for the language you write the pipeline in: TypeScript SDK v3.16.0 or later, or Python SDK v0.23.0 or later.
Run the full pipeline in one shot, or split it into staged pull, transform, and push steps:
Staged runs write pulled.jsonl and transformed.jsonl to the bt-sync/ directory by default. Inspect or edit transformed.jsonl before running push.

Flags

bt datasets snapshots

Manage snapshots of a dataset directly from the CLI. Snapshots are named checkpoints that pin a dataset’s state at a specific transaction, so you can preserve a version before making changes or roll back later. Also available as bt datasets versions and bt datasets version.
only available on Pro and Enterprise plans.
Use the create, list, restore, and delete subcommands to manage a dataset’s snapshots:
create captures the dataset’s current head transaction by default. restore previews how many rows will be restored and deleted, then prompts for confirmation before applying the change. restore and delete are irreversible, so pass --force (-f) only when you want to skip the confirmation prompt.

Flags

For restore and delete, the snapshot name and --snapshot transaction ID are mutually exclusive.