The Problem
Operating workloads across AWS, Azure, GCP, DigitalOcean, Hetzner and OVH forces teams to juggle disparate CLIs, IAM policies and cost‑tracking tools. Manual stitching leads to drift, unexpected spend and fragmented security checks.
What This Does
Sovereign Engine supplies a Go‑based control plane that abstracts each cloud into a common set of “providers”. The core CLI lives in cmd/cli/main.go and invokes the managers defined in the internal/ package:
internal/alerts/alerts.go– createsAlertManager(functionsNewAlertManager,Start,CreateAlert).internal/cleanup/cleanup.go– createsCleanupManager(functionsNewCleanupManager,Start,processCleanup).internal/finops/budget.go– provides cost‑estimation helpers (EstimateCost,GetCurrentSpend).internal/config/secure.go– encrypts/decrypts credential files (Encrypt,Decrypt,LoadSecureEnvFile).
YAML composition files under compositions/ describe concrete resources per provider (e.g. compositions/aws/compute.yaml). Dockerfiles in build/docker/ package the UI, function runtime and reverse‑proxy services.
How It Is Wired
Execution begins at main in cmd/cli/main.go:33. The entry point parses sub‑commands (deploy, list, cost, drift‑check) and routes to handlers such as handleDeploy. From there the flow is:
handleDeploy→ProcessDeployment(internal/function/handler.go:105).ProcessDeploymentcallsEstimateCost(internal/finops/budget.go).EstimateCostreaches the alert system viaNewAlertManager.Start(internal/alerts/alerts.go).Startspawns the cleanup scheduler (NewSchedulerininternal/cron/scheduler.go) and the cache (NewCacheininternal/cache/cache.go).
The most widely used symbols are:
Stop– invoked from 11 locations.NewScheduler– invoked from 10 locations.NewAlertManager– invoked from 9 locations.
These hubs sit in internal/alerts/alerts.go and internal/cron/scheduler.go; changes to them have the largest blast radius because many downstream functions depend on them. The import graph shows 8 internal modules with 17 edges and no circular dependencies, so the codebase is structurally flat, reducing the risk of hidden coupling.
External interactions are limited: the only filesystem write observed is updateSecureFile (called from main), and network calls are confined to monitoring back‑ends (e.g. Prometheus, Datadog) configured via environment variables but not hard‑wired in the static call graph.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/the-engine
cd the-engine
# Build the CLI (Makefile provides a default target)
make build # produces ./engine binary
# Generate a master key (first‑run script in README)
export ENGINE_MASTER_KEY=$(./engine generate-key)
# Encrypt cloud credentials
./engine-encrypt -key AWS_ACCESS_KEY_ID \
-value 'AKIA…' -file ~/.engine/secure.env
./engine-encrypt -key AWS_SECRET_ACCESS_KEY \
-value 'wJalrXU…' -file ~/.engine/secure.env
# Deploy a micro tier to AWS us‑east‑1
./engine deploy --provider aws --tier micro --region us-east-1
Configuration files live under compositions/ (one folder per cloud) and are referenced automatically by the CLI. Optional monitoring and CI/CD integrations are selected with environment variables such as MONITORING_SYSTEM=prometheus or CICD_SYSTEM=github as documented in the README.
Real‑World Use
A SaaS team runs the binary in a CI job that provisions a temporary test environment for each pull request. The CleanupManager automatically shuts down idle dev stacks after 8 h and nukes them after 24 h, while the AlertManager posts cost warnings to a Slack webhook when spend exceeds 80 % of the configured budget. This prevents runaway resources and gives developers immediate feedback.
Code Health & Issues
- HIGH – GitHub Actions pinned to mutable tags (
aquasecurity/trivy-action@master, etc.). - HIGH – No LICENSE file; redistribution rights are undefined.
- MEDIUM – Base image
golang:1.26-alpinenot pinned by digest. - MEDIUM – Generated build output (
build/) committed to VCS. - MEDIUM – Checkout step keeps token (
persist-credentialsnot disabled). - MEDIUM – Container runs as root; no non‑root USER defined.
- LOW – Workflow jobs lack
timeout-minutes. - LOW – Repository missing convention files (
.editorconfig, formatter config).
Static analysis also flagged deep nesting (max depth 9) in internal/docs/swagger.go and internal/cleanup/*, duplicated cleanup code across several provider‑specific files, and high branching density in internal/cleanup/rules.go. These patterns increase cognitive load and maintenance cost.
The Bottom Line
Sovereign Engine delivers a concrete multi‑cloud provisioning CLI with built‑in cost alerts and automated cleanup, backed by a clear Go module structure. It is usable out‑of‑the‑box but requires hygiene work (license, pinned actions, non‑root containers) and some refactoring to reduce complexity in the cleanup subsystem. Teams comfortable with Go and Kubernetes will find it a solid foundation for controlled, cost‑aware cloud deployments.