Query YBA with the yba CLI
This skill is for read-only lookups against a live YugabyteDB Anywhere
instance via the yba CLI, whose source lives at managed/yba-cli in this
repo. It answers questions like "what universes exist on this YBA?", "is
there a task running on universe X?", "what's this provider's config?" — not
for changing anything.
Guardrail: only ever run list, describe, or get subcommands (and the
read-only yba tree / --help). Never run create, edit, delete,
pause, resume, restart, upgrade, abort, retry, or similar mutating
verbs under this skill — those are a separate, explicit ask that the user
must request directly, with its own confirmation.
Step 1: Get the yba binary
Check first: which yba or managed/yba-cli/yba --help. If it's missing,
build it from source (no need for the full release pipeline — a plain go build is enough for querying):
cd managed/yba-cli && go build -o yba .
Then invoke it as managed/yba-cli/yba <command> (or add that path to PATH
for the session).
Step 2: Point it at the right host + credentials
The CLI needs a host (-H/--host, default http://localhost:9000) and
an API token (-a/--apiToken). Resolution order: -H/-a flags >
YBA_HOST/YBA_APITOKEN env vars > the config file at
$HOME/.yba-cli/.yba-cli.yaml (written by a prior yba auth).
- If the user already has a working config (
~/.yba-cli/.yba-cli.yaml
exists, or yba universe list succeeds with no extra flags), just use it —
don't re-auth.
- Otherwise, ask the user for the host and an API token (generated in the YBA
UI under Profile → API Keys). Prefer passing them per-invocation via
-H/-a flags or exporting YBA_HOST/YBA_APITOKEN env vars for this
session, rather than running yba auth, since yba auth persists into
~/.yba-cli/.yba-cli.yaml and could silently overwrite a config the user
already has for a different YBA instance. Only run yba auth -f -H <host> -a <token> if the user explicitly wants the CLI configured persistently.
- Don't use
yba login -p <password> for this skill — it takes the password
as a plain CLI argument (leaks into shell history / process listing) and
also persists to the config file. An API token is the right credential for
read-only querying.
Step 3: Run the query
Use -o json when you need to parse or filter the output (e.g. pipe to
jq); the default table format is for human eyeballing. pretty gives
indented JSON.
For the full command tree and flags, see reference.md in
this skill directory, or run yba tree / yba <resource> <subcommand> --help / read managed/yba-cli/docs/yba_<resource>.md directly.
Quick examples:
yba universe list -o json
yba universe describe --name <universe-name> -o json
yba task list --universe-name <universe-name>
yba backup list --universe-names <universe-name> -o json
yba alert list --states active
yba provider list -o json
Notes
- Command and flag names are case-insensitive, but stick to the documented
casing shown in
--help / reference.md.
- Filters that take lists (
--uuids, --states, --universe-names, etc.)
are comma-separated strings, not repeated flags.
- Some subcommands take their target as a flag on the parent command
rather than on
list itself — e.g. yba universe node list -n <universe-name>, yba universe table list -n <universe-name>, yba backup pitr list --universe-name <universe-name>.
--wait/--timeout only matter for commands that kick off a YBA task;
they're irrelevant to pure reads and safe to ignore.
alert, oidc, and telemetry-provider are preview command groups —
they don't exist unless YBA_FF_PREVIEW=true is set in the environment,
e.g. YBA_FF_PREVIEW=true yba alert list.
1---2name: yba-query-cli3description: Query a running YugabyteDB Anywhere (YBA) control plane using the `yba` CLI (managed/yba-cli) — list/describe universes, tasks, backups, providers, alerts, users, storage/EAR/EIT configs, xClusters, RBAC, runtime config, telemetry providers, and more. Use when the user wants to inspect, list, describe, or look up the current state of a live YBA instance. Read-only: do not use for creating, editing, deleting, pausing/resuming, or upgrading YBA resources.4---56# Query YBA with the yba CLI78This skill is for **read-only lookups** against a live YugabyteDB Anywhere9instance via the `yba` CLI, whose source lives at `managed/yba-cli` in this10repo. It answers questions like "what universes exist on this YBA?", "is11there a task running on universe X?", "what's this provider's config?" — not12for changing anything.1314**Guardrail:** only ever run `list`, `describe`, or `get` subcommands (and the15read-only `yba tree` / `--help`). Never run `create`, `edit`, `delete`,16`pause`, `resume`, `restart`, `upgrade`, `abort`, `retry`, or similar mutating17verbs under this skill — those are a separate, explicit ask that the user18must request directly, with its own confirmation.1920## Step 1: Get the `yba` binary2122Check first: `which yba` or `managed/yba-cli/yba --help`. If it's missing,23build it from source (no need for the full release pipeline — a plain `go24build` is enough for querying):2526```bash27cd managed/yba-cli && go build -o yba .28```2930Then invoke it as `managed/yba-cli/yba <command>` (or add that path to `PATH`31for the session).3233## Step 2: Point it at the right host + credentials3435The CLI needs a **host** (`-H`/`--host`, default `http://localhost:9000`) and36an **API token** (`-a`/`--apiToken`). Resolution order: `-H`/`-a` flags >37`YBA_HOST`/`YBA_APITOKEN` env vars > the config file at38`$HOME/.yba-cli/.yba-cli.yaml` (written by a prior `yba auth`).3940- If the user already has a working config (`~/.yba-cli/.yba-cli.yaml`41 exists, or `yba universe list` succeeds with no extra flags), just use it —42 don't re-auth.43- Otherwise, ask the user for the host and an API token (generated in the YBA44 UI under Profile → API Keys). **Prefer passing them per-invocation via45 `-H`/`-a` flags or exporting `YBA_HOST`/`YBA_APITOKEN` env vars for this46 session**, rather than running `yba auth`, since `yba auth` persists into47 `~/.yba-cli/.yba-cli.yaml` and could silently overwrite a config the user48 already has for a different YBA instance. Only run `yba auth -f -H <host>49 -a <token>` if the user explicitly wants the CLI configured persistently.50- Don't use `yba login -p <password>` for this skill — it takes the password51 as a plain CLI argument (leaks into shell history / process listing) and52 also persists to the config file. An API token is the right credential for53 read-only querying.5455## Step 3: Run the query5657Use `-o json` when you need to parse or filter the output (e.g. pipe to58`jq`); the default `table` format is for human eyeballing. `pretty` gives59indented JSON.6061For the full command tree and flags, see [reference.md](reference.md) in62this skill directory, or run `yba tree` / `yba <resource> <subcommand>63--help` / read `managed/yba-cli/docs/yba_<resource>.md` directly.6465Quick examples:6667```bash68yba universe list -o json69yba universe describe --name <universe-name> -o json70yba task list --universe-name <universe-name>71yba backup list --universe-names <universe-name> -o json72yba alert list --states active73yba provider list -o json74```7576## Notes7778- Command and flag names are case-insensitive, but stick to the documented79 casing shown in `--help` / reference.md.80- Filters that take lists (`--uuids`, `--states`, `--universe-names`, etc.)81 are comma-separated strings, not repeated flags.82- Some subcommands take their target as a flag on the **parent** command83 rather than on `list` itself — e.g. `yba universe node list -n84 <universe-name>`, `yba universe table list -n <universe-name>`, `yba85 backup pitr list --universe-name <universe-name>`.86- `--wait`/`--timeout` only matter for commands that kick off a YBA task;87 they're irrelevant to pure reads and safe to ignore.88- `alert`, `oidc`, and `telemetry-provider` are preview command groups —89 they don't exist unless `YBA_FF_PREVIEW=true` is set in the environment,90 e.g. `YBA_FF_PREVIEW=true yba alert list`.