Documentation & CLI Reference

Everything you need to configure, plan, and deploy cloud infrastructure with devinfra CLI.

$ pip install devinfra

Core Principles

devinfra provides a local-first control plane engine for cloud orchestration with four core guarantees:

1. Zero Credential Exfiltration

Your cloud tokens, credentials, and state databases never leave your local machine or CI runner.

2. Direct Native Cloud SDKs

Pure Python execution via official native cloud SDKs. No Terraform state files or CLI wrappers.

3. Authoritative Local State

State is maintained in an ACID SQLite database at .platform/state.db with SHA-256 drift validation.

4. Topological DAG Planning

Computes minimal diffs (CREATE, UPDATE, DELETE, UNCHANGED) with confirmation gates on destructive actions.

Declarative Spec (platform.yaml)

A minimal platform.yaml defines global project settings and individual application components:

yaml
project:
  name: acme-production       # Unique project namespace
  provider: cloud             # Cloud provider
  region: us-east-1          # Target deployment region
  environment: production   # dev, staging, or production

services:
  # Static Frontend on Object Storage & Edge CDN
  frontend:
    type: static
    source: ./dist
    deploy: object-storage
    cdn: true

  # Containerized API Service
  api:
    type: web
    source: ./api
    runtime: python
    deploy: container
    port: 8000
    resources:
      cpu: 1.0
      memory: 2GB

  # Serverless Function Handler
  webhook:
    type: function
    source: ./webhook
    runtime: python
    deploy: function
    entrypoint: handler.main

  # Dedicated Worker VM
  worker:
    type: worker
    source: ./worker
    deploy: vm
    resources:
      cpu: 2.0
      memory: 4GB

Supported Service Types

Type Deploy Target Cloud Primitives Provisioned Use Cases
static object-storage Object Storage Bucket, Edge CDN, Origin Access Policy React, Vite, Vue, Astro, HTML
web container Container Registry, Container Service, Load Balancer FastAPI, Express, Django, Next.js
function function Serverless Function, IAM Role, HTTP API Gateway Micro-endpoints, webhooks
worker vm Virtual Machine, Launch Template, Attached Volume, Log Agent Celery queues, heavy background jobs

CLI Command Reference

All devinfra commands support --json for programmatic integration in CI/CD pipelines.

devinfra init [directory]

Inspects directory, detects application framework, and creates a tailored platform.yaml.

bash
devinfra init           # Interactive prompts
devinfra init -y        # Non-interactive mode (auto-accept defaults)

devinfra configure show

Displays active cloud caller identity (Account ID, User or Role ARN) without leaking secrets.

bash
devinfra configure show
devinfra configure show --json

devinfra doctor

Executes automated checks across local SQLite store, cloud authentication connectivity, and permissions.

bash
devinfra doctor

devinfra validate

Validates platform.yaml schema against Pydantic models and checks provider capability compatibility.

bash
devinfra validate

devinfra plan

Calculates the topological execution DAG and previews diffs (CREATE, UPDATE, DELETE, UNCHANGED).

bash
devinfra plan
devinfra plan --json

devinfra deploy

Provisions cloud resources in topological order, differentially syncs assets, and commits state.

bash
devinfra deploy
devinfra deploy --dry-run   # Simulate execution without cloud API mutations
devinfra deploy --force     # Auto-approve destructive changes in CI/CD

devinfra status

Displays service deployment health, resource endpoints, and out-of-band cloud drift.

bash
devinfra status
devinfra status --drift     # Scan cloud for out-of-band modifications

devinfra destroy

Tears down all tracked cloud infrastructure in reverse topological order.

bash
devinfra destroy
devinfra destroy --force    # Non-interactive confirmation for CI/CD

devinfra logs

Streams live runtime service logs with real-time regex secret sanitization.

bash
devinfra logs --service api
devinfra logs --service api --tail 50 --follow

devinfra costs

Queries cloud billing metrics with tag filtering to display Actual, Estimated, and Projected billing.

bash
devinfra costs

devinfra dashboard [options]

Starts the local-first FastAPI control plane and web console on http://127.0.0.1:8765. Provides real-time topology DAG visualization, normalized runtime telemetry, discrete-event workload simulation, and immutable audit logs without cloud console lock-in.

bash
devinfra dashboard                  # Starts server at http://127.0.0.1:8765
devinfra dashboard --port 9000      # Custom port
devinfra dashboard --open           # Automatically open default browser
devinfra dashboard --host 0.0.0.0   # Bind to all interfaces (e.g. inside containers)

