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 pip install dataface[playground].

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.

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. DATAFACE_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