CLI
Installation
Install the Monolayer command-line interface (CLI) package and verify that your terminal can run the mnlyr command.
Concept and Goal
This section explains how to install the package and validate your connection settings.
Prerequisites
Before you start, ensure your environment meets these requirements:
- Node.js 18 or later: Required to run the CLI.
- Network access: You need a connection to the Monolayer control plane.
- Authentication tokens: You need valid values for
MONOLAYER_AUTH_TOKENandMONOLAYER_DEPLOYMENT_TOKEN.
IMPORTANT: MONOLAYER_DEPLOYMENT_TOKEN must start with deploy_token_.
Numbered Steps
- Install the CLI package with your preferred package manager.
npm install @monolayer/clipnpm add @monolayer/cli- Verify that the command is available by opening the help output.
npx mnlyr --helpIf you use a pnpm workspace, run this command instead:
pnpm exec mnlyr --help- Set your environment variables for the current shell session.
The CLI uses these values to communicate with your control plane.
export MONOLAYER_BASE_URL="https://control-plane-domain"
export MONOLAYER_AUTH_TOKEN="token_xxx"
export MONOLAYER_DEPLOYMENT_TOKEN="deploy_token_xxx"- Run a read command to validate project authentication.
npx mnlyr projects:list --limit 1- Run a deployment command to validate deployment authentication.
npx mnlyr deployments:deploy --project-id proj-1 --branch-name main --poll-interval-ms 0Expected Result
You can open the help output and run both commands without configuration errors.