# olf CLI reference

> The olf commands you use to create, deploy, operate and validate an OpenLakeForge project, grouped by task. olf <command> --help prints every option of a…

Source: https://openlakeforge.dev/docs/reference/cli/

The `olf` commands you use to create, deploy, operate and validate an
OpenLakeForge project, grouped by task. `olf <command> --help` prints every
option of a command.

`olf` is installed with the `openlakeforge` Python package. It provisions its
own pinned Terraform, Helm, kubectl and kind under `OLF_HOME`
(`~/.openlakeforge` by default) and uses the AWS and Azure SDKs, so none of
those tools or cloud CLIs need to be installed. Run one `olf` command at a
time: concurrent invocations are not supported. A local, an AWS and an Azure
deployment can exist side by side, each with its own state and kubeconfig
under `OLF_HOME/state/<provider>/`.

## Where commands live

Commands that need cluster or cloud permissions are under `olf infra`. Commands
that need none, such as `olf init`, `olf check` and `olf project validate`, stay
at the top level. `olf --help` lists the top-level groups and `olf infra --help`
the infrastructure ones. The earlier top-level paths of the infra commands
(`olf deploy`, `olf project deploy`) still work as hidden aliases. Each prints one
line on stderr naming its new path and then runs unchanged, so scripts that parse
stdout keep working. `olf query` is an exception: it is a platform command of
its own, a person's queries, while `olf infra query` runs as the stage's
workload user. `olf report import|export` are the other: they move one report
as you through the platform API, while `olf infra report import|export` move
every bundle as the stage's Superset admin. See
[ADR 0020](https://openlakeforge.dev/docs/adr/0020-infrastructure-common-and-platform-cli-surfaces/).

### Commands by surface

The surface a command sits on follows the credential it needs (ADR 0020 D1):
infra needs cluster or cloud permissions, common needs none, and platform
needs an `olf login` session.

| Surface | Commands |
| --- | --- |
| Infra | `deploy`, `plan`, `destroy`, `doctor`, `status`, `forward`, `break-glass`, `query`, `auth *`, `platform *`, `access trust`, `github connect`, `secrets rotate`, `k8s`, `catalog`, `artifacts`, `openmetadata *`, `superset *`, `report import\|export`, `project build\|deploy\|status\|image\|revision *`, `product run`, `images load`, `contracts env`, `diagnostics collect`, `dbt parse`, `e2e`, `smoke`, `restore`, `backup`, `maintenance run`, `source bindings\|bind\|unbind`, `alerts bind\|bindings\|test` |
| Common | `init`, `version`, `check *`, `release *`, `toolchain *`, `distribution *`, `profile validate\|resolve`, `source new`, `domain new`, `product new`, `project validate\|graph`, `report validate`, `contracts check`, `images build`, `layers enabled`, `diagnostics tree`, `alert explain` |
| Platform | `login`, `whoami`, `logout`, `query`, `jobs list`, `runs list\|show\|launch`, `logs`, `domain list`, `product list`, `report import\|export`, `health`, `pipelines health`, `bucket *` |

## Options shared by lifecycle commands

`olf infra deploy`, `destroy`, `status`, `forward`, `doctor` and `plan` take:

| Option | Default | Meaning |
| --- | --- | --- |
| `--provider` | the profile's `spec.provider.type` | `local`, `aws` or `azure`; must match the profile when both are given. Without an `openlakeforge.yaml`, `local` |
| `--phase` | `all` | One phase; see each command |
| `--stage` | `dev` | `dev`, `uat` or `prod` |
| `--project-root` | current directory | The project holding `openlakeforge.yaml` |
| `--cluster-name` | `openlakeforge-local` | Local kind cluster name |
| `--kubeconfig-path` | under `OLF_HOME/state/<provider>/` | Where `olf` keeps the cluster's kubeconfig |
| `--var-file` | none | A Terraform variables file for the platform apply |

`--profile slim|full` is a deprecated shorthand for a single-DEV profile; use
`spec.preset` in `openlakeforge.yaml` instead. A stack deployed with it is
validated with the same flag: `olf infra e2e run --env local --profile slim`.
Pass it consistently: `--phase artifacts` with the default `full` against a
Slim platform renders governance manifests for services that are not
deployed. See [ADR 0011](https://openlakeforge.dev/docs/adr/0011-deployment-profile-and-stages/).

## Create a project

| Command | Does |
| --- | --- |
| `olf init` | Write `openlakeforge.yaml` and `lakehouse_code/` with the demo products. Options: `--stages dev,prod`, `--preset full`, `--name`, `--empty`, `--profile-only`. |
| `olf source new <source> --resource <r>` | Scaffold a Bronze source: `source.yaml`, a dlt loader and a placeholder CSV per resource. `--kind api\|sql` writes an incremental connector instead (`--cursor`, `--primary-key`). |
| `olf domain new <domain> --input <source>/<resource>` | Scaffold a domain and its Floe contract, one Silver table per `--input`. |
| `olf product new <domain>/<product> --gold-table <mart>` | Scaffold the product's folder of the Gold dbt project and its Dagster module. Inputs: `--silver-input <table>` or `--input <source>/<resource>`; `--with-report` adds a Superset draft. |

All `new` commands validate the result before writing and accept
`--display-name`.

## Deploy and operate

| Command | Does |
| --- | --- |
| `olf infra deploy` | Deploy all phases, or one with `--phase foundation`, `prefetch` (local), `platform` or `artifacts`. |
| `olf infra destroy` | Tear down the platform, then the foundation; `--phase platform` or `foundation` for one. `--force` destroys the foundation with platform resources left. |
| `olf infra status` | Service URLs, then pods, services and PVCs per namespace. `--json` for JSON. |
| `olf infra forward` | Port-forward every service to `localhost` until Ctrl-C. |
| `olf infra doctor` | Check the host, tools, project and cloud authentication without changing anything. `--json` for [JSON](#json-reports). |
| `olf infra restore --from <dir>` | Local provider only. Restores a backup onto a platform already deployed without the project (`olf infra platform apply`, which also recreates a destroyed cluster; `olf infra deploy --phase platform` when the cluster still exists) from the same release and `openlakeforge.yaml`; it refuses a backup whose release, profile, stages or checksums differ. Pauses the Dagster daemons and refuses while a run is in flight, suspends the stages' CronJobs, then scales Dagster, Superset, OpenMetadata, Polaris, Trino, Dex and the platform API to 0, replaces the backed-up Secrets, drops and reloads every database, makes each bucket equal to the backup's (objects written after it are deleted, then the listing is checked against the inventory by key and size), scales back up (shared services, then stages, then the daemons) and resumes the CronJobs, then reconciles the platform (`olf infra deploy --phase platform`) and reactivates, per enabled stage, the project revision the restored `ACTIVE.json` names, building nothing from the current checkout (a stage with no pointer is left alone; if a revision's image no longer exists, for example one built with `olf infra project image --no-push`, the restore fails naming the stage, revision and image). When the backup holds `local-ca`, restore also deletes the `publish-local-ca-*` Job and the Secret of every Certificate that ClusterIssuer `local-ca` issued before the reconcile, so the apply republishes the `olf-local-ca` ConfigMaps and cert-manager signs the Certificates again; after the revisions are back it waits for them and restarts the workloads that mount the ConfigMap or those Secrets. The Secrets bundle passphrase comes from `OLF_BACKUP_PASSPHRASE` or a prompt. If a step fails the workloads stay at 0: rerun the same command. |
| `olf infra source bind <source> --stage dev -f openlakeforge.yaml` | Bind the source's declared runtime keys; `--set KEY=VALUE`, `--secret-from-env KEY=VAR`, or `--secret-from-file KEY=PATH`. `--partial` keeps existing declared keys; `--dry-run` prints key names without writing. |
| `olf infra source bindings --stage dev -f openlakeforge.yaml` | Report bound, missing and extra keys for every source. Reads Secret key names only; exits 1 for missing or unreadable bindings. |
| `olf infra source unbind <source> --stage dev -f openlakeforge.yaml` | Delete the source's ConfigMap and Secret in the selected stage. |
| `olf infra alerts bind <receiver> -f openlakeforge.yaml` | Write the receiver's webhook URL into the Secret its `secret_ref` names, in `olf-system`; `--from-env VAR` or `--from-file PATH`, else a terminal prompts without echo. The URL must be `https`. Other keys of a shared Secret are kept; `--dry-run` writes nothing. Output never carries the URL. |
| `olf infra alerts bindings -f openlakeforge.yaml` | Report each receiver as bound, Secret missing or key missing (with the Secret's key names). Exits 1 unless all are bound. |
| `olf infra alerts test <receiver> -f openlakeforge.yaml [--stage <stage>]` | Send one test notification (`event: test`) to a receiver through the deployed evaluator: a one-off Job made from its CronJob, so the image, credentials, network policy and CA bundle are a real alert's. `--stage` defaults to the first enabled stage the receiver hears about. Waits up to 3 minutes, prints the receiver's answer and its log lines, deletes the Job. Exits non-zero unless delivered. No alert state is read or written. |
| `olf infra catalog sync-namespaces [--dry-run] [--prune]` | Reconcile the stage's catalog namespaces (Polaris) or databases (Glue) with the domain descriptors; the artifacts phase runs it first, before any table is written. An undeclared OpenLakeForge-managed namespace is reported and kept unless `--prune`, or `OPENLAKEFORGE_CATALOG_PRUNE_NAMESPACES` in the artifacts phase, asks to drop it. A prune drops catalog metadata only; object-store files stay. A namespace without the `openlakeforge.io/managed-by` property is never pruned or relocated. Creates run before drops. `--dry-run` prints the plan and changes nothing. |
| `olf infra plan` | Show the Terraform plan of the foundation or platform. `--detailed-exitcode` exits 2 when changes are pending; `--json` for [JSON](#json-reports). |
| `olf infra product run <product>` | Launch a product's pipeline in a stage and wait for it (`--stage`, `-f`). `--full-refresh bronze\|gold` asks that run only for a full refresh; see [Full refresh](https://openlakeforge.dev/docs/reference/descriptors/#full-refresh). |
| `olf infra maintenance run --layer silver\|gold` | Launch the stage's Iceberg maintenance job and wait for it (`--stage`, `--dry-run`, `--json`, `-f`); prints per-table snapshots and orphans. See [Silver table maintenance](https://github.com/OpenLakeForge/openlakeforge/blob/v0.7.5-beta.1/docs/architecture/floe-validation.md#silver-table-maintenance). |
| `olf infra query "<sql>"` | Run SQL against a stage's catalog (`--stage`, `--format table\|csv\|json`, `--file`). Local and Azure only. |
| `olf infra backup --output <dir>` | Back up a local deployment into a new directory (`-f <profile>`, `--project-root`): a `pg_dump` of each database (`polaris` first), a copy of every stage bucket and the ops bucket with a key-and-size inventory, the data-bound Secrets (including the platform API's Superset service-user passwords) and, with `tls: local-ca`, `local-ca` sealed in `secrets.enc`, then `manifest.json` and `SHA256SUMS`. It stops every stage's Dagster daemon for the length of the backup, refuses to start while a run is in flight, and always starts the daemon again. The passphrase for `secrets.enc` comes from `OLF_BACKUP_PASSPHRASE` or a prompt, never an argument; without it the Secrets cannot be restored. The directory holds all the data, so store it as you would the cluster. |
| `olf infra access trust` | Export the local CA and print the commands to trust it. Needed only for `tls: local-ca`; plain HTTP routes have nothing to trust, and with `tls: external` it refuses because your own edge holds the certificate. |
| `olf infra github connect` | Create the GitHub App for sign-in and store its credentials. |
| `olf infra auth login\|status\|logout --provider aws\|azure` | Authenticate to a cloud through its SDK. |
| `olf infra diagnostics collect <dir>` | Write host and cluster evidence for a bug report (`--namespace`, `--kube-context`). |

## Validate

| Command | Checks |
| --- | --- |
| `olf profile validate --project .` | `openlakeforge.yaml` |
| `olf profile resolve --project . --json` | Prints the resolved stages and capabilities |
| `olf alert explain --stage <stage> (--product <id> \| --job <name>)` | Prints, per condition, the `alerts.yml` rule that wins for a product, or a job such as `gold_maintenance` (a job of no product gets the global rules alone), in a stage, its options and its routes, from `alerts.yml` and `governance.yml`; needs no cluster or credential. A project with no `alerts.yml` prints that nothing alerts. Exits 1 for an invalid policy or an unknown product, and 2 for an unknown stage or unless exactly one of `--product` and `--job` is given |
| `olf check contracts` | `governance.yml`, every `source.yaml`, and the Floe project's namespaces. Every `olf check` target, and `olf check all`, takes `--json`; see [JSON reports](#json-reports) |
| `olf project migrate [--dry-run]` | Rewrites `openlakeforge.yaml` from `v1alpha1` to `v1beta1` (`spec.access.issuer` becomes `tls`), `governance.yml` from `v1beta1` to `v1beta2` and each `source.yaml` from `v1alpha3` to `v1beta1`; `--dry-run` prints the diff and changes nothing. See [Migrate from v0.5 alpha](https://openlakeforge.dev/docs/guides/migrate-from-v0-5-alpha/) |
| `olf project graph --project .` | Prints the Source → Domain → Product → Dashboard lineage as Mermaid text |
| `olf check dbt` | The Gold dbt project parses and compiles, each product's models sit in its `<product>_gold` and read only its own domain's Silver, and every source sits in its domain's schema. Incremental models are parsed (refs, sources, Jinja) but not compiled: `is_incremental()` needs a warehouse connection, so their rendered SQL is not checked |
| `olf check resources` | Every `container` and `init_container` in `infra/terraform/modules` sets `requests` (cpu and memory) and a memory limit; an expression such as `var.x` is accepted unchecked. Helm chart containers are sized through the values files and are not covered |
| `olf check disruption` | A Terraform module that sets `replicas`, `replicaCount` or `workers` to anything but 0 or 1, or a Helm values file with `replicaCount`/`replicas` above 1, defines a PodDisruptionBudget. Single-replica workloads are exempt by design: a budget on one pod blocks node drains |
| `olf check security` | Every entry in `.trivyignore.yaml` has an owner and an unexpired date within 90 days; not part of `olf check all` |
| `olf report validate [<dashboard>]` | Superset bundles are promotable; needs no cluster or cloud credentials |
| `olf infra e2e run --env local\|aws\|azure` | The deployed platform end to end. `--suite smoke` runs the preflight checks only; `--stage` and `-f <profile>` select what to check. |
| `olf infra e2e durability capture --output <file>` | Reads one local stage (`--stage`, `-f <profile>`) without launching a pipeline and writes a JSON baseline: Gold and Silver row counts and current Iceberg snapshot ids through Trino, Dagster run ids, Superset dashboard uuids, OpenMetadata entity names and one search hit count, the `ACTIVE.json` activation pointer, and every object in the stage's Bronze, Silver and Gold buckets and the ops bucket as key and size. Superset and OpenMetadata are skipped, and recorded empty, for a stage that does not run analytics or governance (Slim). It refuses to write a file that holds the value of a Secret `olf infra e2e run` scans for. |
| `olf infra e2e durability verify --baseline <file>` | Reads the same state again and lists every loss: a missing table, run, dashboard, entity or object, fewer rows, a changed snapshot id or object size, a changed activation pointer, or an empty search. It exits non-zero if there is any; new runs and objects are not differences. Run it after an upgrade or restore with the `--stage` the baseline was captured with. |
| `olf infra e2e secret-scan --path <file or dir>` | Fails if a platform Secret's value appears in Terraform state, ConfigMaps, the diagnostics bundle or a pod log (what `olf infra e2e run` checks), or in a file under any `--path` (repeatable; `--exclude <name>` skips a file name such as `secrets.enc`; `--also-env <NAME>` adds an environment variable's value). It launches no pipeline, reads files as bytes so binary dumps are covered, and names the file and the Secret, never the value. The restore drill runs it over the backup and the drill logs. |
| `olf infra e2e stage-drill crawl\|namespaces\|principals` | Checks, between the deploys of the stage drill (`stage_drill` in `local-full-e2e.yml`, dispatch only), what each stage holds. Name stages with `--present <stage>` and `--absent <stage>` (repeatable; `--stage` and `-f <profile>` select the deployment to read). `crawl` is the Trino crawl's `polaris-om-creds` copy and its CronJob and Jobs: a stage with governance on must hold the Secret and the CronJob, one with it off none of the three kinds. `namespaces` is the stage namespace. `principals` is `olf-<stage>-processing`, `deployer-<stage>` and `trino-catalog-<stage>` in Polaris, listed as root; a stage removed with `--allow-stage-removal` must have none. Reports every violation, never a Secret value. |
| `olf infra e2e registry-pull` | Proves a local stage's user-code pods pull the project image through its `spec.project.image.pull_secret_ref` Secret. It reads the image from the stage's active revision, checks that every workload running it and the `dagster` ServiceAccount list the Secret, and fails for an image that answers an anonymous pull (`--allow-public` to run anyway). Unless `--static-only`, it removes the image from every kind node with no host Docker credentials, restarts the code locations, launches one run and reschedules the code locations off one node, requiring a `Successfully pulled` event from a pod on each node each time. It launches a run, so it is not for a stage mid-restore. `--stage` and `-f <profile>` select the stage. |

### JSON reports

`olf infra doctor`, `olf infra plan` and every `olf check` target take `--json`.
The report is the only thing on stdout; progress, Terraform's plan and the
checks' own output go to stderr. Exit codes are the same as without `--json`.
When a command stops on an error before it has a result (an unknown `--phase`,
a failed `terraform plan`), stdout is empty, the error is on stderr and the exit
code is 1.

| Field | Type | Meaning |
| --- | --- | --- |
| `command` | string | `infra doctor`, `infra plan`, `check <target>` or `check all` |
| `ok` | boolean | `false` when any check failed. A plan with pending changes is still `true` |
| `changes` | boolean | `infra plan` only: Terraform found changes to apply |
| `checks[].id` | string | The check: a doctor item such as `project` or `terraform`, `terraform-plan:<phase>`, or the `olf check` target name |
| `checks[].status` | string | `pass` or `fail`; `changes` for a plan with pending changes; `skipped` for a target `olf check all` did not run after an earlier one failed |
| `checks[].message` | string | The check's result line, or its error when it failed |
| `checks[].remedy` | string or null | What to run next; `null` when the check names nothing |

```json
{
  "command": "infra plan",
  "ok": true,
  "changes": true,
  "checks": [
    {
      "id": "terraform-plan:platform",
      "status": "changes",
      "message": "Terraform changes are pending.",
      "remedy": "Apply with `olf infra deploy --phase platform` and the same options."
    }
  ]
}
```

## Stages and revisions

| Command | Does |
| --- | --- |
| `olf infra platform apply -f openlakeforge.yaml` | Create the cluster, shared services and every enabled stage, without your code. |
| `olf infra project image -f openlakeforge.yaml` | Build and push the project-code image; prints a digest-pinned reference. On `local` it pushes to `spec.project.image.repository`, else `PROJECT_CODE_IMAGE_REPOSITORY`; edited code with neither is refused rather than pushed over the public example. For the unmodified public example it prints the release-pinned reference and builds nothing. |
| `olf infra project build --project . --image <ref>` | Build and publish an immutable revision; prints its id. |
| `olf infra project deploy -f openlakeforge.yaml --stage <s> --revision <id>` | Activate a revision in a stage without rebuilding. |
| `olf infra project status -f openlakeforge.yaml` | The revision active in each stage. |
| `olf infra project revision inspect\|verify --revision <id>` | Read or verify a published revision. |
| `olf infra report export --stage dev` | Export Superset dashboards into their bundles. |
| `olf infra report import` | Import the bundles into a stage's Superset. |

## Sign in from the CLI

`olf login`, `olf whoami` and `olf logout` keep a Dex or external-issuer session
for the deployment in `openlakeforge.yaml`. They need no kubeconfig and read no
Secret.

| Command | Does |
| --- | --- |
| `olf login` | Authorization Code with PKCE in your browser. `--no-browser` prints the URL instead. |
| `olf whoami` | Instance, issuer, username, email, groups and ID token expiry. Refreshes an expired ID token. |
| `olf logout` | Deletes the stored session. |

Each takes `--profile-file` (`-f`, default `openlakeforge.yaml`). The issuer is
`https://auth.<base_domain>` with `identity.issuer: github`, or `issuer_url`
with `external`. The client id is `identity.client_ids['olf-cli']`, else
`olf-cli`. With access `tls: none` the Dex issuer is `http://`.

A profile with `spec.access` and no `spec.identity` has authentication off:
`olf login` and `olf whoami` say that sign-in is disabled and exit 0, `olf
logout` does nothing, and platform commands run without login. A profile
without `spec.access` publishes no routes, so these commands fail and point to
`olf infra`.

The session is `$OLF_HOME/sessions/<base_domain>.json`, mode 0600, and holds
the ID, access and refresh tokens. Run `olf login` again when `olf` reports the
session expired.

A local deployment serves the issuer with its own CA, which Python does not
read from the system store. Export it, then point `olf` at it:

```bash
olf infra access trust --output ./olf-local-ca.crt
export REQUESTS_CA_BUNDLE="$PWD/olf-local-ca.crt"   # SSL_CERT_FILE also works
olf login
```

## Query as yourself

`olf query` runs SQL against a stage's data as the signed-in person, through
the stage's Trino at `https://trino-<stage>.<base_domain>/v1`. It needs `spec.identity.issuer:
github` and `olf login` first. What you may read or write on each stage and
layer is your role's `data_access` row in `release/identity-roles.yaml`, which
Polaris enforces ([ADR 0019](https://openlakeforge.dev/docs/adr/0019-data-plane-authorization-deferral/)).
When Polaris or the object store refuses a query, `olf query` says why.

```bash
olf query --stage prod "SELECT count(*) FROM order_revenue_gold.mart_order_revenue_by_day"
```

| Option | Default | Meaning |
| --- | --- | --- |
| `--stage` | `dev` | `dev`, `uat` or `prod`: the stage's catalog, `lakehouse_<stage>`, is the session default, so SQL names `<schema>.<table>` |
| `--format` | `table` | `table`, `csv` or `json` (one object per row) |
| `--file` | — | Read the SQL from a file instead of the argument |
| `--profile-file`, `-f` | `openlakeforge.yaml` | Deployment Profile of the deployment |

`olf infra query` runs the same SQL as the stage's workload user through
`kubectl exec`, for operators: it needs cluster access, not a sign-in.

## Read the platform

These commands read the platform as the signed-in person, through the platform
API at `https://<base_domain>/api`
([ADR 0021](https://openlakeforge.dev/docs/adr/0021-platform-api/)). They need `olf login` first, no
kubeconfig, and no infra credential: the API decides what your role may read, and
what it may launch.

| Command | Reads | Lowest role |
| --- | --- | --- |
| `olf jobs list` | The stage's pipeline jobs | `data-engineer` |
| `olf runs list` | The stage's most recent runs, newest first; `--job` for one job, `--limit` 1 to 100 (default 20) | `data-engineer` |
| `olf runs show <run-id>` | One run's status, times and tags | `data-engineer` |
| `olf runs launch <job>` | Launches the job as you, on `dev` only; the API stores an audit record first and launches nothing if it cannot | `data-engineer` |
| `olf logs` | The stage's archived pod log lines for a day (`--date`, default today in UTC) or one `--hour`; `--pod`, `--container`, `--run-id`, `--product`, `--component`, `--severity` (that level or above), `--grep` (text in the message, ignoring case; 1 to 200 characters), `--since`, `--until`, `--limit` 1 to 5000 (default 500) | `data-engineer` on `dev`; `platform-admin` on every stage |
| `olf health <stage>` | The stage's health: its state, then its service rows grouped by service under the service's worst state, each with its component key and display name, state, when it was observed, until when that answer is usable, its last durable write where the API reports one (`—` otherwise) and why; then each pipeline's state; `unknown` and `disabled` print as themselves, never as healthy | `data-engineer` |
| `olf pipelines health <stage>` | Each pipeline's state and the reason behind it | `data-engineer` |
| `olf domain list` | Governance domains, as OpenMetadata shows them to you | `viewer`, then your OpenMetadata roles |
| `olf product list` | Data products and their domains, as OpenMetadata shows them to you | `viewer`, then your OpenMetadata roles |
| `olf glossary search [QUERY]` | The stage's glossary terms whose name, synonym or description contains the text, best match first; `--stage`, `--limit` 1 to 100 (default 20), `--offset` | `viewer` on `dev`; `analyst` and above on every stage |
| `olf glossary show <glossary.Term>` | A term's definition, synonyms, owner, and the products, columns and metrics that use it | `viewer` on `dev`; `analyst` and above on every stage |
| `olf metric list` | The stage's metrics by product then name; `--product`, `--limit` 1 to 100 (default 50), `--offset` | `viewer` on `dev`; `analyst` and above on every stage |
| `olf metric show <name>` | A metric's expression with its filter, `ai_context`, source table in the stage, glossary terms and the file it is declared in; `--product` when two products declare the name | `viewer` on `dev`; `analyst` and above on every stage |
| `olf product context <product>` | A product's tables with column descriptions and keys, the join paths between them, its metrics and its owners | `viewer` on `dev`; `analyst` and above on every stage |
| `olf report import <dir>` | Imports one report directory into the stage's Superset, on `dev` only, overwriting the assets it carries. Only `metadata.yaml`, `datasets/`, `charts/` and `dashboards/` are sent, at most 500 files, 2 MiB each and 10 MiB in all; datasets use the stage's existing connections, and every schema they read must already be granted by the artifacts phase | `data-engineer` |
| `olf report export <dashboard> <dir>` | Exports one dashboard, by uuid or slug, into a report directory, stage-neutral; its managed assets are replaced | `data-engineer` |

`olf glossary`, `olf metric` and `olf product context` print what the platform
API calls the `declared` section (Git, from the project revision the stage
runs), then a table with the state of `declared`, `published` (OpenMetadata) and
`observed` (runtime) and why. `glossary show`, `metric show` and
`product context` also print what OpenMetadata holds when it holds the entity
(`metric show` says whether it matches Git); a list prints `unknown` for
`published` and does not call OpenMetadata. `product context` also prints what
the runtime measured: the observed SLA (state and cause, the data's age
against its maximum) and the profiler's statistics per table (row count, and
per column the null rate, distinct count and, where the product's
classification allows, min, max and mean), with when they were taken and a
`STALE` mark on a profile older than its daily refresh; a part that could not
be read prints its state and reason in place of numbers. `glossary show` and
`metric show` print no observed values: their `observed` is
`capability_unavailable` on a deployment without OpenMetadata and `unknown`
otherwise. A command exits 1 when the
`declared` section cannot be read (no active revision, the object store
unreachable), after printing why; `--json` prints the API's answer unchanged and
exits the same way. See [Governed context](https://openlakeforge.dev/docs/reference/platform-api/#governed-context).

Each but `report export` takes `--json` to print the API's JSON instead of a table, and
`--profile-file` (`-f`). `jobs`, `runs`, `logs` and `report` take `--stage` (default `dev`). When
the API refuses, the command says why: an expired or rejected session asks you
to run `olf login`, and a role below the operation's floor names the role it
needs.

### Health exit codes

`olf health` and `olf pipelines health` print what the API evaluated and
evaluate nothing themselves; `--json` prints the API's response unchanged.
The stage is a positional argument, not `--stage`.

| Exit code | Meaning |
| --- | --- |
| `0` | `olf health`: the stage is `healthy`, `warning` or `disabled`. `olf pipelines health`: no pipeline is `critical` or `unknown` |
| `1` | `olf health`: the stage is `critical` or `unknown`. `olf pipelines health`: a pipeline is. Also any failure to get an answer, such as an unreachable API, a refused session or a stage the deployment does not enable |

## Browse and manage bucket files

`olf bucket` works on the files in a stage's lakehouse buckets through the same
platform API, with the same sign-in. The API decides which stages and buckets
your role may use; by default that is `dev` for a `data-engineer` and every
stage for a `platform-admin`. Name a file as `<bucket>/<key>`, and a folder as
`<bucket>/<prefix>/`. Every command takes `--stage` (default `dev`) and
`--profile-file` (`-f`); uploads and downloads stream, so a large file is never
held in memory.

| Command | Does |
| --- | --- |
| `olf bucket list` | The stage's buckets; `--json` for the API's JSON |
| `olf bucket ls <bucket>[/<prefix>/]` | The folders and files directly under a bucket or prefix, every page; `--json` |
| `olf bucket get <bucket>/<key> [dest]` | Downloads one file; `dest` defaults to `./<file name>` |
| `olf bucket put <src> <bucket>/<key>` | Uploads one file; a target ending in `/` keeps the file's name. Refuses to replace an existing object unless `--overwrite` |
| `olf bucket mkdir <bucket>/<prefix>/` | Creates a folder |
| `olf bucket mv <bucket>/<from> <to>` | Renames a file, or a folder when both keys end in `/`; `<to>` is a key in the same bucket |
| `olf bucket rm <bucket>/<key>` | Deletes a file, or everything under the prefix when the key ends in `/`. Asks first unless `--yes`; prints each key the API could not delete and exits non-zero |

## Installation and toolchain

| Command | Does |
| --- | --- |
| `olf version` | The installed version. |
| `olf toolchain list\|install\|path\|clean` | Inspect, download or remove the managed Terraform, Helm, kubectl and kind. |
| `olf distribution path\|verify` | The platform payload the package ships, such as the Terraform roots. |

## Environment variables

| Variable | Default | Meaning |
| --- | --- | --- |
| `OLF_HOME` | `~/.openlakeforge` | Toolchain, platform payload, state, kubeconfigs and sign-in sessions |
| `REQUESTS_CA_BUNDLE`, `SSL_CERT_FILE` | unset | CA file `olf login` verifies the issuer against |
| `OLF_TOOLCHAIN_MODE` | `managed` | `host` uses Terraform, Helm, kubectl and kind from `PATH` |
| `OLF_PORT_FORWARD` | unset | `1` makes `olf` port-forward instead of using the local ingress |
| `PROJECT_CODE_IMAGE_REPOSITORY`, `PROJECT_CODE_IMAGE_TAG` | `ghcr.io/openlakeforge/openlakeforge/project-code`, `local` | Where `olf infra project image` pushes on the local provider when the profile has no `spec.project.image.repository` |
| `AWS_*`, `AZURE_*` | | Cloud settings; see [Deploy to AWS](https://openlakeforge.dev/docs/guides/cloud/deploy-to-aws/) and [Deploy to Azure](https://openlakeforge.dev/docs/guides/cloud/deploy-to-azure/) |

## Contributor commands

A source checkout runs the same commands through
`uv run --project tools/olf --locked olf`. Commands that only make sense there,
such as `olf check all`, `olf infra smoke run` and `olf release`, are described in
[AGENTS.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.7.5-beta.1/AGENTS.md) and [tools/olf/README.md](https://github.com/OpenLakeForge/openlakeforge/blob/v0.7.5-beta.1/tools/olf/README.md).

---

<small>Synced from openlakeforge @ `v0.7.5-beta.1` (`8a7bf72`), [docs/reference/cli.md](https://github.com/OpenLakeForge/openlakeforge/blob/8a7bf7296968594c1676b0f581f7c40c3d31b7ba/docs/reference/cli.md).</small>
