CLI Reference
The command-line client: authentication, configuration, scripting, the REPL, and every global flag.
Authentication
Automation
- CI/CD patternIn CI: set DF_CONTROL_URL and DF_PASSWORD as secrets, run `delta-forge-cli --profile ci run <FILE>`. Exit 0 = success; non-zero = fail the job.
- Error handling for automationUse exit codes to branch: 0=success, 1=SQL/auth/parse error, 2=client init error. Capture stderr for error messages; stdout carries only result data...
- Export tokens for downstream tools`delta-forge-cli auth` prints `session_token=...`, `access_token=...`, and `refresh_token=...` as key=value lines on stdout (one per line). Parse...
- Headless script executionRun a multi-statement SQL script non-interactively with explicit credentials and a named profile. Exit code drives CI pass/fail.
- Non-TTY inline prompt fallbackWhen stdin or stdout is not a TTY (CI runners, `ssh -T`, Docker without `-t`, unattended job steps), any interactive surface the CLI would otherwise...
- Parsing JSON output with jqWith --format json the schema is `{ columns: string[], rows: Array<Record<string, string|null>>, row_count: number, execution_time_ms: number }`...
- Piping SQL from stdinWhen stdin is not a TTY, the default invocation reads and executes stdin as a multi-statement script. Ideal for generating SQL on the fly and piping...
Commands
Compute Routing
Configuration
Demo Runner
- --drop-schema / --drop-zoneOpt-in destructive flags for the cleanup phase. Without these, cleanup runs only the demo's teardown SQL; with them it also drops the created schema...
- --local <DIR>Override SQL file location with a local directory. Data paths still come from the provisioned environment. Use this for iterative debugging of...
- --phase setup|queries|cleanup|allSelect which phase(s) to run. `all` is the default. Useful for iterative debugging: provision once, then re-run just `queries` against the...
- Demo test runner overview`demo-test` is an end-to-end test harness. It provisions demo data via the control plane /provision-demo API, runs setup + queries + cleanup SQL...
- Demo variable injectionBefore executing any demo SQL, three variables are injected: `{{zone_name}}` (target zone), `{{data_path}}` (zone-relative path to provisioned...
- JSON report outputOn completion, demo-test emits a structured JSON report on stdout with demo identity, per-phase status, per-statement details, timings, and errors...
Environment Variables
Global Flags
Keybindings
Output Formats
REPL Features
Safety
Script Execution
Slash Commands
- /classifyClassify each statement in a script (DML, DDL, MAINTENANCE, PIPELINE, etc.). Offline AST walk.
- /clearClear scrollback. Aliases: /cls, Ctrl+L.
- /cmdRender the full reference page for a single SQL command.
- /columnsColumn list (name, type, nullable, position) for a table.
- /contextBootstrap context: active workspace, zones, compute, recent pipelines. Useful as the first command after login.
- /demoOpen a runnable demo by id (from the demo gallery). Shows the provision manifest + the queries you can run.
- /describeCatalog describe for any entity (table, view, schema, zone, workspace, pipeline). Routes through the control-plane DESCRIBE endpoint.
- /docsFull-text search the embedded documentation (SQL commands, functions, operators, data types, CLI reference).
- /downstreamDownstream lineage only: every consumer of this table.
- /explain-sqlPlain-English explanation of what the SQL does. Offline.
- /extract-tablesList every table reference in the SQL (fully-qualified where possible). Offline AST walk.
- /formatReformat SQL: keywords uppercased, canonical indentation. Pure string rewrite; offline.
- /helpShow the interactive help card listing every slash command, its argument shape, and a one-line summary.
- /lineageFetch both upstream and downstream lineage for a table (columns + pipelines).
- /lineage-sqlExtract script-level inbound (sources) and outbound (targets) tables from a SQL snippet. Offline.
- /nodesList compute nodes with status, load, workspace affinity, and a click-through to pin each one.
- /openOpen item N of the last result (table row, node entry, pipeline, etc.) and render its detail card.
- /pipeline-statusPipeline health + recent errors. With no argument, shows every pipeline; with a name, drills into one.
- /quitExit the CLI. Persists the scrollback to ~/.deltaforge/sessions/.
- /schemasList schemas, optionally filtered by zone.
- /table-historyDelta transaction history (versions, timestamps, operation, operator).
- /table-statsRow count and size stats for a table.
- /upstreamUpstream lineage only: every table this one depends on.
- /use-nodePin a compute node for the session (or pass `auto` to re-enable control-plane /nodes/recommend routing).
- /validateParse SQL and report syntax errors with line:col positions. Offline - no control-plane round-trip.
- /workspaceWorkspace overview: zones, pipelines, schedules, compute nodes.
- /zonesList all zones.