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 projects create --name "MyProject" --namespace "myproject"

# Set it as active
c2a projects select 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 deploy app my-api -g https://github.com/clue2solve/clue2app-fastapi-demo.git

Private Repository (with token)

c2a deploy app my-api \
-g 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 deploy app my-api \
-g https://github.com/myorg/private-repo.git \
--private-repo \
--git-secret my-git-creds

Step 4: Monitor Your Deployment

Check build status:

c2a builds list

View build logs:

c2a builds logs <build-name>

Step 5: Access Your Application

Once the status shows Ready, your app is live:

# List running services with URLs
c2a services list

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


Application Lifecycle


Essential Commands

Deployment & Build

CommandDescription
c2a deploy app <name> -g <url>Deploy new app from Git
c2a rebuild <name>Trigger a rebuild
c2a builds listList all builds
c2a builds logs <build>View build logs

Monitoring & Logs

CommandDescription
c2a logs show <app>View application logs
c2a logs show <app> -fFollow logs in real-time
c2a logs show <app> --buildView build logs
c2a services listList running services

Project Management

CommandDescription
c2a projects listList all projects
c2a projects select <name>Switch active project
c2a projects createCreate new project

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 deploy app my-api -g https://github.com/user/repo.git

# Set environment variables
c2a 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 rebuild my-api

# Monitor the build
c2a builds list

# View logs once running
c2a logs show my-api -f

Workflow 3: Debug Failed Deployment

# Check build status
c2a builds list

# View build logs
c2a builds logs <build-name>

# View application logs
c2a logs show my-api

# Trigger rebuild after fixing
c2a rebuild my-api

Using Private Repositories

Option 1: Git Token (Quick)

c2a deploy app my-api \
-g 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 deploy app my-api \
-g 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 env set my-api API_KEY=secret123

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

# List current variables
c2a env list my-api

# Remove a variable
c2a env unset my-api DEBUG

Troubleshooting

Build Failed

# Check build logs
c2a builds logs <build-name>

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

App Not Accessible

# Check service status
c2a services list

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

Authentication Issues

# Re-authenticate
c2a login

# Check current session
c2a config show

Logs Not Working

# Ensure you're in the right project
c2a projects select MyProject

# Then view logs
c2a logs show my-api

Full Command Reference

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

All Commands

CategoryCommandDescription
Authc2a loginAuthenticate
c2a logoutLog out
Projectsc2a projects listList projects
c2a projects selectSwitch project
c2a projects createCreate project
Deployc2a deploy appDeploy application
c2a rebuildTrigger rebuild
Appsc2a apps listList applications
c2a apps deleteDelete application
Buildsc2a builds listList builds
c2a builds logsView build logs
Logsc2a logs showView app logs
c2a logs show -fFollow logs
Servicesc2a services listList services
Secretsc2a secrets listList secrets
c2a secrets createCreate secret
Envc2a env setSet env variables
c2a env listList env variables
TUIc2a tuiInteractive dashboard

Need help? Visit our GitHub Issues or contact support.