NEXUS AI CLI Deployment Guide
NEXUS AI Command Line Interface
By NEXUS AI • • Tutorial
Most deployment guides hand you a twelve-step Docker workflow before you've written a line of application code. NEXUS AI CLI deployments skip that entirely — point the CLI at a GitHub repo, and NEXUS AI detects the framework, builds the container, and ships it. This guide covers the full lifecycle: from first install to automated production pipelines.
By the end you'll know how to create, manage, scale, and roll back deployments using only the NEXUS AI CLI — no cloud console required.
What makes NEXUS AI CLI deployments different
Every major cloud has a CLI. What sets NEXUS AI apart is source-based deployment: you give the CLI a repo URL, and NEXUS AI handles everything downstream — framework detection, container builds, TLS provisioning, and autoscaling configuration.
The practical effect:
- No Dockerfile required. NEXUS AI detects Python, Node.js, Go, and other runtimes from your project root and builds a production image automatically.
- One command covers creation, secrets, and domains. You don't context-switch between five tools to get a service live.
- Multi-cloud with a single interface. The same CLI commands deploy to GCP Cloud Run, AWS ECS Fargate, or Azure Container Apps. Changing providers is a flag, not a migration.
- Full lifecycle support. Stop, start, scale, roll back, tail logs — all from the terminal you're already in.
Install the NEXUS AI CLI
Linux
curl -fsSL https://nexusai.run/install.sh | bash
The script detects your distro (Ubuntu/Debian, RHEL/CentOS, Alpine, Arch, openSUSE), installs Node.js 20 LTS if needed, and adds nexus to your PATH.
macOS
curl -fsSL https://nexusai.run/install-mac.sh | bash
Installs via Homebrew on Intel and Apple Silicon. Xcode Command Line Tools are required (the script prompts if missing).
Manual (any platform with Node.js 18+)
npm install -g nexusapp-cli
Verify the install:
nexus --version
Authenticate
nexus auth login
Opens a browser window to authenticate with your NEXUS AI account. After login, your token is stored in ~/.nexusai/config.json and used automatically by all subsequent commands.
Your first NEXUS AI CLI deployment
Step 1 — Source-based deployment (recommended)
Source-based deployment is the fastest path from code to production. No Docker, no image registry, no build pipeline to configure.
nexus deploy source \
--repo https://github.com/your-org/my-api \
--name my-api \
--port 8000 \
--provider gcp_cloud_run
What happens next:
- NEXUS AI clones your repository
- Detects the runtime (Python
requirements.txt, Node.jspackage.json, Gogo.mod, etc.) - Builds a production container image
- Deploys to the specified provider with TLS and autoscaling enabled
Available providers: gcp_cloud_run, aws_ecs_fargate, azure_container_apps, docker (local).
Private repositories: pass a secret name containing your repo token:
nexus deploy source \
--repo https://github.com/your-org/private-api \
--name private-api \
--port 3000 \
--repo-secret GITHUB_TOKEN
Override detection: if auto-detection picks the wrong framework, you can specify explicitly:
nexus deploy source \
--repo https://github.com/your-org/my-api \
--name my-api \
--port 8000 \
--framework python \
--build-command "pip install -r requirements.txt" \
--start-command "uvicorn main:app --host 0.0.0.0 --port 8000"
Step 2 — Check deployment status
nexus deploy status my-api
Returns the current state (PENDING, BUILDING, RUNNING, FAILED), provider region, and the public URL once the deployment is live.
Step 3 — Tail logs
nexus deploy logs my-api --follow
Streams live logs from the running container. Drop --follow to get the last 100 lines and exit:
nexus deploy logs my-api --tail 50
Image-based deployment
If you already have a container image in a registry (Docker Hub, GHCR, ECR, GCR), deploy it directly:
nexus deploy create \
--image your-org/my-api:latest \
--name my-api \
--port 8000 \
--provider aws_ecs_fargate
Override the container's default startup command:
nexus deploy create \
--image your-org/my-api:latest \
--name my-api \
--port 8000 \
--start-command "node server.js --prod"
Image-based deployments and source-based deployments use the same management commands after creation — the path to production is the only difference.
Managing NEXUS AI CLI deployments
Secrets
Never put API keys in environment variables passed on the command line. Use NEXUS AI secrets instead — values are encrypted at rest and injected at runtime:
# Create a secret
nexus secret create OPENAI_API_KEY \
--deployment my-api \
--environment Production
# List secrets (values are hidden)
nexus secret list
# Update a secret value
nexus secret update <secret-id> --value sk-new-value
# Delete a secret
nexus secret delete <secret-id>
Custom domains
# Add a domain
nexus domain add api.yourcompany.com --deployment my-api
# List domains on a deployment
nexus domain list --deployment my-api
# Trigger DNS verification
nexus domain verify api.yourcompany.com --deployment my-api
NEXUS AI provisions TLS automatically after DNS verification. Point your CNAME at the provided record and the certificate is issued within minutes.
Scaling
# Scale to 3 replicas
nexus deploy scale my-api --replicas 3
# Scale back down
nexus deploy scale my-api --replicas 1
Replicas can be set between 1 and 10. GCP Cloud Run and Azure Container Apps also autoscale based on request load — the --replicas flag sets the minimum floor.
Health checks
nexus deploy health my-api
Returns the health status and recent health check logs. Useful for diagnosing why a deployment is stuck in PENDING or cycling between RUNNING and UNHEALTHY.
Stop and start
# Stop a deployment (preserves config, frees compute)
nexus deploy stop my-api
# Restart it later
nexus deploy start my-api
Stopping a deployment is non-destructive — all configuration, secrets, and domain mappings are preserved. Use it for dev/staging environments you don't need running 24/7.
Rollback
When a bad deploy makes it to production:
# Roll back to the previous version
nexus deploy rollback my-api
# Roll back to a specific revision
nexus deploy rollback my-api --target <previous-deployment-id>
Rollback redeploys the previous working configuration — same image or source, same environment, same secrets. No manual config reconstruction.
Automate NEXUS AI CLI deployments with GitHub Actions
Source-based CI/CD
The simplest pipeline: push to main, NEXUS AI rebuilds from source and redeploys.
# .github/workflows/deploy.yml
name: Deploy to NEXUS AI
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install NEXUS AI CLI
run: curl -fsSL https://nexusai.run/install.sh | bash
- name: Redeploy from source
run: nexus deploy redeploy my-api
env:
NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
nexus deploy redeploy pulls the latest commit from the repo URL that was used when the deployment was created, rebuilds the container, and does a rolling update.
Image-based CI/CD
For teams already building images in CI:
name: Build and Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and push image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Install NEXUS AI CLI
run: curl -fsSL https://nexusai.run/install.sh | bash
- name: Deploy new image
run: |
nexus deploy redeploy my-api \
--image ghcr.io/${{ github.repository }}:${{ github.sha }}
env:
NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
Environment-specific pipelines
Deploy to staging on every push, production on tagged releases:
on:
push:
branches: [main]
tags: ['v*']
jobs:
deploy-staging:
if: github.ref_type == 'branch'
runs-on: ubuntu-latest
steps:
- run: nexus deploy redeploy my-api-staging
env:
NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
deploy-production:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- run: nexus deploy redeploy my-api
env:
NEXUSAI_TOKEN: ${{ secrets.NEXUSAI_TOKEN }}
NEXUS AI CLI command reference
| Command | What it does |
|---|---|
nexus auth login |
Authenticate with your NEXUS AI account |
nexus deploy source --repo <url> |
Deploy directly from a Git repository |
nexus deploy create --image <img> |
Deploy from a container image |
nexus deploy redeploy <name> |
Rebuild and redeploy an existing deployment |
nexus deploy rollback <name> |
Roll back to the previous working revision |
nexus deploy status <name> |
Show current state and public URL |
nexus deploy logs <name> --follow |
Stream live logs |
nexus deploy scale <name> --replicas N |
Set replica count (1–10) |
nexus deploy health <name> |
Health check status and recent logs |
nexus deploy stop <name> |
Stop without deleting |
nexus deploy start <name> |
Restart a stopped deployment |
nexus secret create <KEY> |
Create an encrypted secret |
nexus secret list |
List secrets (values hidden) |
nexus domain add <domain> |
Attach a custom domain |
nexus domain verify <domain> |
Trigger DNS verification |
Frequently asked questions
Do I need Docker installed to use the NEXUS AI CLI?
No. For source-based deployments (nexus deploy source), NEXUS AI builds the container image on its own infrastructure. Docker is only needed if you're building images locally before deploying with nexus deploy create.
Which cloud providers does the NEXUS AI CLI support?
The CLI supports GCP Cloud Run (gcp_cloud_run), AWS ECS Fargate (aws_ecs_fargate), Azure Container Apps (azure_container_apps), and local Docker (docker). The provider flag is set at deployment creation and can be changed on redeploy.
How are secrets stored?
Secrets are encrypted at rest using AES-256-GCM and injected as environment variables at container start. Secret values are never returned by the API after creation — only the key name and metadata are visible via nexus secret list.
Can I use the NEXUS AI CLI in CI/CD without interactive login?
Yes. Set the NEXUSAI_TOKEN environment variable to your API token. The CLI checks this variable first and skips the browser-based login flow entirely. Generate a token in your NEXUS AI account settings.
What you can do with NEXUS AI CLI deployments
The NEXUS AI CLI covers the full lifecycle that normally spans four or five separate tools: a container registry, a cloud console, a secrets manager, a DNS panel, and a logging service. From a single terminal:
- Ship source code to production without writing a Dockerfile
- Manage encrypted secrets without leaving the CLI
- Roll back a bad deploy in one command
- Automate the entire pipeline with a 15-line GitHub Actions workflow
The NEXUS AI CLI installation guide has platform-specific setup instructions for Linux and macOS. Run nexus auth login and your first deployment is one command away.