feat(cli): all-namespaces list, self-forwarding topup, and an init command#93
Merged
Conversation
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A batch of CLI UX one-offs (no operator/API changes).
Changes
listdefaults to all namespaces;-Aremoved. yacd's identity model puts one environment per namespace (up foo→ nsfoo,devnet→ nsdevnet), so the old current-namespace default was routinely empty/misleading (yacd devnetthenyacd listshowed nothing).listnow sweeps all namespaces by default;-nstill scopes to one. Empty namespace was already the adapter's all-namespaces convention.topupself-forwards the faucet;LOVELACEis positional. topup targeted the in-cluster faucet Service URL (unreachable from the host), forcing ayacd 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 newforwardEndpointshelper), POSTs, and tears it down; the same session forwards Kupo sotopup --awaitworks standalone. Explicit--faucet-urlor ambientYACD_FAUCET_URL(insideyacd run) still skip self-forwarding, and the security trust gate is unchanged (loopback exempt; secret read only after the gate).LOVELACEbecomes a required positional (yacd topup NAME LOVELACE);--addressstays a required flag. Breaking, safe pre-1.0.New
yacd init. Prints a fully-commented developerEnvironmenttemplate 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 isgo:embed'd and drift-guarded by a test that loads it throughdevconfig.Load.Testing
moon run root:testandmoon run root:checkgreen (build, lint, format, no generated drift, helm, chainsaw).yacd init > yacd.yaml→yacd upreached Ready with a funded wallet;yacd list(no-n) showed it cross-namespace; standaloneyacd topup … --await(norun, no--faucet-url/--kupo-url) confirmed on-chain. Clean teardown.Follow-up (not in this PR)
The mkdocs docs for
list -Aand thetopup-under-runexamples live on the unmergeddocs/mkdocs-sitebranch (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