Skip to content

feature: bt datasets#106

Open
Andrew Look (andrewlook) wants to merge 3 commits intobraintrustdata:mainfrom
andrewlook:alook--dataset-support
Open

feature: bt datasets#106
Andrew Look (andrewlook) wants to merge 3 commits intobraintrustdata:mainfrom
andrewlook:alook--dataset-support

Conversation

@andrewlook
Copy link
Copy Markdown

@andrewlook Andrew Look (andrewlook) commented Apr 11, 2026

Context

I'm hoping to get more of my team using the braintrust CLI, but inability to list/create datasets was pretty limiting for me when I was getting started. The AI assistant in the docs had a fairly confusing answer when i was trying to figure this out:

Screen Shot 2026-04-10 at 9 54 01 PM

So I just fired up compound-engineering plugin, made a plan, and fired it off - this seems to be working pretty well for me so I'm using my forked version now. I'm not super familiar with your contribution guidelines, please let me know if this looks totally wrong (or if contributions are unwelcome that's ok too).

Testing bt datasets commands

Setup

bash:

# Build from source and put on your PATH
cargo build --release
export PATH="$PWD/target/release:$PATH"

# Verify you're using the local build
which bt        # should show .../target/release/bt
bt --version    # should show canary version

# Set these to match your Braintrust org/project/dataset
export BT_ORG="my-org"
export BT_PROJECT="my-project"
export BT_DATASET="my-dataset"
fish shell equivalent

fish:

# Build from source and put on your PATH
cargo build --release
set -x PATH (pwd)/target/release $PATH

# Verify you're using the local build
which bt        # should show .../target/release/bt
bt --version    # should show canary version

# Set these to match your Braintrust org/project/dataset
set -x BT_ORG "my-org"
set -x BT_PROJECT "my-project"
set -x BT_DATASET "my-dataset"

Create

# Create a dataset
bt datasets create "test-dataset" --org "$BT_ORG" --project "$BT_PROJECT"

# Create with description
bt datasets create "test-dataset-2" --org "$BT_ORG" --project "$BT_PROJECT" --description "A test dataset"

# Interactive mode (no name, should prompt)
bt datasets create --org "$BT_ORG" --project "$BT_PROJECT"

# Non-interactive without name (should error)
bt datasets create --org "$BT_ORG" --project "$BT_PROJECT" --no-input

# Create duplicate (should error)
bt datasets create "test-dataset" --org "$BT_ORG" --project "$BT_PROJECT"

List

# List all datasets in a project
bt datasets list --org "$BT_ORG" --project "$BT_PROJECT"

# JSON output
bt datasets list --org "$BT_ORG" --project "$BT_PROJECT" --json

# Bare command (should default to list)
bt datasets --org "$BT_ORG" --project "$BT_PROJECT"

# Non-interactive without project (errors only if no default project set via `bt switch`)
bt datasets list --org "$BT_ORG" --no-input

View

# View metadata + sample rows (default 10 rows)
bt datasets view "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT"

# Limit sample rows
bt datasets view "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT" --limit 3

# No sample rows
bt datasets view "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT" --limit 0

# JSON output (metadata only)
bt datasets view "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT" --json

# Open in browser
bt datasets view "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT" --web

# Using --name flag instead of positional
bt datasets view --name "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT"

# Interactive mode (no name, should fuzzy select)
bt datasets view --org "$BT_ORG" --project "$BT_PROJECT"

# Non-interactive without name (should error)
bt datasets view --org "$BT_ORG" --project "$BT_PROJECT" --no-input

# Dataset that doesn't exist (should error)
bt datasets view "nonexistent-dataset" --org "$BT_ORG" --project "$BT_PROJECT"

Delete

# Interactive delete (will prompt for confirmation)
bt datasets delete "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT"

# Force delete (skip confirmation) -- careful!
# bt datasets delete "$BT_DATASET" --org "$BT_ORG" --project "$BT_PROJECT" --force

# Interactive mode (no name, should fuzzy select)
bt datasets delete --org "$BT_ORG" --project "$BT_PROJECT"

# Non-interactive without name (should error)
bt datasets delete --org "$BT_ORG" --project "$BT_PROJECT" --no-input

# Force without name (should error)
bt datasets delete --org "$BT_ORG" --project "$BT_PROJECT" --force

Help

# Top-level help (should show datasets)
bt --help

# Datasets help
bt datasets --help

# Subcommand help
bt datasets view --help
bt datasets delete --help

Add a `bt datasets` command group with list, view, and delete
subcommands, following the established patterns from prompts and
experiments. The view command shows metadata plus sample rows fetched
via BTQL with a configurable --limit flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `bt datasets create <name>` with optional `--description` flag.
Checks for duplicates before creating and supports interactive name
input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant