CLI
Installation
Get started with the Monolayer CLI package by adding it to your project.
What you need
Before you install the CLI package, ensure your environment meets the following requirements:
- Node.js 18 or later: Required to run the CLI.
- Network access: You need a connection to the Monolayer control plane.
- Authentication tokens: Valid tokens are required to authorize your commands.
Install the CLI package
You can install the CLI package using your preferred package manager.
Using npm:
npm install @monolayer/cliUsing pnpm:
pnpm add @monolayer/cliVerify your installation
To confirm that the CLI is installed correctly, check the help menu.
npx mnlyr --helpIf you are using a pnpm workspace, run:
pnpm exec mnlyr --helpConfigure your environment
The CLI uses environment variables to communicate securely with your control plane. Set these in your terminal session or add them to your shell profile.
export MONOLAYER_BASE_URL="https://control-plane-domain"
export MONOLAYER_AUTH_TOKEN="token_xxx"
export MONOLAYER_DEPLOYMENT_TOKEN="deploy_token_xxx"Test your connection
Run these validation commands to ensure everything is configured properly.
Test the projects command:
npx mnlyr projects:list --limit 1Test the deploy command:
npx mnlyr deployments:deploy --project-id proj-1 --branch-name main --poll-interval-ms 0