Problem
Scaling replicas and adjusting CPU/memory resources requires the web dashboard or direct API calls. For production workloads, being able to scale quickly from the terminal is critical — especially during incidents.
The API already supports UpdateProjectEnvironmentResources, but there's no CLI command for it.
Proposed Solution
Add a createos scale command for adjusting replicas and resource allocation.
Usage
# Scale replicas
createos scale --replicas 3
# Adjust resources
createos scale --cpu 500m --memory 1024
# Scale a specific project/environment
createos scale --project <id> --environment <id> --replicas 2
# View current scale settings
createos scale --show
Display
$ createos scale --replicas 3 --cpu 500m
Scaling my-api (production)...
┌──────────┬─────────┬─────────┐
│ │ Before │ After │
├──────────┼─────────┼─────────┤
│ Replicas │ 1 │ 3 │
│ CPU │ 200m │ 500m │
│ Memory │ 512MB │ 512MB │
└──────────┴─────────┴─────────┘
✓ Scaling complete.
Validation
- Enforce platform limits: CPU 200–500m, Memory 500–1024MB, Replicas 1–3
- Show clear error if user requests beyond limits:
Error: CPU must be between 200m and 500m (requested: 800m)
- Confirm before scaling down (fewer replicas or less resources)
Show current scale
$ createos scale --show
my-api (production)
──────────────────────
Replicas: 2 / 3 max
CPU: 200m (limit: 500m)
Memory: 512MB (limit: 1024MB)
Implementation Notes
Problem
Scaling replicas and adjusting CPU/memory resources requires the web dashboard or direct API calls. For production workloads, being able to scale quickly from the terminal is critical — especially during incidents.
The API already supports
UpdateProjectEnvironmentResources, but there's no CLI command for it.Proposed Solution
Add a
createos scalecommand for adjusting replicas and resource allocation.Usage
Display
Validation
Show current scale
Implementation Notes
cmd/scale/scale.goUpdateProjectEnvironmentResourcesAPI method (may need to add tointernal/api/methods.go).createos.json(depends on Addcreateos initcommand — link local projects to CreateOS #4)root.gocommands and home screen