Skip to content

Quick Reference

Andrew den Hertog edited this page Dec 3, 2025 · 1 revision

Quick Reference

Quick reference guide for common tasks and commands in Codex Web.

Common User Actions

Workspace Operations

Action Steps Time
Create Workspace Workspaces → Create → Fill form → Create 2 min
Start Workspace Find workspace → Click Start 30-60 sec
Stop Workspace Find workspace → Click Stop 5-10 sec
Open Workspace Ensure Running → Click Open → Enter password 10 sec
Delete Workspace Workspace details → Delete → Confirm 30 sec

Keyboard Shortcuts (In Workspace)

Action Windows/Linux macOS
Command Palette Ctrl+Shift+P Cmd+Shift+P
Quick Open File Ctrl+P Cmd+P
Toggle Terminal Ctrl+` Cmd+`
Save File Ctrl+S Cmd+S
Find Ctrl+F Cmd+F
Replace Ctrl+H Cmd+H
Go to Line Ctrl+G Cmd+G
Comment Line Ctrl+/ Cmd+/
Split Editor Ctrl+\ Cmd+\
Close Editor Ctrl+W Cmd+W

Admin Quick Reference

User Management

# Set your token
export TOKEN="your-jwt-token"
export API="https://your-codex.com/api"

# Create user
curl -X POST "$API/admin/users" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "email": "user@example.com",
    "name": "User Name",
    "groups": ["grp_abc123"],
    "isAdmin": false
  }'

# List users
curl -H "Authorization: Bearer $TOKEN" "$API/admin/users"

# Get user details
curl -H "Authorization: Bearer $TOKEN" "$API/admin/users/{userId}"

# Update user
curl -X PATCH "$API/admin/users/{userId}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"name": "New Name"}'

# Delete user
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$API/admin/users/{userId}"

# Reset password
curl -X POST "$API/admin/users/{userId}/reset-password" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "newPassword": "TempPass123!",
    "permanent": false
  }'

# Disable/enable account
curl -X POST -H "Authorization: Bearer $TOKEN" \
  "$API/admin/users/{userId}/disable"
curl -X POST -H "Authorization: Bearer $TOKEN" \
  "$API/admin/users/{userId}/enable"

# Promote/demote admin
curl -X POST -H "Authorization: Bearer $TOKEN" \
  "$API/admin/users/{userId}/promote"
curl -X POST -H "Authorization: Bearer $TOKEN" \
  "$API/admin/users/{userId}/demote"

Group Management

# Create group
curl -X POST "$API/groups" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "name": "team-name",
    "displayName": "Team Name",
    "namespace": "codex-platform-team-name",
    "resourceQuota": {
      "cpu": "20",
      "memory": "40Gi",
      "storage": "500Gi",
      "pods": 50
    }
  }'

# List groups
curl -H "Authorization: Bearer $TOKEN" "$API/groups"

# Get group details
curl -H "Authorization: Bearer $TOKEN" "$API/groups/{groupId}"

# Update group
curl -X PATCH "$API/groups/{groupId}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "resourceQuota": {
      "cpu": "30",
      "memory": "60Gi",
      "storage": "750Gi",
      "pods": 75
    }
  }'

# Delete group
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$API/groups/{groupId}"

# Add member to group
curl -X POST "$API/groups/{groupId}/members" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "userId": "usr_123",
    "role": "member"
  }'

# Remove member from group
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$API/groups/{groupId}/members/{userId}"

# Get group members
curl -H "Authorization: Bearer $TOKEN" \
  "$API/groups/{groupId}/members"

# Get group usage
curl -H "Authorization: Bearer $TOKEN" \
  "$API/groups/{groupId}/usage"

Workspace Administration

# List all workspaces
curl -H "Authorization: Bearer $TOKEN" "$API/admin/workspaces"

# List group workspaces
curl -H "Authorization: Bearer $TOKEN" \
  "$API/workspaces?groupId={groupId}"

# Get workspace details
curl -H "Authorization: Bearer $TOKEN" \
  "$API/workspaces/{workspaceId}"

# Delete workspace (admin)
curl -X DELETE -H "Authorization: Bearer $TOKEN" \
  "$API/admin/workspaces/{workspaceId}"

