Documentation
¶
Index ¶
- Variables
- func Execute()
- func GenerateMermaid(cfg DevxConfig) string
- func GetRootCmd() *cobra.Command
- type DevxConfig
- type DevxConfigBridge
- type DevxConfigBridgeIntercept
- type DevxConfigBridgeTarget
- type DevxConfigContainerBuild
- type DevxConfigCron
- type DevxConfigCustomAction
- type DevxConfigDatabase
- type DevxConfigDatabasePull
- type DevxConfigDatabaseSeed
- type DevxConfigDependsOn
- type DevxConfigHealthcheck
- type DevxConfigInclude
- type DevxConfigKubernetesImage
- type DevxConfigKubernetesSync
- type DevxConfigMock
- type DevxConfigPipeline
- type DevxConfigPipelineStage
- type DevxConfigProfile
- type DevxConfigService
- type DevxConfigServiceBridgeIntercept
- type DevxConfigServiceBridgeTarget
- type DevxConfigServiceCloudRun
- type DevxConfigServiceContainer
- type DevxConfigServiceKubernetes
- type DevxConfigState
- type DevxConfigSync
- type DevxConfigTelemetry
- type DevxConfigTest
- type DevxConfigTestUI
- type DevxConfigTunnel
Constants ¶
This section is empty.
Variables ¶
var DetailedOutput bool
var DryRun bool
var Experimental bool
Experimental is set by --experimental; together with the DEVX_EXPERIMENTAL env var it unlocks the Tier-3 / alpha commands that ride brittle third-party tools, so the GA core's reliability isn't diluted by them being invoked by accident. See docs/analysis/feature_maturity_analysis.md.
var NonInteractive bool
Functions ¶
func GenerateMermaid ¶ added in v0.25.0
func GenerateMermaid(cfg DevxConfig) string
GenerateMermaid produces a Mermaid flowchart string from a DevxConfig.
func GetRootCmd ¶ added in v0.35.0
Types ¶
type DevxConfig ¶ added in v0.2.4
type DevxConfig struct {
Name string `yaml:"name"` // Project name
Domain string `yaml:"domain"` // Custom domain (BYOD)
Kubeconfig string `yaml:"kubeconfig,omitempty"` // KUBECONFIG to inject into run/action child commands
Env []string `yaml:"env"` // Vault sources for secret injection
Include []DevxConfigInclude `yaml:"include"` // External devx.yaml files to compose (Idea 44)
Tunnels []DevxConfigTunnel `yaml:"tunnels"` // List of ports to expose
Databases []DevxConfigDatabase `yaml:"databases"` // List of databases to provision
Services []DevxConfigService `yaml:"services"` // List of applications to orchestrate
Test DevxConfigTest `yaml:"test"` // Test configuration
Mocks []DevxConfigMock `yaml:"mocks"` // List of OpenAPI mock servers to provision
Profiles map[string]DevxConfigProfile `yaml:"profiles"` // Named environment overlays
Pipeline *DevxConfigPipeline `yaml:"pipeline"` // Explicit pipeline stages (Idea 45.2)
CustomActions map[string]DevxConfigCustomAction `yaml:"customActions"` // Named tasks (scaffolded for Idea 45.3)
Bridge *DevxConfigBridge `yaml:"bridge"` // Hybrid edge-to-local routing (Idea 46.1)
State *DevxConfigState `yaml:"state"` // State replication settings (Idea 56)
Telemetry *DevxConfigTelemetry `yaml:"telemetry"` // Telemetry export endpoints
Cron []DevxConfigCron `yaml:"cron"` // Named cron jobs runnable via `devx cron run` (Idea 66)
Logs *bool `yaml:"logs,omitempty"` // default log-streaming opt-in for all services
}
DevxConfig is the root devx.yaml schema.
type DevxConfigBridge ¶ added in v0.32.0
type DevxConfigBridge struct {
Kubeconfig string `yaml:"kubeconfig"` // Path to kubeconfig (default: ~/.kube/config)
Context string `yaml:"context"` // Kube context to use
Namespace string `yaml:"namespace"` // Default namespace for targets
AgentImage string `yaml:"agent_image"` // Override agent container image (Idea 46.2)
Targets []DevxConfigBridgeTarget `yaml:"targets"` // Outbound: remote services to bridge (46.1)
Intercepts []DevxConfigBridgeIntercept `yaml:"intercepts"` // Inbound: traffic intercept targets (46.2)
}
DevxConfigBridge defines the hybrid edge-to-local routing configuration (Idea 46). Enables developers to connect their local environment to remote K8s services via kubectl port-forward, following the "Client-Driven Architecture" principle.
type DevxConfigBridgeIntercept ¶ added in v0.32.0
type DevxConfigBridgeIntercept struct {
Service string `yaml:"service"` // K8s service to intercept
Namespace string `yaml:"namespace"` // Override namespace (default: bridge.namespace)
Port int `yaml:"port"` // Remote service port to intercept
LocalPort int `yaml:"local_port"` // Local port to route traffic to (default: same as port)
Mode string `yaml:"mode"` // "steal" or "mirror" (required)
}
DevxConfigBridgeIntercept defines an inbound traffic intercept target (Idea 46.2).
type DevxConfigBridgeTarget ¶ added in v0.32.0
type DevxConfigBridgeTarget struct {
Service string `yaml:"service"` // K8s service name (e.g., "payments-api")
Namespace string `yaml:"namespace"` // K8s namespace (default: from bridge.namespace)
Port int `yaml:"port"` // Remote service port to forward
LocalPort int `yaml:"local_port"` // Local port to bind (0 = auto)
}
DevxConfigBridgeTarget defines a remote K8s service to bridge locally (Idea 46.1).
type DevxConfigContainerBuild ¶ added in v0.56.0
type DevxConfigContainerBuild struct {
Context string `yaml:"context,omitempty"` // build context dir (default ".")
Dockerfile string `yaml:"dockerfile,omitempty"` // Dockerfile path relative to context (default "Dockerfile")
Tag string `yaml:"tag,omitempty"` // image tag (default "dev")
Platforms []string `yaml:"platforms,omitempty"` // target platforms; empty = builder default
}
DevxConfigContainerBuild describes how to build a runtime: container image from a local build context (compose-style `build:`). Reuses the same shape as kubernetes.images but without a Name (the image is local, tagged after the service).
type DevxConfigCron ¶ added in v0.46.0
type DevxConfigCron struct {
Name string `yaml:"name"` // Unique identifier (e.g. "nightly-cleanup")
Schedule string `yaml:"schedule"` // Cron expression (informational in v1)
Command []string `yaml:"command"` // Argv to execute (e.g. ["node", "scripts/cleanup.js"])
Description string `yaml:"description,omitempty"` // Free-text purpose; surfaced in `devx cron list`
Timeout string `yaml:"timeout,omitempty"` // Go-duration string (e.g. "5m"); empty = no timeout
Env map[string]string `yaml:"env,omitempty"` // Per-job env vars, merged on top of project env
}
DevxConfigCron defines a named scheduled task. The Schedule field is informational in v1 — `devx cron run <name>` is one-shot and does not start a long-running scheduler. Use it to document the production cadence so the local-test environment stays grounded in reality.
type DevxConfigCustomAction ¶ added in v0.30.0
type DevxConfigCustomAction struct {
Command []string `yaml:"command,omitempty"`
Commands [][]string `yaml:"commands,omitempty"`
}
DevxConfigCustomAction defines a named, on-demand task (scaffolded for Idea 45.3).
func (*DevxConfigCustomAction) Cmds ¶ added in v0.31.0
func (ca *DevxConfigCustomAction) Cmds() [][]string
Cmds returns the resolved command list, preferring 'commands' over 'command'.
type DevxConfigDatabase ¶ added in v0.4.1
type DevxConfigDatabase struct {
Engine string `yaml:"engine"`
Port int `yaml:"port"`
Pull DevxConfigDatabasePull `yaml:"pull"`
Seed DevxConfigDatabaseSeed `yaml:"seed"`
Dir string `yaml:"-"` // Internal: set by include resolver to the included project's dir
}
DevxConfigDatabase defines a local database to provision.
type DevxConfigDatabasePull ¶ added in v0.29.0
type DevxConfigDatabasePull struct {
Command string `yaml:"command"` // Command that writes a dump to stdout
Format string `yaml:"format"` // "custom" for pg_restore binary format (postgres only)
Jobs int `yaml:"jobs"` // Parallel workers for pg_restore (default: num CPUs)
}
DevxConfigDatabasePull defines how to pull production data into the local database.
type DevxConfigDatabaseSeed ¶ added in v0.29.0
type DevxConfigDatabaseSeed struct {
Command string `yaml:"command"` // Command to run on the host to seed the database
}
DevxConfigDatabaseSeed defines the seed command for a database.
type DevxConfigDependsOn ¶ added in v0.25.0
type DevxConfigDependsOn struct {
Name string `yaml:"name"`
Condition string `yaml:"condition"` // "service_healthy", "service_started", or "service_completed_successfully" (one-shot tasks)
}
DevxConfigDependsOn references a service/database dependency with a gating condition.
type DevxConfigHealthcheck ¶ added in v0.25.0
type DevxConfigHealthcheck struct {
HTTP string `yaml:"http"` // HTTP endpoint to poll (e.g., "http://localhost:8080/health")
TCP string `yaml:"tcp"` // TCP address to probe (e.g., "localhost:5432")
Interval string `yaml:"interval"` // Duration string (e.g., "1s", "500ms")
Timeout string `yaml:"timeout"` // Duration string (e.g., "30s")
Retries int `yaml:"retries"` // Number of consecutive successes required
}
DevxConfigHealthcheck defines how to verify a service is ready.
type DevxConfigInclude ¶ added in v0.29.0
type DevxConfigInclude struct {
Path string `yaml:"path"` // Path to devx.yaml file (relative to the parent devx.yaml)
EnvFile string `yaml:"env_file"` // Optional: override .env for this sub-project
}
DevxConfigInclude defines an external devx.yaml to compose into this project (Idea 44).
type DevxConfigKubernetesImage ¶ added in v0.49.0
type DevxConfigKubernetesImage struct {
Name string `yaml:"name"` // image name (becomes localhost:<port>/<name>:<tag>)
Context string `yaml:"context,omitempty"` // build context dir (default ".")
Dockerfile string `yaml:"dockerfile,omitempty"` // Dockerfile path relative to context (default "Dockerfile")
Tag string `yaml:"tag,omitempty"` // image tag (default "dev")
Platforms []string `yaml:"platforms,omitempty"` // target platforms, e.g. [linux/amd64, linux/arm64]; empty = builder default
}
DevxConfigKubernetesImage declares an image devx builds and loads into the cluster's in-cluster registry before applying manifests (runtime: kubernetes). The built image is pushed as localhost:<NodePort>/<name>:<tag> — reference exactly that in your manifests, with imagePullPolicy: Always.
type DevxConfigKubernetesSync ¶ added in v0.51.0
type DevxConfigKubernetesSync struct {
Src string `yaml:"src"` // local source dir (relative to the service dir)
Dest string `yaml:"dest"` // destination path inside the pod
Selector string `yaml:"selector"` // pod label selector, e.g. "app=brms-offer"
Container string `yaml:"container,omitempty"` // container in the pod (default: first)
}
DevxConfigKubernetesSync maps a local directory to a path inside the deployed pod for live-reload: devx copies it in after deploy and re-copies on change, so an in-pod watcher (tsx watch, nodemon, ...) hot-reloads.
type DevxConfigMock ¶ added in v0.23.0
type DevxConfigMock struct {
Name string `yaml:"name"` // Friendly name (becomes env var MOCK_<NAME>_URL)
URL string `yaml:"url"` // Remote OpenAPI spec URL (must be http:// or https://)
Port int `yaml:"port"` // Host port (0 = auto-assign a free port)
}
DevxConfigMock defines a remote OpenAPI-backed mock server entry.
type DevxConfigPipeline ¶ added in v0.30.0
type DevxConfigPipeline struct {
Test *DevxConfigPipelineStage `yaml:"test,omitempty"`
Lint *DevxConfigPipelineStage `yaml:"lint,omitempty"`
Build *DevxConfigPipelineStage `yaml:"build,omitempty"`
Verify *DevxConfigPipelineStage `yaml:"verify,omitempty"`
}
DevxConfigPipeline declares optional explicit pipeline stage overrides. When present, auto-detection via DetectStack is bypassed entirely ("Explicit Wins").
type DevxConfigPipelineStage ¶ added in v0.30.0
type DevxConfigPipelineStage struct {
Command []string `yaml:"command,omitempty"` // Single command shorthand
Commands [][]string `yaml:"commands,omitempty"` // Multi-command sequential execution
Before [][]string `yaml:"before,omitempty"` // Pre-stage hooks (Idea 45.3)
After [][]string `yaml:"after,omitempty"` // Post-stage hooks (Idea 45.3)
}
DevxConfigPipelineStage defines a single pipeline step (test, lint, build, verify). The Before/After hooks are scaffolded for Idea 45.3 — parsed and validated but not executed in 45.2.
func (*DevxConfigPipelineStage) Cmds ¶ added in v0.30.0
func (ps *DevxConfigPipelineStage) Cmds() [][]string
Cmds returns the resolved command list, preferring 'commands' over 'command'.
type DevxConfigProfile ¶ added in v0.25.0
type DevxConfigProfile struct {
Databases []DevxConfigDatabase `yaml:"databases"`
Tunnels []DevxConfigTunnel `yaml:"tunnels"`
Services []DevxConfigService `yaml:"services"`
Mocks []DevxConfigMock `yaml:"mocks"`
Bridge *DevxConfigBridge `yaml:"bridge"` // Idea 46.1: override bridge config per profile
Telemetry *DevxConfigTelemetry `yaml:"telemetry"`
}
DevxConfigProfile defines a named overlay that merges additively onto the base config. Follows Docker Compose override semantics: matching names merge fields (profile wins), new entries are appended.
type DevxConfigService ¶ added in v0.25.0
type DevxConfigService struct {
Name string `yaml:"name"`
Runtime string `yaml:"runtime"` // "host" (default), "container", "kubernetes", "cloud", "bridge"
Command []string `yaml:"command"` // e.g. ["npm", "run", "dev"]
DependsOn []DevxConfigDependsOn `yaml:"depends_on"` // services/databases that must be healthy first
Healthcheck DevxConfigHealthcheck `yaml:"healthcheck"`
Port int `yaml:"port"`
Env map[string]string `yaml:"env"` // extra env vars
OneShot bool `yaml:"oneshot,omitempty"` // run-to-completion task (e.g. a seed); dependents use condition: service_completed_successfully
Sync []DevxConfigSync `yaml:"sync,omitempty"` // file sync mappings into containers
BridgeTarget *DevxConfigServiceBridgeTarget `yaml:"bridge_target,omitempty"` // Idea 46.3: inline outbound bridge
BridgeIntercept *DevxConfigServiceBridgeIntercept `yaml:"bridge_intercept,omitempty"` // Idea 46.3: inline intercept
Kubernetes *DevxConfigServiceKubernetes `yaml:"kubernetes,omitempty"` // runtime: kubernetes deploy spec
CloudRun *DevxConfigServiceCloudRun `yaml:"cloud_run,omitempty"` // runtime: cloud (Cloud Run) deploy spec
Container *DevxConfigServiceContainer `yaml:"container,omitempty"` // runtime: container deploy spec
Dir string `yaml:"-"` // Internal: working directory (set by include resolver)
Logs *bool `yaml:"logs,omitempty"` // per-service log-streaming opt-in (overrides top-level)
}
DevxConfigService defines a developer application in devx.yaml.
type DevxConfigServiceBridgeIntercept ¶ added in v0.32.0
type DevxConfigServiceBridgeIntercept struct {
Service string `yaml:"service"` // K8s service to intercept
Namespace string `yaml:"namespace"` // Override namespace (default: bridge.namespace)
Port int `yaml:"port"` // Remote service port
LocalPort int `yaml:"local_port"` // Local port to route traffic to
Mode string `yaml:"mode"` // "steal" or "mirror" (required)
}
DevxConfigServiceBridgeIntercept defines an inline bridge intercept on a service (Idea 46.3).
type DevxConfigServiceBridgeTarget ¶ added in v0.32.0
type DevxConfigServiceBridgeTarget struct {
Service string `yaml:"service"` // K8s service name
Namespace string `yaml:"namespace"` // Override namespace (default: bridge.namespace)
Port int `yaml:"port"` // Remote service port
LocalPort int `yaml:"local_port"` // Local port to bind (0 = auto)
}
DevxConfigServiceBridgeTarget defines an inline bridge connect target on a service (Idea 46.3).
type DevxConfigServiceCloudRun ¶ added in v0.52.0
type DevxConfigServiceCloudRun struct {
Image string `yaml:"image"` // container image to deploy (required)
Service string `yaml:"service,omitempty"` // Cloud Run service name (default: the service name)
Region string `yaml:"region"` // GCP region, e.g. "us-central1" (required)
Project string `yaml:"project"` // GCP project ID (required)
Env map[string]string `yaml:"env,omitempty"` // env vars set on the service
AllowUnauthenticated bool `yaml:"allow_unauthenticated,omitempty"` // expose publicly (default: false)
Flags []string `yaml:"flags,omitempty"` // extra `gcloud run deploy` flags (escape hatch)
}
DevxConfigServiceCloudRun configures a runtime: cloud service — devx deploys the image to Google Cloud Run via `gcloud run deploy`. project, region, and image are required (there is no implicit default project).
type DevxConfigServiceContainer ¶ added in v0.56.0
type DevxConfigServiceContainer struct {
Image string `yaml:"image,omitempty"` // pre-built image to run (mutually exclusive with build)
Build *DevxConfigContainerBuild `yaml:"build,omitempty"` // build from local context (mutually exclusive with image)
Args []string `yaml:"args,omitempty"` // extra flags appended to `<runtime> run`
}
DevxConfigServiceContainer defines a runtime: container service — a long-lived container devx runs in the VM. Exactly one of Image or Build must be set.
type DevxConfigServiceKubernetes ¶ added in v0.48.0
type DevxConfigServiceKubernetes struct {
Manifests string `yaml:"manifests"` // kustomize dir (default), raw manifest file/dir, or helm chart
Renderer string `yaml:"renderer,omitempty"` // "kustomize" (default) | "raw" | "helm"
Namespace string `yaml:"namespace,omitempty"` // target namespace (default: "default")
Context string `yaml:"context,omitempty"` // kube context (default: current context)
Kubeconfig string `yaml:"kubeconfig,omitempty"` // kubeconfig path (default: $KUBECONFIG or ~/.kube/config)
Images []DevxConfigKubernetesImage `yaml:"images,omitempty"` // images devx builds + loads into the cluster registry before apply
Release string `yaml:"release,omitempty"` // helm release name (renderer: helm; default: service name)
Values []string `yaml:"values,omitempty"` // helm values files (renderer: helm)
Sync []DevxConfigKubernetesSync `yaml:"sync,omitempty"` // live-reload: local dirs synced into the deployed pod
PortForward bool `yaml:"port_forward,omitempty"` // auto-discover Services and forward them to localhost
}
DevxConfigServiceKubernetes configures a runtime: kubernetes service — devx renders the manifests and applies them to the target cluster (skaffold-class deploy). Cluster targeting (kubeconfig/context) falls back to KUBECONFIG, then ~/.kube/config.
type DevxConfigState ¶ added in v0.38.0
type DevxConfigState struct {
Relay string `yaml:"relay"` // Upload destination: s3://... or gs://...
}
DevxConfigState defines state sharing/replication settings.
type DevxConfigSync ¶ added in v0.28.0
type DevxConfigSync struct {
Container string `yaml:"container"` // Target container name (e.g., "my-api")
Src string `yaml:"src"` // Host source path (relative to devx.yaml)
Dest string `yaml:"dest"` // Container destination path
Ignore []string `yaml:"ignore"` // Additional ignore patterns (on top of defaults)
}
DevxConfigSync defines a host→container file sync mapping powered by Mutagen. This bypasses slow VirtioFS volume mounts for instant hot-reload.
type DevxConfigTelemetry ¶ added in v0.43.1
type DevxConfigTelemetry struct {
GrafanaURL string `yaml:"grafana_url"`
OtlpEndpoint string `yaml:"otlp_endpoint"`
}
DevxConfigTelemetry configures telemetry endpoints.
type DevxConfigTest ¶ added in v0.23.0
type DevxConfigTest struct {
UI DevxConfigTestUI `yaml:"ui"`
}
DevxConfigTest holds test configuration.
type DevxConfigTestUI ¶ added in v0.23.0
type DevxConfigTestUI struct {
Setup string `yaml:"setup"` // Pre-processing steps (e.g., migrations) to run before tests
Command string `yaml:"command"` // The actual test command to execute
}
DevxConfigTestUI defines end-to-end test orchestration settings.
type DevxConfigTunnel ¶ added in v0.2.4
type DevxConfigTunnel struct {
Name string `yaml:"name"` // Subdomain explicitly requested
Port int `yaml:"port"` // Local port to forward traffic towards
BasicAuth string `yaml:"basic_auth"` // basic auth literal value 'user:pass'
Throttle string `yaml:"throttle"` // traffic shaping profile e.g. '3g'
}
DevxConfigTunnel configures a Cloudflare tunnel to expose a local port.
Source Files
¶
- action.go
- agent.go
- agent_review.go
- agent_ship.go
- audit.go
- bridge.go
- bridge_connect.go
- bridge_disconnect.go
- bridge_intercept.go
- bridge_rbac.go
- bridge_status.go
- butane.go
- ci.go
- ci_run.go
- cloud.go
- cloud_list.go
- cloud_rm.go
- cloud_spawn.go
- cloudflare_helper.go
- cloudflared.go
- cluster_mgmt.go
- cluster_mgmt_apply.go
- cluster_mgmt_backup.go
- cluster_mgmt_destroy.go
- cluster_mgmt_doctor.go
- cluster_mgmt_init.go
- cluster_mgmt_join.go
- cluster_mgmt_reconcile.go
- cluster_mgmt_remove.go
- cluster_mgmt_status.go
- cluster_mgmt_upgrade.go
- cluster_mgmt_usb.go
- config.go
- config_pull.go
- config_push.go
- config_validate.go
- cron.go
- cron_list.go
- cron_run.go
- db.go
- db_ask.go
- db_list.go
- db_pull.go
- db_restart.go
- db_rm.go
- db_seed.go
- db_snapshot.go
- db_spawn.go
- db_synthesize.go
- debug_export.go
- devxconfig.go
- doctor.go
- exec.go
- experimental.go
- expose.go
- exposures.go
- hook.go
- init.go
- inspect.go
- k8s.go
- k8s_list.go
- k8s_rm.go
- k8s_spawn.go
- logs.go
- mail.go
- mail_list.go
- mail_rm.go
- mail_spawn.go
- map.go
- mcp.go
- mcp_doctor.go
- mcp_install.go
- mcp_list.go
- mcp_serve.go
- mcp_status.go
- mcp_uninstall.go
- mock.go
- mock_list.go
- mock_restart.go
- mock_rm.go
- mock_up.go
- nuke.go
- podman.go
- preview.go
- root.go
- run.go
- scaffold.go
- secrets.go
- shell.go
- sites.go
- ssh.go
- state.go
- state_attach.go
- state_checkpoint.go
- state_dump.go
- state_list.go
- state_restore.go
- state_rm.go
- state_share.go
- stats.go
- status.go
- sync.go
- sync_list.go
- sync_rm.go
- sync_up.go
- tailscale.go
- teardown.go
- test.go
- test_ui.go
- trace.go
- trace_dashboard.go
- trace_list.go
- trace_rm.go
- trace_spawn.go
- tunnel.go
- unexpose.go
- up.go
- update_tunnel.go
- upgrade.go
- version.go
- vm.go
- vm_autoresume.go
- vm_resize.go
- vm_sleep.go
- vm_sleepwatch.go
- webhook_catch.go