Authentication and Configuration
To interact with your Monolayer control plane, you need to provide a base URL and the appropriate authentication tokens. You can supply these using command-line flags or environment variables.
Base URL
Every command requires a base URL to connect to the control plane.
The CLI resolves the base URL in the following order:
- The
--base-urlflag. - The
MONOLAYER_BASE_URLenvironment variable.
If neither is provided, the command fails and displays:
Missing base URL. Pass --base-url explicitly or set MONOLAYER_BASE_URL.
Authentication tokens
Different commands require specific tokens to keep your environment secure.
| Command | Required flag | Environment variable |
|---|---|---|
projects:list | --auth-token | MONOLAYER_AUTH_TOKEN |
deployments:deploy | --auth-token | MONOLAYER_DEPLOYMENT_TOKEN |
Listing projects
When running projects:list, the CLI looks for your authentication token in this order:
- The
--auth-tokenflag. - The
MONOLAYER_AUTH_TOKENenvironment variable.
If the token is missing, the command fails and displays:
Missing auth token. Pass --auth-token explicitly or set MONOLAYER_AUTH_TOKEN.
Deploying projects
When running deployments:deploy, the CLI looks for your deployment token in this order:
- The
--auth-tokenflag. - The
MONOLAYER_DEPLOYMENT_TOKENenvironment variable.
If the token is missing, the command fails.
Important: Your deployment token must begin with deploy_token_. If you provide an invalid token, the command fails and displays:
auth-token must start with "deploy_token_"