# Get workspace logs
curl -H "Authorization: Bearer $TOKEN" \
  "$API/workspaces/{workspaceId}/logs?lines=100"

# Get workspace metrics
curl -H "Authorization: Bearer $TOKEN" \
  "$API/workspaces/{workspaceId}/metrics"

System Operations

# Get platform stats
curl -H "Authorization: Bearer $TOKEN" "$API/admin/stats"

# Get audit logs
curl -H "Authorization: Bearer $TOKEN" \
  "$API/admin/audit-logs?limit=100"

# Get system health
curl -H "Authorization: Bearer $TOKEN" "$API/admin/health"

# Get cluster capacity
curl -H "Authorization: Bearer $TOKEN" "$API/admin/cluster/capacity"

# Get/update system settings
curl -H "Authorization: Bearer $TOKEN" "$API/admin/settings"
curl -X PATCH "$API/admin/settings" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{
    "defaultWorkspaceImage": "ghcr.io/user/image:tag"
  }'

Kubernetes Commands

Namespace Operations

# List all codex namespaces
kubectl get namespaces -l vscode-platform/group-id

# Get namespace details
kubectl describe namespace codex-platform-{group-name}

# View resource quota
kubectl get resourcequota -n codex-platform-{group-name}
kubectl describe resourcequota -n codex-platform-{group-name}

Workspace Pods

# List workspaces in namespace
kubectl get pods -n codex-platform-{group-name}

# Get workspace details
kubectl describe pod workspace-{id} -n codex-platform-{group-name}

# View workspace logs
kubectl logs workspace-{id} -n codex-platform-{group-name}
kubectl logs workspace-{id} -n codex-platform-{group-name} --tail=100

# Get workspace resource usage
kubectl top pod workspace-{id} -n codex-platform-{group-name}

StatefulSets

# List StatefulSets
kubectl get statefulsets -n codex-platform-{group-name}

# Get StatefulSet details
kubectl describe statefulset workspace-{id} -n codex-platform-{group-name}

# Scale StatefulSet (start/stop)
kubectl scale statefulset workspace-{id} --replicas=1 -n codex-platform-{group-name}
kubectl scale statefulset workspace-{id} --replicas=0 -n codex-platform-{group-name}

# Delete StatefulSet
kubectl delete statefulset workspace-{id} -n codex-platform-{group-name}

Persistent Volumes

# List PVCs in namespace
kubectl get pvc -n codex-platform-{group-name}

# Get PVC details
kubectl describe pvc workspace-storage-workspace-{id}-0 \
  -n codex-platform-{group-name}

# Check PVC usage
kubectl exec -it workspace-{id}-0 -n codex-platform-{group-name} -- df -h

# Delete PVC
kubectl delete pvc workspace-storage-workspace-{id}-0 \
  -n codex-platform-{group-name}

Services and Networking

# List services
kubectl get services -n codex-platform-{group-name}

# Get service details
kubectl describe service workspace-{id} -n codex-platform-{group-name}

# List HTTPRoutes (Gateway API)
kubectl get httproutes -n codex-platform-{group-name}

# View HTTPRoute details
kubectl describe httproute -n codex-platform-{group-name}

Resource Tiers

Predefined Tiers

Tier CPU Memory Storage Use Case
Single User 0.5 cores 1 GB 10 GB Light development, testing
Small Team 2 cores 4 GB 50 GB Most development work
Enterprise 4 cores 8 GB 100 GB Heavy workloads, ML, builds

Custom Resources

When creating a workspace, you can specify custom resources:

{
  "resources": {
    "cpu": "2",
    "memory": "4Gi",
    "storage": "50Gi"
  }
}

File Paths

Important Directories

Path Description
/workspace/.codex-projects Persistent storage (IMPORTANT!)
/workspace Workspace root
~/ User home directory
/tmp Temporary files (not persistent)

Workspace Files

# Navigate to persistent storage
cd /workspace/.codex-projects

# Create project directory
mkdir my-project
cd my-project

# Initialize git
git init

# Clone repository
git clone https://github.com/user/repo.git

Git Workflow

Basic Operations

# Check status
git status

# Stage changes
git add .
git add file.js

# Commit
git commit -m "Commit message"

# Push
git push origin main

# Pull
git pull origin main

# Create branch
git checkout -b feature-branch

# Switch branch
git checkout main

# Merge branch
git merge feature-branch

# View history
git log --oneline

Common Terminal Commands

File Operations

# List files
ls -la

# Change directory
cd /path/to/directory

# Print working directory
pwd

# Create directory
mkdir directory-name

# Remove file
rm filename

# Remove directory
rm -rf directory-name

# Copy file
cp source.txt destination.txt

# Move/rename file
mv oldname.txt newname.txt

# View file content
cat filename.txt
less filename.txt

# Edit file
nano filename.txt
vim filename.txt

Process Management

# List running processes
ps aux

# Find process
ps aux | grep node

# Kill process
kill PID
kill -9 PID

# View resource usage
top
htop

Development Commands

# Node.js
node app.js
npm install
npm run dev
npm test

# Python
python app.py
python3 script.py
pip install -r requirements.txt

# Go
go run main.go
go build
go test

# Docker (if available)
docker ps
docker images
docker run -it image:tag

Troubleshooting Quick Checks

Workspace Won't Start

# Check workspace status via API
curl -H "Authorization: Bearer $TOKEN" \
  "$API/workspaces/{workspaceId}"

# Check pod status
kubectl get pod workspace-{id} -n namespace

# View pod events
kubectl describe pod workspace-{id} -n namespace

# Check logs
kubectl logs workspace-{id} -n namespace

# Check resource quota
kubectl describe resourcequota -n namespace

Connection Issues

# Check if pod is running
kubectl get pod workspace-{id} -n namespace

# Check service
kubectl get service workspace-{id} -n namespace

# Check HTTPRoute
kubectl get httproute -n namespace

# Test connectivity
kubectl exec -it workspace-{id}-0 -n namespace -- curl localhost:8080

Resource Issues

# Check group usage
curl -H "Authorization: Bearer $TOKEN" \
  "$API/groups/{groupId}/usage"

# Check namespace resources
kubectl describe namespace codex-platform-{group-name}

# List pods with resource usage
kubectl top pods -n codex-platform-{group-name}

# View resource quota
kubectl get resourcequota -n codex-platform-{group-name} -o yaml

Environment Variables

Backend Configuration

# Required
NODE_ENV=production
PORT=3001
JWT_SECRET=your-secret-key
AWS_REGION=us-west-2
DYNAMODB_REGION=us-west-2
DYNAMODB_TABLE_PREFIX=codex-platform
REDIS_URL=redis://localhost:6379

# OAuth
AWS_COGNITO_USER_POOL_ID=us-east-1_xxxxx
AWS_COGNITO_CLIENT_ID=xxxxx
GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com

# Kubernetes
KUBERNETES_NAMESPACE_PREFIX=codex-platform

Frontend Configuration

# Authentication
REACT_APP_AUTH_PROVIDER=cognito
REACT_APP_AUTH_CLIENT_ID=your-client-id
REACT_APP_AUTH_REGION=us-east-1
REACT_APP_USER_POOL_ID=us-east-1_xxxxx

# API
REACT_APP_API_BASE_URL=http://localhost:3001/api

Status Codes

Workspace States

State Icon Meaning
stopped ⏹️ Not running, resources freed
starting 🔄 Booting up (30-60s)
running Active and accessible
stopping 🔄 Shutting down (5-10s)
error Failed to start
pending Waiting for resources

HTTP Status Codes

Code Meaning
200 Success
201 Created
204 Success (no content)
400 Bad request
401 Unauthorized
403 Forbidden
404 Not found
409 Conflict
500 Server error
503 Service unavailable

Support Escalation

Tier 1: Self-Service

  • Check documentation
  • Review FAQ
  • Try troubleshooting steps
  • Search error messages

Tier 2: Group Admin

  • Workspace issues in your group
  • Resource quota questions
  • Group member access

Tier 3: Platform Admin

  • Account creation/deletion
  • Group creation/management
  • Platform-wide issues
  • System configuration

Tier 4: Platform Engineering

  • Infrastructure problems
  • Kubernetes issues
  • Database problems
  • Code bugs

Additional Resources


Home

Clone this wiki locally