Skip to main content
Commands find your key and network on their own, so you rarely need to pass them. This page gives the order they look in; the first match wins.

Signing key

  1. --private-key <file>.
  2. COWBOY_PRIVATE_KEY_FILE, the path of a key file. Set it in your shell; a value only in .env is refused.
  3. COWBOY_PRIVATE_KEY, a hex key.
  4. For an actor command on a deployed project target, the key that deployment recorded.
  5. The key the selected environment names, or else default.
A missing key is an error. The CLI doesn’t try another key in its place, and cowboy wallet create makes one.

Keystore

Keys live in the keystore, ~/.cowboy/keys/<name>, one file per key. Commands that create or import a key write there, as default unless you pass --name. A key file in a project, such as .cowboy/key, isn’t read. A project that still has one is refused rather than signed for with another key. Move it into the keystore:
Then delete the old file.

Network

  1. --env <name>.
  2. COWBOY_ENV.
  3. The network cowboy env use saved for this project.
  4. Your global default, set by cowboy env use outside a project.
  5. local.
Your choices and any networks you added are kept in ~/.cowboy/config.json, not in the project. cowboy env current shows what applies where you are, and where it came from.

Endpoint

  1. --rpc-url <url>.
  2. COWBOY_RPC_URL.
  3. The selected network’s endpoint.
  4. http://localhost:4000.
cowboy deploy and actor commands on a project target use the network’s own endpoint, and refuse an --rpc-url that doesn’t match it.

Next