Three Operating Modes
Sim: Local development with HTTP API simulator. Cloud: Full Kubernetes cluster integration. Lab: Air-gapped BIOS-mode for hardware bringup.
Unified command-line interface for DRA resources, photonic lanes, Free-Form Memory, and local simulation
# Install globally via npm
npm install -g @corridoros/cli
# Or build from source
git clone https://github.com/mostafa-nasr-4277/CorridorOS.git
cd CorridorOS/packages/cli
npm install && npm run build && npm link
# Verify installation
corridor version
corridor doctor
Sim: Local development with HTTP API simulator. Cloud: Full Kubernetes cluster integration. Lab: Air-gapped BIOS-mode for hardware bringup.
Automatically wires into CorridOS browser UI with API auto-discovery. Run corridor ui open
to launch with simulator connection.
Generate DRA DeviceClass, ResourceClaimTemplate, PhotonicLaneParameters, and FreeFormMemoryLease YAML with clean, production-ready output.
Export sealed lab bundles with calibration data, convert high-level intents to Kubernetes resources without cluster access on hardware.
corridor doctor # Check Node, kubectl, cluster connectivity
corridor quickstart # Show 3-command setup guide
corridor version # Display CLI version
corridor sim start [--port 7777] # Start local API server
Endpoints: /api/health
, /api/devices
, /api/claims
, /api/allocations
, /api/ffm/leases
, /api/metrics
# Generate DRA DeviceClass
corridor deviceclass generate photonic.lanes > deviceclass.yaml
# Generate ResourceClaimTemplate with parameters
corridor claim generate \
--wavelength 1310 \
--bandwidth 40G \
--name my-lane > claim.yaml
# Generate FreeFormMemoryLease
corridor ffm lease generate \
--size 4Gi \
--qos-floor 400MiBps \
--name my-lease > ffm.yaml
# Apply to cluster (cloud mode) or simulator (sim mode)
corridor claim apply -f claim.yaml
# Check status
corridor status [--json]
# Export Prometheus metrics
corridor metrics [--watch]
# List configured profiles
corridor profile list
# Switch between environments
corridor profile use cloud
# Create/update profile
corridor profile set prod \
--mode cloud \
--api https://api.example.com \
--kube-context prod-cluster \
--namespace corridor
# Open CorridOS UI (auto-connects to simulator)
corridor ui open
# Specify API endpoint
corridor ui open --api http://127.0.0.1:7777
# Export lab profile bundle
corridor bios export --out lab-profile.tgz
# Import and convert to Kubernetes resources
corridor bios import lab-profile.tgz --to-claims > resources.yaml
kubectl apply -f resources.yaml
# Terminal 1: Start simulator
corridor sim start
# Terminal 2: Generate & apply
corridor claim generate \
--wavelength 1310 \
--bandwidth 40G > lane.yaml
corridor claim apply -f lane.yaml
# Check status
corridor status
# Open UI
corridor ui open
# Switch to cloud profile
corridor profile use cloud
# Apply DRA resources
kubectl apply -f \
https://corridoros.com/manifests/dra-deviceclass.yaml
kubectl apply -f \
https://corridoros.com/manifests/corridor-controller.yaml
# Create claim
corridor claim generate \
--wavelength 1550 \
--bandwidth 100G | kubectl apply -f -
# Monitor
corridor status --watch
# On hardware (air-gapped)
corridor profile set lab --mode lab
corridor bios export --out setup.tgz
# On workstation with cluster
corridor profile use cloud
corridor bios import setup.tgz \
--to-claims | kubectl apply -f -
# Verify
corridor status
Config stored at ~/.config/corridor/config.yaml
activeProfile: default
profiles:
default:
mode: sim
apiBase: http://127.0.0.1:7777
cloud:
mode: cloud
kubeContext: corridor-prod
namespace: corridor
grafana: https://grafana.example.com
lab:
mode: lab
Code | Meaning | Example |
---|---|---|
0 |
Success | Command completed successfully |
1 |
General error | Unexpected failure |
2 |
Validation failure | Bad flags or missing required parameters |
7 |
Cluster unreachable | kubectl cannot connect to cluster |
13 |
Forbidden | Unauthorized access to cluster resources |
21 |
Simulator not running | Cannot connect to http://127.0.0.1:7777 |
The CLI seamlessly integrates with the browser-based operating system:
CorridOS.html automatically detects the local simulator at boot (400ms timeout). No manual configuration needed.
corridor ui open
passes ?api=http://127.0.0.1:7777
to the browser, instantly connecting to the simulator.
All apps read localStorage.getItem('corridor.apiBase')
for API calls. Single source of truth for endpoint configuration.
# Bash (add to ~/.bashrc)
eval "$(corridor completion bash)"
# Zsh (add to ~/.zshrc)
eval "$(corridor completion zsh)"
# Fish
corridor completion fish > ~/.config/fish/completions/corridor.fish