Synopsis
.cowboy/config.json and never contact a node. --rpc-url is the global flag; env add records it as the new environment’s endpoint. Four names have built-in defaults and need no prior add:
Any other name is a project-configured environment and needs
--rpc-url when added.
Subcommands
cowboy env add
Add environment metadata without creating a wallet.
Behavior:
- Discover the project’s
.cowboydirectory from the current directory. - Resolve the RPC URL:
--rpc-urlif given, else the built-in default for the name. A name with no built-in default and no--rpc-urlfails withrpc_url_required. - Write the environment and print
Added environment '<name>'.with its RPC URL, key, and whether it is active. Re-adding an identical environment printsEnvironment '<name>' is already configured; no changes made.
Example:
cowboy env use
Select the active environment.
Behavior:
- With a name, select that environment. Built-in names are configured on first use.
- With no name, prompt with a menu:
Local,Mesa,Canyon(each marked(active),(configured), or, for Canyon,(private network access required)), followed by any project-configured environments. Without an interactive terminal the prompt fails and the error suggestscowboy env use canyon. - Print
Using environment '<name>'.with its details, orEnvironment '<name>' is already active; no changes made.
Example:
cowboy env list
List configured environments.
Example:
*. With none configured, prints No environments configured. Under --json the result has active and environments.
cowboy env current
Show the environment, RPC URL, and signer the shared lookup resolves in this directory, and where each came from (reads no network). deploy, commands on a deployed target, and faucet request resolve some of these on their own.
Flags:
Example:
Edge Cases
env addcannot silently repoint an existing environment’s RPC URL or key; the CLI refuses withenvironment_conflict.- An unusable
.cowboy/config.jsonfailsenv add,env use, andenv listwithconfig_invalid. This includes an environment that names a key file withkey_file(replace it with"key": "<name>"and move the key into the keystore) and the old flat{"network", "rpc_url"}format (rewrite it asactive/environmentswith a key name). - RPC URLs are sanitized in JSON output (embedded credentials are not echoed).
- Names and URLs containing control characters are escaped when printed.