Skip to content

feat(cli): all-namespaces list, self-forwarding topup, and an init command#93

Merged
jmgilman merged 3 commits into
masterfrom
feat/cli-list-all-namespaces
Jun 3, 2026
Merged

feat(cli): all-namespaces list, self-forwarding topup, and an init command#93
jmgilman merged 3 commits into
masterfrom
feat/cli-list-all-namespaces

Conversation

@jmgilman
Copy link
Copy Markdown
Contributor

@jmgilman jmgilman commented Jun 3, 2026

A batch of CLI UX one-offs (no operator/API changes).

Changes

  1. list defaults to all namespaces; -A removed. yacd's identity model puts one environment per namespace (up foo → ns foo, devnet → ns devnet), so the old current-namespace default was routinely empty/misleading (yacd devnet then yacd list showed nothing). list now sweeps all namespaces by default; -n still scopes to one. Empty namespace was already the adapter's all-namespaces convention.

  2. topup self-forwards the faucet; LOVELACE is positional. topup targeted the in-cluster faucet Service URL (unreachable from the host), forcing a yacd run -- sh -c '… --faucet-url "$YACD_FAUCET_URL"' wrapper. It now opens a short-lived port-forward itself (reusing the connect/run machinery via a new forwardEndpoints helper), POSTs, and tears it down; the same session forwards Kupo so topup --await works standalone. Explicit --faucet-url or ambient YACD_FAUCET_URL (inside yacd run) still skip self-forwarding, and the security trust gate is unchanged (loopback exempt; secret read only after the gate). LOVELACE becomes a required positional (yacd topup NAME LOVELACE); --address stays a required flag. Breaking, safe pre-1.0.

  3. New yacd init. Prints a fully-commented developer Environment template to stdout (yacd init > yacd.yaml). The active portion is a batteries-included local devnet (faucet + funded wallet); commented blocks document the rest of the API (Ogmios/Kupo, node storage/resources/image, public mode + Mithril), with not-yet-supported fields flagged. The template is go:embed'd and drift-guarded by a test that loads it through devconfig.Load.

Testing

  • moon run root:test and moon run root:check green (build, lint, format, no generated drift, helm, chainsaw).
  • Live functional validation on k3d (published operator v0.1.1): yacd init > yacd.yamlyacd up reached Ready with a funded wallet; yacd list (no -n) showed it cross-namespace; standalone yacd topup … --await (no run, no --faucet-url/--kupo-url) confirmed on-chain. Clean teardown.

Follow-up (not in this PR)

The mkdocs docs for list -A and the topup-under-run examples live on the unmerged docs/mkdocs-site branch (PR #91); they'll be corrected in the docs session before #91 merges. Master-tracked docs (README, docs/host-access.md) are updated here.

🤖 Generated with Claude Code

jmgilman and others added 3 commits June 3, 2026 08:00
yacd's identity model puts one environment per namespace (up NAME -> ns
NAME, devnet -> ns devnet), so a namespace-scoped `list` default was
routinely empty/misleading -- notably `yacd devnet` then `yacd list`
returned nothing. Default `list` to all namespaces (empty namespace is
already the adapter's all-namespaces convention) and keep -n to scope to
one. Removes the -A/--all-namespaces flag and the kubeconfig
default-namespace fallback, which list no longer consults.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
topup could not reach the faucet on its own: the URL it targets comes from
CardanoNetwork status, which is the in-cluster Service URL unreachable from
the host. Users had to wrap it in `yacd run` (and the documented form even
passed a redundant --faucet-url "$YACD_FAUCET_URL"). Now, with no faucet URL
override, topup opens a short-lived port-forward to the faucet itself
(reusing the connect/run forward machinery via a new forwardEndpoints helper),
POSTs, and tears it down. The same session forwards Kupo, so `topup --await`
no longer needs --kupo-url standalone. An explicit --faucet-url or ambient
YACD_FAUCET_URL (inside `yacd run`) still skips self-forwarding, and the trust
gate is unchanged: loopback is exempt, remote requires the trust flags. The
secret is still read only after the trust gate.

LOVELACE becomes a required positional argument (the flag was always
required); --address stays a required flag. Breaking, safe pre-1.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New users had no starting point for a config beyond copying an examples/
file and reading Go structs. `yacd init` prints a fully-commented developer
Environment template to stdout (`yacd init > yacd.yaml`). The active portion
is a batteries-included local devnet (faucet + funded wallet) that renders
cleanly through `up`; commented blocks document the rest of the API (Ogmios/
Kupo, node storage/resources/image, public mode + Mithril bootstrap), with
not-yet-supported fields flagged. The template is an embedded file, and a
test loads it through devconfig.Load to guard the active config against
schema drift.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jmgilman jmgilman merged commit b611645 into master Jun 3, 2026
12 checks passed
@jmgilman jmgilman deleted the feat/cli-list-all-namespaces branch June 3, 2026 18:39
jmgilman added a commit that referenced this pull request Jun 3, 2026
…-namespaces list)

Align the docs branch with PR #93 (merged): `yacd list` now defaults to all
namespaces (`-A` removed); `yacd topup NAME LOVELACE` takes a positional lovelace
and self-forwards the faucet/Kupo, so the `yacd run` wrapper and `--faucet-url`
are no longer needed; and the new `yacd init` prints a commented, ready-to-run
environment template.

Make `yacd init > yacd.yaml` the default starting point in the "Defining
networks" guide (scaffold, edit, `yacd up`), add an `init` reference section and
Commands-table entry, and revert the now-stale `list -A` / topup-under-`run`
examples added earlier. Verified: mkdocs build --strict clean; `yacd init` ->
`yacd up --dry-run` renders a valid CardanoNetwork; init/topup/list `--help`
match the docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant