cmd

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DryRun bool
View Source
var NonInteractive bool

Functions

func Execute

func Execute()

func GenerateMermaid added in v0.25.0

func GenerateMermaid(cfg DevxConfig) string

GenerateMermaid produces a Mermaid flowchart string from a DevxConfig.

Types

type DevxConfig added in v0.2.4

type DevxConfig struct {
	Name      string                       `yaml:"name"`      // Project name
	Domain    string                       `yaml:"domain"`    // Custom domain (BYOD)
	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
}

type DevxConfigDatabase added in v0.4.1

type DevxConfigDatabase struct {
	Engine string `yaml:"engine"`
	Port   int    `yaml:"port"`
}

type DevxConfigDependsOn added in v0.25.0

type DevxConfigDependsOn struct {
	Name      string `yaml:"name"`
	Condition string `yaml:"condition"` // "service_healthy" or "service_started"
}

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 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 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"`
}

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"
	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
}

DevxConfigService defines a developer application in devx.yaml.

type DevxConfigTest added in v0.23.0

type DevxConfigTest struct {
	UI DevxConfigTestUI `yaml:"ui"`
}

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
}

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'
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL