Getting Started with the CloudNexus CLI
The CloudNexus Command Line Interface (CLI) is the fastest way to provision, deploy, and manage your cloud infrastructure. Designed for developers and DevOps teams, it provides a unified interface for everything from container orchestration to global CDN distribution.
Before you begin, ensure you have a CloudNexus account and an active API key. You'll also need macOS 10.15+, Ubuntu 18.04+, or Windows 10/11.
1. Installation
macOS & Linux
curl -fsSL https://cli.cloudnexus.io/install.sh | bash
Or use your preferred package manager:
# Homebrew (macOS)
brew install cloudnexus/cli/cn
# Snap (Ubuntu/Debian)
sudo snap install cloudnexus-cli --classic
# NPM (Node.js)
npm install -g @cloudnexus/cli
Windows
# PowerShell Admin
iwr -useb https://cli.cloudnexus.io/install.ps1 | iex
# Scoop
scoop install cloudnexus-cli
Verify Installation
cn --version
# Output: cloudnexus-cli v3.2.1 (stable)
If you get a `command not found` error, add the CLI binary directory to your system PATH or restart your terminal.
2. Authentication
Connect the CLI to your CloudNexus account using one of the following methods:
# API Key Authentication (Recommended for CI/CD)
cn auth login --key cn_live_sk_8x92...a41
# Browser SSO (For local development)
cn auth login --sso
# 🌐 A browser window will open to complete OAuth 2.0 flow
Successful authentication outputs:
✅ Authentication successful.
🌐 Default region: us-east-1
📦 Config saved: ~/.cloudnexus/config.yml
3. Essential Commands
cn init
Initialize a new project with infrastructure templates
cn deploy
Push application code to a live cloud instance
cn logs
Stream real-time stdout/stderr from running containers
cn scale
Adjust replica count & compute resources dynamically
4. Your First Deployment
Let's deploy a minimal Node.js application to the edge network:
mkdir cn-quickstart && cd cn-quickstart
cn init --template node-express
# Edit src/index.js if needed, then deploy
cn deploy --region eu-west-1 --env production
# 🚀 Building container image...
# 📦 Uploading assets to edge cache...
# ✅ Live at: https://cn-quickstart.prod.cloudnexus.app
5. Managing Profiles & Environments
Switch between projects and configurations without re-authenticating:
# Create a new environment profile
cn profiles create --name staging --region ap-south-1 --env staging
# Switch active profile
cn profiles use staging
# Deploy to the active environment
cn deploy
All CLI state, API keys, and profiles are stored securely in ~/.cloudnexus/config.yml. Use cn config show to view current settings.
6. Next Steps
Now that you're up and running, explore these resources to unlock the full potential of the CLI: