byteanvil2.4.1Sign in

Configuration

anvil reads two files and three environment variables, and command-line flags beat all of them. There is a user file for your machine and a repo file for things that travel with the code. Secrets live in neither - the client refuses a token read from a repo file.

The two files

~/.config/anvil/anvil.toml is yours: the registry you usually talk to, your default channel, your token (here, not in a repo). .anvil.toml sits in a repo and carries project defaults that every checkout should share - never a token.

# ~/.config/anvil/anvil.toml
registry = "https://registry.internal:8711"
channel  = "dev"
token    = "…"          # only valid in the user file

# .anvil.toml  (committed)
registry = "https://registry.internal:8711"
channel  = "staging"
# token here is ignored, with a warning on stderr

Precedence

Highest wins. This order is the same for every key:

  1. command-line flag
  2. environment variable
  3. repo .anvil.toml
  4. user anvil.toml
  5. built-in default

So a --channel release on the command line overrides ANVIL_CHANNEL, which overrides the repo file, which overrides your user file. When a value surprises you, run the command with --json: the resolved registry and channel are echoed on the first line.

Keys

KeyDefaultNotes
registry- (required)No default on purpose; a store you forgot to point at is worse than an error.
channeldevWhere a push lands if --channel is omitted.
tokenunsetUser file or ANVIL_TOKEN only.
store./storeServer-side; where anvil serve keeps bytes.
listen:8711Server-side listen address.