Skip to main content

CLI Quick Start

Deploy your first application using the Clue2App CLI in under 5 minutes.

Prerequisites

  • Python 3.9 or higher
  • Git installed
  • A GitHub account (for accessing repositories)

Installation

Install the Clue2App CLI using pip:

pip install clue2app-cli

Verify the installation:

c2a --version

Quick Deploy Flow

Step 1: Login

Authenticate with your Clue2App account:

c2a login

This opens a browser window for authentication. After logging in, you'll see:

✅ Login successful!
Welcome, your-email@example.com

Step 2: Create & Select a Project

Projects organize your applications and determine where they're deployed.

# Create a new project
c2a project create MyProject

# Set it as active
c2a project use MyProject
Namespace Rules
  • Namespaces must be lowercase
  • Use only letters, numbers, and hyphens
  • The namespace appears in your app URLs: https://appname.myproject.apps.clue2.app

Step 3: Deploy Your Application

Public Repository

c2a app create my-api --git https://github.com/clue2solve/clue2app-fastapi-demo.git

Private Repository (with token)

c2a app create my-api \
--git https://github.com/myorg/private-repo.git \
--private-repo \
--git-token ghp_xxxxxxxxxxxx

Private Repository (with saved secret)

# First, create a git secret (one-time)
c2a secrets create git --name my-git-creds --username git --token ghp_xxxx

# Then use it for deployments
c2a app create my-api \
--git https://github.com/myorg/private-repo.git \
--private-repo \
--git-secret my-git-creds

Step 4: Monitor Your Deployment

Check build status:

c2a build list

View build logs:

c2a build logs my-api

Step 5: Access Your Application

Once the status shows Ready, your app is live:

# Show app details including URL
c2a app show my-api

# Or list all apps with status
c2a app list

Your app URL: https://my-api.myproject.apps.clue2.app


Application Lifecycle


Essential Commands

App Management

CommandDescription
c2a app create <name> --git <url>Deploy new app from Git
c2a app listList apps with status and URLs
c2a app show <name>Show app details
c2a app logs <name>View runtime logs
c2a app rebuild <name>Trigger a rebuild
c2a app restart <name>Restart without rebuilding
c2a app delete <name>Delete an app

Build & Logs

CommandDescription
c2a build listList all builds
c2a build logs <name>View build logs
c2a build history <name>Build history for an app

Environment Variables

CommandDescription
c2a app env set <name> K=VSet env variables
c2a app env list <name>List env variables
c2a app env unset <name> KRemove env variables

Project Management

CommandDescription
c2a project listList all projects
c2a project use <name>Switch active project
c2a project create <name>Create new project
c2a project show <name>Show project details

Secrets Management

CommandDescription
c2a secrets listList all secrets
c2a secrets create gitCreate Git credentials
c2a secrets delete <name>Delete a secret

Interactive TUI Mode

Launch the interactive terminal dashboard (k9s-style):

c2a tui
┌─ Clue2App TUI ──────────────────────────── Project: MyProject ─┐
│ │
│ APPS │
│ ───────────────────────────────────────────────────────────── │
│ NAME STATUS PODS LAST BUILD │
│ ───────────────────────────────────────────────────────────── │
│▶ my-api Running 2 ✓ Success │
│ frontend Running 1 ✓ Success │
│ worker Scaled 0 ✓ Success │
│ │
├─────────────────────────────────────────────────────────────────┤
│ [Enter] Details [l] Logs [r] Rebuild [d] Delete [q] Quit │
└─────────────────────────────────────────────────────────────────┘

Keyboard shortcuts:

  • j/k or arrows - Navigate
  • Enter - View details
  • l - View logs
  • r - Trigger rebuild
  • q - Quit

Common Workflows

Workflow 1: Deploy with Database

# Deploy app
c2a app create my-api --git https://github.com/user/repo.git

# Set environment variables
c2a app env set my-api DATABASE_URL=postgresql://user:pass@host/db

# App automatically restarts with new config

Workflow 2: Update & Rebuild

# Push code changes to Git, then:
c2a app rebuild my-api

# Monitor the build
c2a build list

# View logs once running
c2a app logs my-api

Workflow 3: Debug Failed Deployment

# Check build status
c2a build list

# View build logs
c2a build logs my-api

# View application runtime logs
c2a app logs my-api

# Trigger rebuild after fixing
c2a app rebuild my-api

Using Private Repositories

Option 1: Git Token (Quick)

c2a app create my-api \
--git https://github.com/org/private.git \
--private-repo \
--git-token ghp_xxxxxxxxxxxx
# Create secret once
c2a secrets create git --name my-creds --username git --token ghp_xxxx

# Use for all deployments
c2a app create my-api \
--git https://github.com/org/private.git \
--private-repo \
--git-secret my-creds

Creating a GitHub Token

  1. Go to GitHub Settings → Developer settings → Personal access tokens
  2. Click "Generate new token"
  3. Set permissions:
    • Contents: Read-only
    • Metadata: Read-only
  4. Copy the token immediately
Keep Your Token Secure
  • Never commit tokens to your repository
  • Use --git-secret for repeated deployments
  • Rotate tokens periodically

Environment Variables

Set environment variables for your applications:

# Set single variable
c2a app env set my-api API_KEY=secret123

# Set multiple variables
c2a app env set my-api \
DATABASE_URL=postgresql://... \
REDIS_URL=redis://... \
LOG_LEVEL=info

# List current variables
c2a app env list my-api

# Remove a variable
c2a app env unset my-api DEBUG

Custom Domains

# Register a domain for your project
c2a domain register example.com

# Check DNS delegation status
c2a domain status example.com

# Assign a subdomain to your app
c2a domain assign my-api api.example.com

Troubleshooting

Build Failed

# Check build logs
c2a build logs my-api

# Common issues:
# - Missing dependencies in requirements.txt / package.json
# - Invalid Dockerfile or Procfile
# - Private dependency without credentials

App Not Accessible

# Check app status and URL
c2a app show my-api

# Check app logs for errors
c2a app logs my-api

Authentication Issues

# Re-authenticate
c2a login

# Check current session
c2a status

Logs Not Working

# Ensure you're in the right project
c2a project use MyProject

# Then view logs
c2a app logs my-api

Full Command Reference

c2a --help                    # Show all commands
c2a <command> --help # Show command help
c2a app create --help # Show deploy options

All Commands

CategoryCommandDescription
Authc2a loginAuthenticate
c2a logoutLog out
c2a statusConnection status
Appc2a app listList applications
c2a app createDeploy application
c2a app showApp details + URL
c2a app logsRuntime logs
c2a app deleteDelete application
c2a app rebuildTrigger rebuild
c2a app restartRestart service
c2a app env setSet env variables
c2a app env listList env variables
c2a app env unsetRemove env variables
Buildc2a build listList builds
c2a build logsView build logs
c2a build historyBuild history
Projectc2a project listList projects
c2a project useSwitch project
c2a project createCreate project
Domainc2a domain registerRegister domain
c2a domain assignAssign to app
c2a domain statusCheck DNS
Secretsc2a secrets listList secrets
c2a secrets createCreate secret
TUIc2a tuiInteractive dashboard

Need help? Visit our GitHub Issues or contact support.