See the full Local Web Console Guide → below for walkthroughs of all dashboard views.

Authoritative Local State (state.db)

State is stored locally in an ACID-compliant SQLite database at .platform/state.db. It features advisory file locking, SHA-256 configuration hash validation, and automatic rollbacks.

Secondary Cloud Tag Attribution

All cloud resources are tagged with platform:managed=true, platform:project=<name>, and platform:deployment-id=<id>, enabling out-of-band drift discovery even across fresh developer machines.

Local Web Console & UI Dashboard

devinfra dashboard launches an integrated web console powered by a local FastAPI service listening on http://127.0.0.1:8765. It provides full visual observability, interactive topology graphs, discrete-event cost simulations, and in-browser deployment controls—all running strictly on your local machine with zero external SaaS dependencies.

Zero Credential Exfiltration

The web console executes directly against your local SQLite database (.platform/state.db) and ambient in-memory credentials. No telemetry, account tokens, or infrastructure manifests are ever uploaded to third-party cloud servers.

Desktop Application Prefer a standalone desktop installer?

Download DevInfra Desktop v0.1.3 as a native package for Windows (.exe / .msi), Linux, or macOS with zero Python setup required.

Download Desktop App

1. System Overview & Telemetry Health Gauges

The System Overview screen provides an instant health assessment of your active project, authoritative resource counts, month-to-date spend estimates, and normalized telemetry gauges.

  • Declared Services: Total number of services specified in platform.yaml (Active vs. Pending deployment).
  • Authoritative Resources: Count of cloud primitives tracked in local SQLite with ACID snapshot verification.
  • Month-to-Date Spend & Projections: Live cost estimation filtered by managed resource tags.
  • Deployment State: Current lifecycle status (e.g., SUCCESS, 5 RESOURCES APPLIED).
  • Telemetry Health Gauges: Normalized run-rate meters for Average CPU Load, Memory Headroom Reserve, Request Ingress (~req/sec), and HTTP 5xx Error Rate.
🔒 http://127.0.0.1:8765/overview
System Overview Dashboard with Health Gauges and Services Portfolio
System Overview: Real-time control plane state, normalized run-rate gauges, and services summary. Live Observability

2. Services Catalog & Cloud Primitives Mapping

The Services Catalog view breaks down every declared component of your stack (APIs, frontends, worker tasks, micro-endpoints) into high-visibility service cards.

  • Service Attributes: Displays source root directory, target runtime type, port bindings, and CDN edge status.
  • Active Cloud Primitives: Displays exact mapped cloud resource identifiers with one-click copy to clipboard.
  • Quick Actions: Stream real-time container/function logs directly with the Stream Logs button or jump directly to service-level metrics.
  • State Filters: Quickly filter services by ALL, ACTIVE, PENDING, or FAILED.
🔒 http://127.0.0.1:8765/services
Services Catalog View in devinfra Web Console
Services Catalog: Granular inspection of declared services, source roots, and live cloud primitive mappings. Resource Discovery

3. Interactive Infrastructure Topology (DAG)

The Topology DAG visualizes the execution flow and topological dependency hierarchy computed by the planning engine. Resources are automatically ordered across four architectural stages:

Stage Layer Name Primitives Visualized
1 Application Intent Declared service nodes (e.g., api, frontend, background workers)
2 Ingress & Edge Global CDN distributions, edge caches, DNS records, origin access controls
3 Compute & Runtime Serverless functions, container task definitions, HTTP API Gateways, load balancers
4 Storage & Primitives Object storage buckets, IAM execution roles, policies, block storage volumes
🔒 http://127.0.0.1:8765/topology
Interactive Directed Acyclic Graph (DAG) in devinfra Web Console
Topology DAG: Multi-stage Directed Acyclic Graph tracing dependencies from intent to cloud primitives. Dependency Graph

4. Performance & Traffic Telemetry

Inspect normalized compute utilization, memory saturation, and throughput volume without switching back and forth to external cloud monitoring consoles.

  • Service Scope Filtering: Switch between All Services aggregate view or drill into individual services (api, frontend).
  • Time Horizons: Toggle time-series windows across 15m, 1h, 6h, 24h, and 7d.
  • Utilization Threshold Alerts: Real-time threshold monitoring (e.g. CPU saturation target < 80% with automated headroom warnings).
  • Throughput Analytics: Real-time request volume graphs displaying average rate, peak throughput, and total requests.
