Day-to-Day Operations

Local Development

Start the dev server

grid dev

This:

  1. Reads cloudgrid.yaml and validates services
  2. Opens tunnels to grid databases (MongoDB, Redis) through the API
  3. Allocates ports for each service
  4. Auto-installs node_modules if missing (for Node/Next.js services)
  5. Spawns each service with injected environment variables
  6. Prefixes output with colored [service-name] labels

Dev runner per service type

TypeDev command
node (JS)node --watch src/index.js
node (TS)npx tsx watch src/index.ts
nextjsnpx next dev -p <port>
pythonpython src/main.py
staticnpx serve . -l <port>
cron (job)Runs once, prints result
cron (http)Skipped in dev

Run a single service

grid dev api

Spawns only the api service. Sibling URLs are still injected.

Escape hatch

grid dev -- docker compose up

Runs your custom command with grid env vars injected.

Dev session management

grid dev --status     # Check what's running
grid dev --kill       # Clean shutdown of stale sessions
grid dev --force      # Override a stale lock file
grid dev --fixed-ports  # Refuse ephemeral port fallback

Dev database sandbox

Seed your dev database with sample data:

grid dev seed                        # Use org default mode
grid dev seed --from ai              # AI-generated seed data
grid dev seed --from snapshot         # Snapshot from production
grid dev seed --collections users,posts  # Specific collections

Reset the sandbox:

grid dev reset --yes