Skip to content

dft playground

Start an interactive playground with YAML editor and live preview. Built for fast iteration: edit YAML in the browser, see the dashboard render, optionally drive edits with an AI Copilot.

dft playground [OPTIONS]

Requires the playground extra.

dataface-playground is not yet on public PyPI — it ships via the private Dataface registry. Install it via your configured registry:

pip install "dataface[playground]"

If you run dft playground without the extra installed, Dataface detects the missing packages and offers to install them interactively.

dft init --with-playground requests the install during project setup; if the package is unavailable from your configured index, dft init skips playground with a warning and completes successfully.

Options

Flag Description
--port INT Port number. Auto-resolved if not set; default range starts at 8085.
--data PATH Path to sample data (DuckDB file).
--host TEXT Host address. Default: localhost.
--reload / --no-reload Auto-reload on code changes. Default: off.
--base-dir PATH Base directory for examples and dbt project. Default: current directory or auto-detected examples/.
--openai-key TEXT OpenAI API key for AI Copilot. Env: OPENAI_API_KEY.
--no-open Don't auto-open the browser on start.

YAML editor completions

The Playground YAML editor suggests Dataface keys, chart types, variable input types, themes, and local query/chart references while you type. Use Ctrl-Space on Windows/Linux or Cmd-Space on macOS to open completions explicitly.

Base directory resolution

The playground looks for examples/ and dbt_project/ directories relative to --base-dir. If --base-dir isn't set, auto-detection walks:

  1. Current directory (if examples/ or dbt_project.yml exists)
  2. DFT_PLAYGROUND_BASE_DIR environment variable
  3. Walks up looking for examples/

AI Copilot key configuration

Any one of:

# .env in project root
OPENAI_API_KEY=sk-...

# environment variable
export OPENAI_API_KEY=sk-...

# CLI flag
dft playground --openai-key sk-...

Examples

dft playground
dft playground --port 3000
dft playground --host 0.0.0.0
dft playground --base-dir ./examples
dft playground --base-dir /path/to/my/project
dft playground --data ./my_data.db
dft playground --reload
dft playground --openai-key sk-...
OPENAI_API_KEY=sk-... dft playground

When to use what

If you want… Use
Live YAML editor + AI Copilot in the browser dft playground
Serve faces and inspect templates against a real warehouse dft serve
Static export dft render
Terminal AI agent dft chat