🔒 http://127.0.0.1:8765/metrics
Performance and Traffic Telemetry with Normalized Graphs
Performance Telemetry: CPU utilization profiles, memory headroom saturation, and request volume trends. Telemetry

5. Workload & Cost Simulation (Discrete-Event Scheduler)

One of devinfra's most powerful capabilities is its built-in Discrete-Event Workload Simulator. It models queuing theory latency percentiles, dynamic autoscaler triggers, and runtime billing curves before you provision live infrastructure.

Interactive Input Modeling

  • Baseline Traffic (RPS): Interactive slider from 10 to 10,000+ requests/sec.
  • Traffic Curve Patterns: Test Diurnal (Day/Night) cycles, Steady (Constant) loads, or Spike (Flash Crowd) anomalies.
  • Simulation Horizon: Run discrete-event cycles from 24 hours up to 30 days (~1 billing cycle).
  • Trade-Off Evaluation: Compare serverless function costs vs. container service replicas vs. worker VMs.

Simulation Output Analytics

  • Projected Dynamic Cost: Accurate monthly spend curves compared against idle baseline costs.
  • Simulated Requests & Egress: Predicts total processed transactions and data transfer egress in gigabytes.
  • Latency Percentiles: Computes $p_{50}$, $p_{95}$, and $p_{99}$ response times per service tier.
  • Autoscaling Replicas & Saturation: Predicts peak replica scale-out count and dropped request percentage.
🔒 http://127.0.0.1:8765/simulation
Discrete-Event Workload & Cost Simulation Engine
Workload & Cost Simulation: Synthetic traffic modeling, latency percentile forecasting, and dynamic autoscaling curves. Predictive Planning

6. Deployments & Audit Trail

Every execution in devinfra is recorded immutably in the local SQLite audit ledger. The Deployments & Audit History view allows developers to verify plan references, inspect executed primitives, and trace configuration hashes.

  • Status: Immediate verification of deployment outcome (SUCCESS, FAILED, or ROLLED BACK).
  • Deployment ID: Unique tracking UUID for correlating state and telemetry.
  • Plan Reference: Links directly to the calculated DAG diff that generated the operation.
  • Applied Primitives: Exact count and inventory of cloud resources provisioned.
  • Config Hash: Authoritative SHA-256 fingerprint of the platform.yaml manifest at execution time.
🔒 http://127.0.0.1:8765/audit
Immutable Local Audit Trail in devinfra Web Console
Deployments & Audit History: Local ACID-verified audit ledger tracking every plan and apply operation. Immutable Audit

7. In-Browser Cloud Operations & Hotkeys

The web console isn't just a read-only viewer—it allows developers to execute full control plane workflows with keyboard shortcuts:

Shortcut Action Description
Ctrl+P / ^P Plan Changes Computes the topological DAG diff against local SQLite state without applying.
Ctrl+D / ^D Deploy Live Executes the planned DAG with exponential backoff retries and ACID state commit.
Sync Drift & Doctor Runs STS/identity checks, validates advisory state locks, and audits out-of-band drifts.
Decommission Teardown Stack Presents confirmation safety gates before tearing down tracked cloud primitives.

Security & Local Isolation

devinfra is designed from the ground up for strict security, air-gapped workflows, and zero credential leakage.

In-Memory Ambient Auth

Credentials loaded from environment variables or active sessions remain strictly in RAM. No tokens are written to disk or sent to external servers.

Real-Time Regex Secret Redaction

All console streams, logs, and CLI outputs automatically mask high-entropy strings, authorization tokens, private keys, and passwords.

FAQ & Diagnostics

Q: Does the web dashboard require an internet connection?

No. The dashboard runs entirely on localhost (127.0.0.1:8765). It serves all assets locally and only connects to cloud APIs when you trigger operations like deployment or metrics synchronization.

Q: Can I run the dashboard in Docker or on a remote VM?

Yes. Use devinfra dashboard --host 0.0.0.0 --port 8765 and forward the port over SSH (ssh -L 8765:localhost:8765 user@host) for encrypted remote access without exposing the port publicly.

Q: How does the workload simulation predict costs accurately?

The simulation engine models synthetic arrival curves (diurnal, steady, flash crowd) with discrete-event queueing models to calculate invocation counts, data egress, and container replica triggers based on published pricing vectors.