---
title: LimiLake CLI primer
slug: SKILL
summary: Must-know conventions for operating LimiLake from the terminal, and when to read more.
---

# LimiLake CLI primer

You are operating a LimiLake workspace through the `limilake` CLI. Prefer it over guessing from training data — the platform's nouns and verbs are specific. When a detail is not covered here, run `limilake docs <topic>` (offline) or `limilake <domain> explain` for live state.

## Mental model

- **Workspace** -> **lakehouse** -> **schema** -> **table** / **file**.
- Code is **functions** (`.py`) and **apps** (`.app.tsx`), authored as files in the workspace git repo. Ordinary files such as `README.md` are valid Workspace source too.
- A Function lives at `functions/<slug>/function.py`. Scaffold it with `limilake add function <slug>` so its declaration matches the Workspace Contract: Contract v2 generates `function(id=, name=, description=, access=, run_as=)` with durable identity, while the Contract v1 compatibility scaffold omits the v2-only `id`. For an MCP-exposed Function, `description=` becomes the first paragraph of its projected tool description.
- Data containers (lakehouses) are **server-side platform objects** — discover and provision them via the API, never via a repo file.

## Act inline (don't ask) for

- Discovery: `limilake workspace list`, `limilake lakehouse list`, `limilake table list --lakehouse <ref>`, `limilake lakehouse explain <name>`.
- Read-only queries: `limilake query "SELECT ..." --lakehouse <ref>` and `limilake table read <schema.table> --lakehouse <ref>`.
- Inspecting executions: `limilake execution list`, `limilake execution show <id>`, `limilake execution logs <id>`, `limilake function logs <path>`, and `limilake function watch <path> <run-id>` for a durable Function Run (the Run ID is not the linked Execution ID).

## Confirm first for

- Mutations: creating/deleting workspaces or lakehouses, changing live Workspace source, granting credentials, revoking tokens.
- Access changes: Workspace Memberships (`limilake workspace member add|update|remove|promote`), Tenant Roles (`limilake user update --tenant-role`), and every `limilake governance` command, which records the `--reason` you give.
- Anything that changes live Workspace behavior: pushing an accepted revision to `main` makes valid Function routes and schedules current after indexing, queues its exact Build, and automatically activates successful App artifacts. `limilake publication rollback <deployment-manifest-id>` moves the App publication pointer back to an older retained Deployment Manifest. Rollback changes what an App serves right now; inspection (`limilake publication show`) works from any session.

## Conventions

- `--output table|json|yaml` selects record presentation. Completion scripts,
  raw downloads, Git credential responses and live child/stream protocols keep
  their own stdout format. For `file download`, `--output-file PATH` names the
  destination and `-o json` reports versioned download metadata. `-o/--output`
  and `LIMILAKE_OUTPUT` always select the format, never a file.
  Use JSON only when the command documents a structured result.
- Authentication is per-profile; `--profile <name>` overrides the active account. Inside a sandbox, credentials are injected automatically — no login needed.
- Access has two layers. The Tenant Role (`tenant_admin` or `user`) governs Tenant administration; the Workspace Access Level (`viewer`, `editor`, or `owner`) governs everything inside one Workspace. `tenant_admin` grants no Workspace content. `limilake --output json context` shows both, read live. HTTP 426 `cli_upgrade_required` means run `limilake upgrade`, then retry.
- Queries are read-only and bounded; the real access boundary is enforced server-side, so a query only ever sees data your grants allow.
- In an ordinary signed standalone CLI install, inspect the exact managed Build toolchain with `limilake toolchain doctor`; use `limilake toolchain repair` only when its report names repair as the next action.
- `limilake build` uses the same Build Engine as production. Signed standalone installs use the exact managed cache; the hosted LimiLake Agent image instead uses its image-pinned engine and base-image tools, so `toolchain doctor` and `repair` do not govern that override. Use `--offline` only when the active toolchain and required pnpm-store dependencies are already present; project manifests and frozen lockfiles remain authoritative.

- There is no separate Function deployment. The accepted `main` revision is the source publication: valid Function routes and schedules become current after it is indexed, while successfully built App artifacts activate through the Publication pointer.
- Human Git credentials may push either the editor Draft or protected `main`: use `git push origin HEAD:drafts/workspace` for work in progress, or `git push origin HEAD:main` to publish. Every accepted `main` push queues an exact-SHA production Build. A Contract-v2 revision may contain Apps, Functions, both, or neither (for example only `README.md`) and still produces a valid no-op manifest for absent surfaces. Build and App delivery attempts remain inspectable with `limilake publication show`; return an App to a retained Deployment Manifest with `limilake publication rollback <deployment-manifest-id>`.
- Commit the intended files before pushing. Those two refs are the only human push targets: keep feature branches local and use an explicit `HEAD:<target>` push. A `[code=git_ref_not_allowed]` rejection names an unsupported target; `[code=git_multi_ref_unsupported]` means `main` must be pushed separately. Run `limilake explain git_ref_not_allowed` or `limilake explain git_multi_ref_unsupported` for the matching recovery instructions. Source-validation errors on `main` require fixing the named file and committing again. Action/sync handlers take no parameters or one required `dict[str, T]` input parameter without a default.

## When to read more

- Git or CLI rejection recovery -> `limilake explain <code>` for an offline explanation, or `limilake docs push-rejections` for the complete code index; neither needs a profile or login.
- First steps from install to a running Function -> `limilake docs quickstart`.
- How functions expose actions/HTTP/sync/schedules -> `limilake docs functions`.
- Function access modes and `limilake.caller()`, AI decisions and model roles, client addresses, share links, and publication detail -> `limilake docs functions-reference`.
- Running a Function on a schedule, failure notices, and auto-pause -> `limilake docs schedules`.
- Where code runs, its limits, and what a sandbox can reach -> `limilake docs sandboxes`.
- Apps, and public Apps anyone can open with a share link -> `limilake docs apps`.
- Serving an App or a Function's HTTP routes on your own hostname -> `limilake docs custom-domains`.
- Starting an App, a Function or a Query from a template -> `limilake docs templates`.
- Using LimiLake from an AI client over MCP, and exposing a Function as a tool -> `limilake docs mcp`.
- Running an agent from code (`agent.run()`), resuming it by session, and scheduling it -> `limilake docs agents`.
- Every agent.run() option, scope, visibility rule and scheduling note -> `limilake docs agents-reference`.
- Lakehouses, schemas, and SQL -> `limilake docs querying-data`.
- Reaching external providers without raw secrets -> `limilake docs connections`.
- Every Connection command and flag, Custom Connections, rotation, files and test reports -> `limilake docs connections-reference`.
- Reporting platform friction safely -> `limilake docs reporting-problems`.
- What LimiLake is and how its parts fit -> `limilake docs overview`.
- First-time setup, and access errors (HTTP 403 and 426) -> `limilake docs getting-started`.
