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

# Golain CLI overview

> golain — terminal UI and scriptable CLI for the Golain platform API.

**golain** is the official terminal interface to Golain. It ships from the [ilyama](https://github.com/golain-io/ilyama) repository under `tools/platform-tui/` and is distributed at **[https://tools.ilyama.golain.io](https://tools.ilyama.golain.io)**.

The binary was formerly named `platform-tui`; the CDN installer still provides a **`platform-tui` symlink** for back-compat.

Use it two ways:

| Mode    | How                             | Best for                                                            |
| ------- | ------------------------------- | ------------------------------------------------------------------- |
| **TUI** | Run `golain` with no subcommand | Interactive browsing, stats, live event stream, Omega deploy wizard |
| **CLI** | `golain <command> [flags]`      | Scripts, CI, JSON output                                            |

Both modes share the same credential profiles and org/project **context**.

## Install

```bash theme={null}
curl -fsSL https://tools.ilyama.golain.io/install.sh | sh
```

→ Full options: [Install golain](/tools/platform-tui/install)

## Quick example

```bash theme={null}
golain login
golain context set --org=my-org --project=my-project
golain fleets list
golain devices list --fleet=sensors
golain --output=json devices mqtt-details sensor-01 --fleet=sensors
```

## Omega edge deploy

For SQLite replication on edge devices, use the **Deploy Omega** wizard in the TUI or the **`golain omega scaffold`** CLI. Both download **Omega** and **SQLite deps** from the CDN, issue MQTT certificates, generate config, and seed a sample database.

```bash theme={null}
golain omega scaffold --device=sensor-01 --fleet=sensors --sample-db --transport=tls
```

→ [Omega deploy guide](/tools/platform-tui/omega-deploy)

## Global flags

| Flag        | Default   | Description                 |
| ----------- | --------- | --------------------------- |
| `--profile` | `default` | Named credential profile    |
| `--output`  | `table`   | `table`, `json`, or `jsonl` |
| `--yes`     | `false`   | Skip confirmation prompts   |

Exit codes: `0` success · `1` error · `2` not found.

## Release channels

| Channel  | Manifest               | Typical use           |
| -------- | ---------------------- | --------------------- |
| `stable` | `manifest/stable.json` | Default for end users |
| `latest` | `manifest/latest.json` | CI builds from `main` |
| `dev`    | `manifest/dev.json`    | Maintainer testing    |

```bash theme={null}
golain channel set --name=stable
golain upgrade
```

## Feature parity with console

| Area                            | CLI support                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| Orgs, projects, fleets, devices | Full CRUD                                                                              |
| Tags                            | Full CRUD                                                                              |
| OTA releases & deployments      | Full CRUD + trigger/cancel                                                             |
| Integrations                    | List accounts & bindings                                                               |
| Users                           | List org members                                                                       |
| Events                          | Audit, MQTT, TSDB snapshots + live SSE watch                                           |
| Edge sync (v2)                  | Lineages, **registry** schema reviews, staged/written rows, policy auto-set on approve |
| Omega deploy                    | TUI wizard + `omega scaffold`                                                          |

## TUI highlights

Interactive screens include **Stats & graphs**, **Event stream**, **Data explorer** (QueryScript), **Edge sync** governance (v2 registry reviews), and **Deploy Omega** from device detail. See [TUI guide](/tools/platform-tui/tui-guide) and [Edge Sync operator guide](/edge/data-sync/platform-tui-guide).

### Edge sync operator workflow (TUI)

Edge sync is **TUI-first** — there is no `golain edge …` CLI subcommand yet. After setting project context:

1. **Project menu → Edge Sync → Lineages** — inspect per-device table lineages, materialization errors, registry links.
2. **Edge Sync → Schema Reviews** — lists **registry** reviews (`/edge/registry-reviews/*`, the v2 primary path). Claim (`c`), approve (`a`), or reject (`x`).
3. On **approve**, the TUI PATCHes project edge policy (`schema_coalescing_mode=project`, `allow_auto_create_device_data_points=true`) then submits column actions derived from the registry schema.
4. **`d` / `w`** on review or lineage detail — staged vs written (mirror) row payloads.

Use the [HTTP API](/edge/data-sync/api-reference) for coalesced mirror consolidation, registry reconcile, or fleet-scoped policy.

## vs Device SSH CLI

|               | golain (this tool)               | golain-cli (SSH)    |
| ------------- | -------------------------------- | ------------------- |
| Scope         | Full platform API + Omega deploy | Devices + SSH focus |
| Output        | table/json/jsonl                 | Human tables        |
| TUI           | Yes                              | No                  |
| SSH to device | No                               | Yes (`golain ssh`)  |

Use both: **golain** for fleet ops and edge scaffolding, **golain-cli** for field SSH.

<CardGroup cols={2}>
  <Card title="Install" icon="download" href="/tools/platform-tui/install">
    CDN install and upgrade.
  </Card>

  <Card title="Login & profiles" icon="key" href="/tools/platform-tui/login">
    Zitadel device authorization flow.
  </Card>

  <Card title="Omega deploy" icon="server" href="/tools/platform-tui/omega-deploy">
    Scaffold Omega + SQLite sync from CLI or TUI.
  </Card>

  <Card title="CLI reference" icon="book" href="/tools/platform-tui/cli-reference">
    All subcommands and examples.
  </Card>
</CardGroup>
