Local-first SQLRooms project launcher for DuckDB worksheets and Mosaic dashboards.
Project description
sqlrooms CLI
Launch a local SQLRooms DuckDB project for adding data, authoring worksheets, and building Mosaic charts and dashboards.
Quick start
# From the repo root
uvx sqlrooms \
./sqlrooms.db
What happens:
- Starts the DuckDB websocket backend (from
sqlrooms-server) on a free local port. - Serves the SQLRooms worksheet UI on
http://localhost:4173, or the next free port, and opens your browser (disable with--no-open-browser). - Drag-and-drop CSV, TSV, JSON, Parquet, and DuckDB files to load them into DuckDB; files are uploaded to a local
sqlrooms_uploadsfolder and referenced by path. - UI state is stored in the SQLRooms meta namespace (default
__sqlrooms) of the selected DuckDB file.
CLI flags
DB_PATH(positional): DuckDB project file to load/create (e.g.sqlrooms ./my.db). Required unless--db-pathis provided.--db-path: DuckDB database to use as a flag alternative. Pass a filepath to persist, or:memory:for an explicit temporary in-memory session.--host/--port: HTTP host/port for the UI. The default bind address is127.0.0.1. If--portis omitted,4173or the next free port is chosen automatically.--ws-port: WebSocket port for DuckDB queries. If omitted, a free port is chosen automatically.--experimental: Enable experimental artifacts, blocks, commands, and agent tools.--experimental-sync: Enable experimental sync (CRDT) over WebSocket (Loro). Requires--experimental.--ai-devtools: Enable the AI session devtools button in the UI, including production-built UI bundles. Can also be set withSQLROOMS_AI_DEVTOOLS=1.--meta-db: Optional path to a dedicated DuckDB file for SQLRooms meta tables (UI state + CRDT snapshots). If omitted, meta tables are stored in the main DB.--meta-namespace(default__sqlrooms): Namespace for SQLRooms meta tables. If--meta-dbis provided, used as ATTACH alias; otherwise used as a schema in the main DB.--no-open-browser: Skip automatically opening the browser tab.--ui: Optional path to a custom UI bundle directory (a Vitedist/). If omitted, uses the bundled default UI.--no-ui: Start only the HTTP API server and DuckDB websocket backend; do not serve the bundled/static UI.--config: Path to a SQLRooms TOML config file. Defaults to~/.config/sqlrooms/config.toml(%APPDATA%\sqlrooms\config.tomlon Windows).--no-config: Disable config file loading.
--host 0.0.0.0 is an advanced local-network mode. Only use it on trusted
networks; it exposes the SQLRooms UI/API bind address beyond your loopback
interface. The DuckDB websocket backend still enforces local-only connections
unless you explicitly use external proxy settings.
There is intentionally no sqlrooms add, sqlrooms import, or
sqlrooms doctor command in the first public CLI. Drag-and-drop import is the
supported first-launch path, and the release smoke checklist below covers the
doctor-style checks for now.
Data persistence
Tables created in the selected DuckDB file (or attached meta DB if --meta-db is provided):
__sqlrooms.ui_state(one row:key='default')__sqlrooms.sync_rooms(only used when--experimental --experimental-syncis enabled)
Uploads go to /api/upload. Runtime config for the UI is exposed at /api/config / /config.json.
Manual smoke test
Use this before release candidates to prove the first-launch path:
uv run --project python --package sqlrooms sqlrooms \
--no-open-browser \
./smoke.duckdb
Then open the printed UI URL and verify:
- The app starts without a database connection error.
- Dragging
python/sqlrooms/tests/fixtures/cars.csvinto the data panel creates acarstable. - The uploaded CSV lands next to
smoke.duckdbundersqlrooms_uploads/. - The data sidebar shows
main.carsand does not show SQLRooms internal metadata. - A worksheet is created or selected automatically and contains a
carsdata-table explorer block. - Users can create worksheet and dashboard artifacts from the
Newmenu without enabling--experimental. - Map, notebook, canvas, app, HTML app, pivot, and SQL query surfaces stay hidden unless
--experimentalis provided. - Restarting the same command with
./smoke.duckdbrestores the imported table and persisted workspace state.
Config file
sqlrooms reads AI provider and connector settings from a TOML config file.
AI settings changed in the CLI UI are saved back to this file automatically
when config loading is enabled and the config file is writable:
- macOS / Linux:
~/.config/sqlrooms/config.toml - Windows:
%APPDATA%\sqlrooms\config.toml
Override with --config <path>, or disable with --no-config.
Example config file:
[ai]
default_provider = "openai"
default_model = "gpt-5"
[[ai.providers]]
id = "openai"
base_url = "https://api.openai.com/v1"
api_key_env = "OPENAI_API_KEY"
models = ["gpt-5", "gpt-4.1"]
[[ai.providers]]
id = "anthropic"
base_url = "https://api.anthropic.com"
api_key_env = "ANTHROPIC_API_KEY"
models = ["claude-4-sonnet"]
[[ai.custom_models]]
model_name = "local-qwen"
base_url = "http://localhost:11434/v1"
api_key = "local-key"
[ai.model_parameters]
max_steps = 12
additional_instruction = "Prefer short answers."
[[db.connectors]]
id = "postgres-local"
engine = "postgres"
title = "Postgres Local"
host = "localhost"
port = "5432"
database = "postgres"
user = "postgres"
password = "postgres"
[[db.connectors]]
id = "snowflake-prod"
engine = "snowflake"
title = "Snowflake Prod"
account = "your-account"
user = "your-user"
password = "your-password"
warehouse = "your-warehouse"
database = "your-database"
schema = "your-schema"
role = "your-role"
authenticator = "externalbrowser"
[[db.connectors]]
id = "snowflake-dev"
engine = "snowflake"
title = "Snowflake Dev"
account = "your-dev-account"
user = "your-dev-user"
warehouse = "your-dev-warehouse"
Server-only mode (no UI)
If you only want the DuckDB websocket server (no HTTP UI server), install/run sqlrooms-server:
uvx sqlrooms-server --db-path ./sqlrooms.db --port 4000
sqlrooms-server is also available as an alias console script.
Backend connectors (DbSlice bridge)
Use these modes to run remote queries through backend connectors and materialize results into core DuckDB for downstream notebook cells.
Install optional connector dependencies first:
# From python/sqlrooms
uv sync --extra connectors
# or install just one connector:
uv sync --extra postgres
uv sync --extra snowflake
Postgres
uvx sqlrooms \
./sqlrooms.db \
--ws-port 4000 \
--port 4173
Snowflake
uvx sqlrooms \
./sqlrooms.db \
--ws-port 4000 \
--port 4173
What this enables:
sqlroomsexposes connector bridge endpoints under/api/db/*.- Runtime connector metadata is exposed via
/api/config, so frontendDbSliceauto-registers available backend connections. - Notebook SQL cells can select Postgres/Snowflake connectors from the connector dropdown.
- Arrow payloads are materialized into DuckDB and can be queried downstream in the same session.
Notes:
- Configure connectors in
sqlrooms.tomlusing[[db.connectors]]entries. - Connector libraries are optional extras (
postgres,snowflake, orconnectors).
Developer setup
Local dev loop for the CLI and UI:
- Install deps and build the dedicated UI (from repo root):
pnpm install
pnpm --filter sqlrooms-python build:ui
# build outputs directly to python/sqlrooms/sqlrooms/web/static
- Dev the Python CLI app from the repo root:
pnpm dev cli
This starts the Python API server on http://127.0.0.1:4273 with --no-ui
and the Vite UI on http://localhost:4174. If those ports are busy, the dev
script selects the next free API and UI ports from separate ranges and points
the Vite proxy at the selected API port. The auto-created dev database is named
after the selected UI port, for example sqlrooms-4174.db.
- Run the Python API server on its own (optional):
cd python/sqlrooms
pnpm dev
Tips:
- Use
--no-open-browserif you don’t want the static bundle auto-opened. - Use
--no-uiwhen pairing the Python API server with the Vite UI dev server. - Rebuild the UI (
pnpm --filter sqlrooms-python build:ui) when you want the Python server to serve new static assets. /api/configreflects runtime config (AI providers/default model, DB bridge metadata, WS URL).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqlrooms-0.1.0.tar.gz.
File metadata
- Download URL: sqlrooms-0.1.0.tar.gz
- Upload date:
- Size: 7.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fa8bf35dd1b60230246f712872a1366b124708f04246ad8b5db9da1712b4795
|
|
| MD5 |
5c8353a510d47d97e9265fc68db2be12
|
|
| BLAKE2b-256 |
b9174db213003a6aab40faa40a5f5bbda18d6e9356063defe5c398dd2a2c48d2
|
File details
Details for the file sqlrooms-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sqlrooms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b448c37073ba80c09daa2c3b031e66cc3059214cf73db0648ae1787f7802ff31
|
|
| MD5 |
90205fcac98534a45079894792ad2669
|
|
| BLAKE2b-256 |
89f8e5eadcbfd4a55e947f022ae0516b1827f0e028123d2647028cbbd9446791
|