CLI & Tools
Manage your entire CloudNexus infrastructure from the command line. Automate deployments, scale resources, and monitor performance with our official CLI, SDKs, and developer integrations.
Installation
CloudNexus CLI is available for macOS, Linux, and Windows. Choose your platform below to get started in seconds.
# Install via Homebrew brew install cloudnexus/taps/cnx # Verify installation cnx --version
# Ubuntu/Debian curl -fsSL https://cli.cloudnexus.dev/install.sh | sudo bash # Arch Linux (AUR) yay -S cloudnexus-cli # Verify installation cnx --version
# Install via Winget winget install CloudNexus.CNX # Or via Chocolatey choco install cloudnexus-cli # Verify installation cnx --version
# Run via container docker run --rm cloudnexus/cli:latest --help # Mount config directory docker run -v ~/.cnx:/root/.cnx cloudnexus/cli:latest deploy
Authentication
Configure the CLI with your account credentials using OAuth or API keys. The CLI securely stores tokens in your system keychain.
# Interactive OAuth login (recommended) cnx auth login # Using API key (for CI/CD) cnx auth login --api-key $CLOUDNEXUS_API_KEY --account my-org # Verify credentials cnx auth whoami
Core Commands
The CLI supports a comprehensive set of commands for infrastructure management. Use cnx help for full documentation.
| Command | Description | Example |
|---|---|---|
cnx deploy |
Deploy applications or containers | cnx deploy --region us-east --env prod |
cnx scale |
Scale instances up or down | cnx scale web-app --count 5 |
cnx monitor |
Real-time metrics & logs | cnx monitor --follow --cpu --memory |
cnx database |
Manage managed databases | cnx database create --type postgres |
cnx backup |
Create & restore snapshots | cnx backup list --service db-primary |
Deployment Example
Deploy a Node.js application with automatic SSL, CDN, and auto-scaling:
cnx deploy my-app \ --image registry.cloudnexus.dev/my-app:latest \ --region eu-west \ --instances 3 \ --auto-scale \ --ssl auto \ --env NODE_ENV=production \ --health-check /healthz # Output: ✓ Building container image... ✓ Provisioning instances in eu-west... ✓ Configuring load balancer & SSL... ✓ Deployment successful: https://my-app.cnx.app
Developer Integrations
Extend your workflow with official integrations for popular developer tools.
Terraform Provider
terraform { required_providers { cloudnexus = { source = "cloudnexus/cloudnexus" version = "~> 2.1" } } } resource "cloudnexus_instance" "web" { region = "us-east-1" image = "ubuntu-22.04" plan = "professional" auto_upgrade = true }
VS Code Extension
Manage resources directly from Visual Studio Code with the official CloudNexus extension. Features include:
- Live instance metrics & logs in the sidebar
- One-click SSH & terminal access
- Deployment pipeline visualization
- Smart autocomplete for CLI commands
Troubleshooting
cnx doctor to automatically diagnose configuration issues, network connectivity, and authentication problems.| Issue | Resolution |
|---|---|
| Connection timeout | Check firewall rules & run cnx network trace |
| Invalid API key | Regenerate key in dashboard or run cnx auth refresh |
| Deployment stuck | Use cnx deploy logs --follow and check health endpoints |
| Version mismatch | Run cnx update --latest to upgrade CLI |