Repository navigation
feat(config): per-environment settings with built-in defaults, hidden env switch, rail0 balance - #197
Merged
Merged
Conversation
… env switch, rail0 balance The config file now records the active environment (production when absent) and a block of settings per environment; `config set/get/unset` work on the active one, and base-url, chain and token have built-in defaults in every environment (production: api.rail0.xyz, arc, USDC), so no payment command needs -c/-t. `env <name>` only records the choice, keeps every session, and is hidden from help, completion, docs and README; `env --help` still answers. `keys balance` becomes the top-level `rail0 balance`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
# Conflicts: # cmd/balance.go
# Conflicts: # README.md # cmd/balance.go # cmd/env.go # cmd/env_test.go # docs/cli/rail0_env.md # docs/man/rail0-env.1 # docs/man/rail0.1
pviti
added a commit
that referenced
this pull request
Nov 6, 2026
The "Next release" milestone: every pull request merged into `milestone/next` ships with this release. Version and notes are written by `bin/release-prepare`, run on `milestone/next`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- release:start --> ## rail0 CLI v1.9.0 <!-- release-notes:start --> ### Added - **config:** per-environment settings with built-in defaults, hidden env switch, rail0 balance (#197) - production defaults to Arc and USDC, Arc balances in both scales, payouts commands hidden (#195) ### Fixed - **keys:** balance names the gas coin of a chain the gateway does not list (#194) **Full diff:** v1.8.2...v1.9.0 <!-- release-notes:end --> --- **Version:** **minor**, computed from the pull requests merged since v1.8.2 (a breaking change → major, `feat` → minor, anything else → patch). Decided by: - feat(config): per-environment settings with built-in defaults, hidden env switch, rail0 balance (#197) - feat: production defaults to Arc and USDC, Arc balances in both scales, payouts commands hidden (#195) Merging this pull request also releases **v1.9.0**: its changes and the version bump ship together, under the one approval. On the push to `main`, `.github/workflows/release.yml` re-runs CI on the merge commit, creates the tag, and GoReleaser builds the binaries and publishes the GitHub release, and posts the release to Slack. The release notes are the text between the `release-notes` markers above, read from this pull request when it merges: edit them here, before merging. _Opened by `bin/release-prepare`._ <!-- release:end -->
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.
What changes
Config file: environment + per-environment settings.
config.yamlnow holdsenvironment:(the active one; absent =production) andenvironments.<name>.<key>blocks.config set / get / unsetwork on the active environment forbase-url,admin-url,chain,token(and the legacychain-id);outputandhttp-timeoutstay global insettings. Resolution: flag > env var > config file > the environment's built-in default.Built-in defaults in every environment.
base-url,chain(arc) andtoken(USDC) are defaulted on development, staging and production, so a payment command needs neither-cnor-tout of the box.rail0 configlists them with origin<env> default;config unsetreturns to the default.envis hidden. It only records the chosen environment (remembered for every later command), no longer clears settings or revokes the session of the gateway it leaves (sessions are per gateway and stay cached), and is left out ofrail0 --help, completion, the generated reference and the README.rail0 env --helpand the command keep working.rail0 balancereplaceskeys balance(same flags and behaviour), listed under "Network catalog".Breaking
settings.base-url / chain / chain-id / token / admin-urlin an existingconfig.yamlare no longer read (no migration, by decision: the CLI has no external users yet). Move them underenvironments.<name>or justconfig setthem again.rail0 keys balanceis gone; userail0 balance.Verification
go build,go vet,go test ./...green;docs/regenerated (env pages removed, balance page added); smoke-tested against a converted local config (env current -d,config,env -d,balance --help).🤖 Generated with Claude Code