> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textql.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ontology as Code — the Refinery CLI

> Data and platform engineers, analytics engineers who live in a terminal, and anyone wiring TextQL into CI or automation. You should be comfortable with a shell; Python helps but…

Everything the platform can do — query connectors, run governed queries, author and install ontology files, drive agents — from your terminal, scriptable and CI-ready. This workshop takes you from install to a complete **ontology-as-code loop**: author locally, test against live data, install programmatically, and measure the difference it makes.

## Who this is for

Data and platform engineers, analytics engineers who live in a terminal, and anyone wiring TextQL into CI or automation. You should be comfortable with a shell; Python helps but the CLI does the heavy lifting.

## What you'll be able to do

* Install and authenticate the CLI, and read `refinery info` before assuming any capability exists.
* Query any connector into a **named remote sandbox** and analyze there — without pulling data to your laptop.
* Run **governed .tql query surfaces** with typed parameters — the same approved queries the product runs.
* Author new .tql files using the deployment's own **writing-tql skill** as the authoritative grammar.
* Install ontology files programmatically and run the **execute-before-save** loop that catches bugs before users see them.
* Script a **before/after evaluation** that proves what your ontology changed.

> [card] Install & authenticate
>
> One binary, device-flow or API-key auth, and refinery info as your compass.

> [card] Query into sandboxes
>
> Connectors → named Python kernels; aggregate in place, never locally.

> [card] Run governed queries
>
> The ontology mount, ANA.md, and executing approved .tql with parameters.

> [card] Author .tql correctly
>
> The deployment's own writing-tql skill is the grammar — use it, don't guess.

> [card] Ontology as code
>
> Install files via RPC, with the review discipline that makes it safe.

> [card] Prove the lift
>
> Baseline → install → re-run: the before/after that sells the ontology.

## Before you start

You need a TextQL workspace with at least one database connector and permission to use the CLI (an admin or data-team role). Modules 3–5 write to the ontology — run them in a workspace where that's welcome (a sandbox org, or your team's with a heads-up).

> [!NOTE]
>
> **🤖 Prefer to have Ana coach this workshop?** — Paste the runner from `ana-runner-full.md` into a new Ana thread — you run the CLI commands in your terminal; Ana explains output and coaches module by module.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.