This is the canonical repo-level guide for AI assistants working in
confighub/examples.
If you want the shortest strict protocol first, read AGENTS.md before this file.
Use this file for:
- repo-level AI operating rules
- CLI and mutation safety guidance
- choosing the right example family
Do not treat this file as the walkthrough script. When the user wants
pause-heavy demo mode, use the selected example's AI_START_HERE.md, or
incubator/AI_START_HERE.md for
incubator-wide walkthrough conventions.
Do not hardcode the checkout path. This repo may be checked out as examples,
confighub-examples, or another folder name.
Resolve the repo root first:
git rev-parse --show-toplevelIf you need live ConfigHub state, use the cub CLI.
Do not assume that fetching https://hub.confighub.com directly will give you
meaningful data. It is a browser application. For machine use, cub is the
right interface.
Use:
cub auth login
cub context list --json
cub space list --json
cub target list --space "*" --jsonAvoid these common mistakes:
- use
cub version, notcub --version - use
cub context list, notcub auth status - use
--jsonand--jqwhen you want machine-readable output - use
--where "Labels.Key = 'value'"for label filtering on list commands, not guessed--labelfilters - use
--dry-runbeforecub function doorcub unit applyif you want a non-mutating preview
Good discovery commands:
export CONFIGHUB_AGENT=1
cub --help-overview
cub info
cub context list --jsonStart in read-only mode.
Recommended order:
- inspect the repo
- run repo verification
- inspect live ConfigHub state in JSON
- only then run mutating example flows if the human wants that
These commands do not mutate ConfigHub or any cluster:
cd <your-examples-checkout>
./scripts/verify.sh
rg --files .
cub context list --json
cub space list --json
cub target list --space "*" --jsonIf you already know a specific unit:
cub unit get --space <space> --json <unit>Pick the family that matches the user's goal:
- Stable no-cluster intro:
promotion-demo-dataandinitiatives-demo - GitOps import or brownfield discovery:
gitops-import,incubator/import-from-live,incubator/gitops-import-argo,incubator/gitops-import-flux - App mutation and platform flow:
springboot-platform-app-centric - Worker extensibility:
custom-workers - Layered and advanced model:
incubator/global-app-layer - Full experimental catalog:
incubator/README.md
If the user wants a human-oriented overview of the repo, README.md is the public front door, but it is not the primary AI entry point.
Use these meanings consistently across examples:
- preview = read-only orientation
- fast preview = read-only example-specific path such as
./setup.sh --explain,./setup.sh --explain-json, or other non-mutating preview/report commands - fast operational evaluation = preview plus the smallest real setup and proof sequence that demonstrates the example actually works
If a user says "help me evaluate it quickly" and does not explicitly ask for read-only mode, the default should be:
- run the fast preview
- run the smallest real operational proof path for that example
- stop before cleanup unless asked
Do not conclude that an example is ready based only on preview output if the example provides a real setup path and proof path.
Treat these as stable repo-wide contracts:
| Command | Output contract | Mutates anything? |
|---|---|---|
./scripts/verify.sh |
exit code + plain text verifier output | no |
cub context list --json |
JSON array of contexts | no |
cub space list --json |
JSON array of spaces | no |
cub target list --space "*" --json |
JSON array of targets | no |
cub unit get --space <space> --json <unit> |
JSON object for one unit | no |
cub function do --dry-run --json ... |
JSON invocation response | no config write |
cub unit apply --dry-run --json ... |
JSON apply preview | no live apply |
Example-specific seams vary. Do not assume ./verify.sh --json,
./setup.sh --explain-json, ./find-runs.sh --json, or similar flags exist
unless the example README, AI guide, script help, or source confirms them.
Examples often use:
./setup.sh./set-target.shcub unit applycub function do
Those do create or mutate ConfigHub objects, and in some cases can affect a live cluster.
Before you run them, say clearly:
- what space(s) will be created or changed
- what unit(s) will be created or changed
- whether any target or cluster will be touched
- what read-only or dry-run command could be used first
Use the selected example's AI_START_HERE.md when the user wants a guided demo
with pauses after each stage.
Use incubator/AI_START_HERE.md when the work
is specifically in the incubator and you need incubator-specific walkthrough
conventions.
If you are starting fresh, the best single next step is:
cd <your-examples-checkout>
./scripts/verify.shThen choose the example family that matches the user's goal. ./setup.sh --explain ./setup.sh --explain-json | jq
Those commands do not mutate ConfigHub.
If you need to discover live runs for the layered examples, use:
```bash
cd incubator/global-app-layer
./find-runs.sh
./find-runs.sh realistic-app --json | jq
This is also read-only.