Skip to main content
The CLI needs one piece of information to talk to MuleRouter: The base URL defaults to https://api.mulerouter.ai; you only need to set it when you are pointing at a self-hosted gateway or proxy.

Environment variables

The canonical way to configure the CLI. Drop these into your shell rc file (~/.zshrc, ~/.bashrc, …) or your CI secret store.

.env file

For project-scoped configuration, create a .env file in the directory you run the CLI from. The CLI loads MULEROUTER_* variables automatically and never overwrites variables already set in the process environment.
.env
The file is read once per process. Quotes around values are stripped, lines starting with # are treated as comments, and any variable that does not begin with MULEROUTER_ is ignored.

Command-line overrides

Every command accepts ad-hoc overrides that take precedence over both the environment and the .env file. Useful when juggling multiple accounts:

Resolution order

The configuration loader resolves values in this order, stopping at the first hit:
  1. CLI flags (--api-key, --base-url)
  2. Process environment variables (MULEROUTER_*)
  3. .env file in the current working directory

Inspect the active configuration

Run mulerouter config at any time to see what the CLI thinks it is configured with. The API key is masked.
If no key is found you will see a “No configuration found.” notice followed by the same setup help as the table above.

Troubleshooting

API key not found. Set MULEROUTER_API_KEY in the environment, write it to .env, or pass --api-key. A .env value isn’t taking effect. Existing environment variables are never overwritten — export wins over .env. Check printenv | grep MULEROUTER.