Skip to content

CLI Reference

The Diverge CLI provides tools to interact with your preview environments directly from your terminal.

Create an environment from the current branch.

Delete an environment.

Route cluster traffic to your local machine via an authenticated reverse tunnel.

  • --service — Service name (default: auto-detect)
  • --port — Local port (default: 8080)
  • --endpoint — Local endpoint IP (default: tailscale ip -4)
  • --token — Bearer token for server authentication (can also be set via DIVERGE_TOKEN; automatically falls back to current kubeconfig user token)
  • --env-output — inject (in-memory) or file (.env.diverge) (default: inject)
  • --devspace — Generate devspace.yaml template

Intercept a service.

Stop intercepting.

Detect which services changed relative to a base branch.

  • --config — Path to .diverge.yaml
  • --base — Base ref (default: main)
  • --output — Output format: text, json

Export env vars (dotenv, json, shell).

Display the service topology graph.

  • --config — Path to .diverge.yaml
  • --output — Output format: text, mermaid, dot, json
  • --gateway — Filter to specific gateway

Validate topology for cycles, orphans, and unreachable services.

  • --config — Path to .diverge.yaml

Initialize a local dev playground.

List all environments.

Stream logs.

Run MCP server over stdio for AI agent integration.

Open env URL in browser.

Manage plugins.

Create preview group.

Delete preview group.

Preview group status.

Watch until Ready/Failed.

List providers.

Simulate request routing through the topology.

  • --config — Path to .diverge.yaml
  • --gateway — Filter to specific gateway
  • --header — Custom header name
  • --output — Output format: text, mermaid, dot, json
  • --live — Use Prometheus for live topology

Show active envs and groups.

Validate .diverge.yaml.

Print version.