Skip to main content

Quick Start

Already have an agent? Deploy it in seconds:
# 1. Make sure you're logged in
tu auth login

# 2. Deploy (from your agent directory)
tu deploy
That’s it. The CLI handles building, pushing, and deploying.

The Config

Your config file (config.yaml) is the single source of truth for deployment. It tells the CLI where your code is, how to build it, and how to deploy it.
agent:
  name: my-namespace/my-agent   # Must be in namespace/agent-name
  description: My first agent   
  sdk_type: claude_agent_sdk    
  temporal:
    enabled: false              
build:
  context:
    root: ./                    # Root directory for Docker build
    include_paths: .            # Paths to include in build context
    dockerfile: Dockerfile      # Path to Dockerfile (relative to root)
    dockerignore: .dockerignore # Optional: path to .dockerignore
deployment:
  production:
    replicaCount: 1
    resources:
      requests:
        cpu: "500m"
        memory: "6Gi"
      limits:
        cpu: "1000m"
        memory: "6Gi"
    areTasksSticky: true        # Tasks stay on old version during deploy

  preview:
    replicaCount: 1
    resources:
      requests:
        cpu: "250m"
        memory: "2Gi"
      limits:
        cpu: "500m"
        memory: "2Gi"
    areTasksSticky: false       # Tasks migrate to new version immediately

Environments & Branches

When you create an agent, two environments are created for it by default:
EnvironmentGit BranchDefault Behavior
ProductionmainHigher resources, tasks stay on old version when a new version is deployed. Must explicitly migrate tasks to new versions
Previewall other branchesLower resources, tasks migrate to new versions immediately
Additional environments (like staging) can also be created.

Task Stickiness

When you deploy a new version, what happens to running tasks?
SettingBehavior
areTasksSticky: true (production default)Running tasks stay on old version until complete
areTasksSticky: false (preview default)Running tasks migrate to new version immediately
In production, if your new version doesn’t have a breaking change, you’ll want to migrate your tasks to your latest version. You can do this with tu tasks migrate --from <version_id> --to latest.

Environment Resolution

Environments are determinted automatically based on the current git branch you’re on:
  1. CLI detects your current git branch
  2. Platform API resolves branch → environment
  3. CLI uses the matching config (deployment.production or deployment.preview)
# On main branch → uses deployment.production
git checkout main
tu deploy

# On feature branch → uses deployment.preview
git checkout feature/new-thing
tu deploy

Managing Environment Variables

# List all environment variables
tu env ls

# Add a variable (interactive prompts for value and environment)
tu env add DATABASE_URL

# Mark env var as secret (cannot be retrieved later)
tu env add API_KEY -v "sk-xxx" -e prod --secret

# Remove a variable
tu env rm API_KEY --environment all

Bulk Import from .env File

Import multiple variables at once from a .env file:
# Import to .env to all environments
tu env import .env -e all

# Mark specific keys as secrets
tu env import .env -e prod --secret API_KEY --secret DB_PASSWORD

Pull Variables to Local File

Download your remote environment variables to a local .env file for local development:
# Pull from preview to .env.local (default)
tu env pull

# Pull from production
tu env pull .env.production -e prod
Secrets cannot be retrieved and are included as empty placeholders in pulled files.
Environment variables are injected at runtime and accessible via standard methods:
import os

# Access environment variables
api_key = os.environ.get("API_KEY")
database_url = os.environ["DATABASE_URL"]

Resource Sizing Guide

Recommendations based on agent complexity:
Agent TypeCPU RequestMemory RequestNotes
Minimum500m2GiClaude Agent SDK takes up 1.1Gi
Minimum for Prodcution5006GiAdditional room to process concurent tasks on one replica
CPU units: 1 = 1 full core, 500m = 0.5 cores. Memory units: 1Gi = 1 gibibyte.
Replicas scale up as memory or CPU limits are reached. We recommend having a minimum of 6Gi on one replica in production to handle multiple concurrent requests as more replicas scale up.

Rollback

If something goes wrong with a deployment, you can rollback to the previous version:
tu rollback
This shows recent versions and prompts you to confirm:
Version IDGit HashStatusDeployed
e77b7dc1f8c3a91current3 mins ago
c2bad41e27da232retired1 hour ago
Rollback summary:
  From: e77b7dc1 → To: c2bad41e
  Git:  f8c3a91 → 27da232

Note: Pending secrets will NOT be modified.
      The rollback uses the secrets snapshot from the target version.

? Rollback 'production' to version c2bad41e? Yes

✓ Rollback initiated for 'production'
  From: e77b7dc1 (f8c3a91)
  To:   c2bad41e (27da232)
Rollbacks use the secrets snapshot from the target version. Pending secret changes are not applied.

Deployment History

Use tu ls to see all deployments for your agent:
tu ls
AgeBranchVersionStatusGit
40 mins agopreview/feature-branchb9044640activef8c3a91
43 mins agopreview/feature-branchae4ce86fretired27da232

Deployment States

StateMeaning
activeDeployment succeeded, agent is running
failedDeployment failed (check logs)
timeoutDeployment took too long
unhealthyAgent deployed but health checks failing
retiredOld version being phased out

Events

Events provide a more granular view into the deployment history for a branch, showing each state transition as it happens.
tu ls preview/feature-branch
AgeEventVersionGitTrigger
41 mins agoRETIREDae4ce86f27da232cleanup
41 mins agoTASKS_MIGRATEDb9044640f8c3a91deploy
41 mins agoACTIVATEDb9044640f8c3a91container_register
41 mins agoCREATEDb9044640f8c3a91deploy

Event Types

EventMeaning
CREATEDVersion was created and deployment started
ACTIVATEDVersion is now active and receiving traffic
FAILEDDeployment failed
DRAININGVersion is draining (tasks being migrated away)
RETIREDVersion has been retired and is no longer active
ROLLED_BACK_FROMThis version was rolled back from
ROLLED_BACK_TOThis version was rolled back to
REDEPLOYEDVersion was redeployed (when secrets are updated)
TASKS_MIGRATEDTasks were migrated to this version
CLEANUP_FAILEDCleanup of this version failed

CLI Commands

tu deploy

tu deploy [OPTIONS]
OptionShortDefaultDescription
--config-cconfig.yamlPath to manifest file
--branchauto-detectedOverride git branch
--yes-yfalseSkip confirmation prompts
--verbose-vfalseShow Docker build output

tu rollback

tu rollback [OPTIONS]
OptionShortDefaultDescription
--env-eauto-detectedEnvironment to rollback
--version-vpreviousTarget version ID to rollback to
--yes-yfalseSkip confirmation prompts
--config-cconfig.yamlPath to config file

tu ls

tu ls [BRANCH] [OPTIONS]
OptionShortDefaultDescription
BRANCHBranch name to show events for (optional)
--limit-n10Number of items to show
--allfalseInclude retired branches
--config-cconfig.yamlPath to config file
Without a branch argument, shows recent versions across all branches. With a branch name, shows lifecycle events for that branch.