Skip to content

Add createos scale command — adjust replicas and resources #10

@naman485

Description

@naman485

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions