Add Go CLI to improve developer experience#11
Merged
jcardozo-eth merged 35 commits intomainfrom Feb 11, 2026
Merged
Conversation
Add styles.go with ETH brand colors, semantic color aliases, and lipgloss styles for consistent CLI output. Includes NO_COLOR env var support, TTY detection on stderr, and adaptive colors for terminal accessibility.
Add root.go defining the main dap CLI entry point. Registers command groups (Development, Environment, Dagster, Kubernetes, CLI Development) and wires up subcommands from dev, env, dagster, k8s, and meta packages. Includes --no-color global flag.
Replace just commands with dap CLI equivalents. Update prerequisites to include Go, add CLI build instructions, and document all dap commands. Add .cli/ to project structure overview.
Add tests for: - ui/styles: color functions, TTY detection, CI detection - ui/output: Title, Info, Success, Error, Warning output functions - cmd/root: command groups, subcommand registration, flag parsing - cmd/dev: command count, GroupID, individual command properties - internal/exec: RunPassthrough execution
Add dap-cli flake as input and include the dap binary in devShell. Adds Go and gomod2nix for CLI development. Replaces just with dap.
Delegate Python setup to .dev/scripts/uv-sync.sh and welcome banner to dap welcome command. Cleaner shell initialization.
Enables direct access without port-forwarding for local k8s development.
Add main.go entry point, go.mod/sum for dependencies. Internal packages: - exec: RunPassthrough for subprocess execution with live output - ui: Title, Info, Success, Error, Warning output functions
Commands for Python development workflow: - check: run all quality checks (lint + typecheck + test) - dev: start Dagster development server - lint: check/fix code style with Ruff - test: run pytest test suite - typecheck: run mypy type checking
Commands for development environment: - clean: remove .venv and Python caches - reset: clean and reinstall dependencies - versions: show tool versions (Python, uv, Go, kubectl, helm) - welcome: display project banner and quick start info
Commands for Dagster orchestration: - materialize: materialize all Dagster assets - run: execute the ingest_sip_job pipeline
Commands for local Kubernetes development: - up: build image and deploy with Helm - down: tear down deployment - restart: rebuild and restart user code pod - status: show pods and services - logs: stream logs from user code pod - shell: open shell in user code pod
Commands for maintaining the Go CLI itself: - go test: run Go tests for the CLI - go build: build the dap binary - go fmt: format Go source code
Add flake.nix and package.nix for building dap with Nix. Uses gomod2nix for reproducible Go dependency management.
Document CLI architecture, development workflow, testing, and coding conventions for contributors.
Simple wrapper that checks for uv and runs sync with dev extras. Called by .envrc during shell initialization.
All commands migrated to the Go-based dap CLI.
- Shorten description to "Development tooling for the DAP Orchestrator" - Fix homepage URL to correct repository - Change license from MIT to Apache 2.0
The dot prefix conventionally means hidden/infrastructure. Since this is source code, rename to cli/ and update all references in flake.nix, .gitignore, .pre-commit-config.yaml, README, CONTRIBUTING, and Go source.
Include the built dap binary in the cli-dev shell so that `dap cli test` works during CLI development and in CI.
Add version/commit/date variables via ldflags so `dap --version` reports the correct version when built through Nix or goreleaser.
Runs Go tests and linting (go vet, gofmt) inside Nix for environment parity. Triggers only on cli/** changes.
Skip pipeline CI on CLI-only changes via paths-ignore.
Cross-compile the CLI for linux/darwin (amd64/arm64) on cli/v* tags. Tests run in Nix for parity; goreleaser uses raw Go for cross-compilation.
Runs go vet and gofmt checks. Replaces inline shell scripts in CI with a single command for consistency with dap cli test/build.
Replace fragile directory-walking logic with a single call to `git rev-parse --show-toplevel`. Always returns an absolute path.
Add --fix mode that runs `gofmt -w` to auto-fix formatting before vet. Extract inCliDir(), goVet(), repoRoot() helpers to DRY up the repeated findCliDir+chdir pattern across build/test/lint commands. Fix nix build to explicitly chdir to repo root so `dap cli build` works from any directory.
Update `dap go test/build` references to `dap cli test/build/lint`. Add Linting section documenting --fix flag. Expand Building section with step-by-step explanation of the Nix build chain.
Nix no longer injects a version via ldflags, so the binary uses the default "dev" from version.go. Release builds get the real version injected by GoReleaser from the git tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Go CLI to replace justfile and improve developer experience
Summary
As the justfile grew, its shell recipes became difficult to read, debug, and maintain — shell is the wrong language for non-trivial logic like conditional deployments, health checks, or environment validation. This PR replaces the justfile with
dap, a purpose-built CLI written in Go where each command is real, structured code that developers can read, step through, and reason about. Because the CLI is proper software — unit-tested, linted, statically typed — the developer tooling can now be maintained to the same standard as production code.What changed
The CLI itself
A new
cli/directory contains the full Go source for thedapbinary, built on Cobra with terminal styling via Lipgloss. Commands are organized into five groups:dev,test,check,lint,typecheckversions,clean,reset,welcomematerialize,runk8s up/down/restart/status/logs/shellcli build/test/lintlintsupports--fixfor auto-fixing)Two internal packages support all commands:
internal/ui— terminal output styled with the ETH corporate design color palette, with adaptive light/dark terminal support vialipgloss.AdaptiveColor. Output degrades gracefully: in a TTY you get full colors and an ASCII artDAP-Obanner; in CI or piped output, colors are disabled automatically and the banner falls back to a plain text one-liner. Supports theNO_COLORstandard and a global--no-colorflag.internal/exec— thin wrapper aroundos/execprovidingRun,RunInteractive,RunPassthrough, andWhichhelpersNix integration
nix developshell is replaced by four purpose-built shells —default(everything),minimal(Python + CLI),k8s(adds kubectl/helm), andcli-dev(adds Go toolchain). CI pipelines can use smaller shells for faster startup.cli/flake.nixuses gomod2nix to build the CLI hermetically. The root flake composes it as a flake input and exposesdapin all devShells..envrc: The 37-line.envrcwith inline bash for venv creation, dependency sync, and a hand-rolled welcome banner is replaced by 19 lines that delegate todap welcomeand a smalluv-sync.shscript.CI/CD
.github/workflows/cli.yml): Runsdap cli testanddap cli linton pushes/PRs touchingcli/..github/workflows/release.yml): Triggers oncli/v*tags, runs tests, then builds cross-platform binaries (linux/darwin, amd64/arm64) via GoReleaser.cli/**changes to avoid unnecessary Python test runs..pre-commit-config.yamlwith trailing-whitespace, ruff lint/format, and automaticgomod2nix.tomlregeneration whengo.mod/go.sumchange.Removed
justfile(213 lines) — fully replaced by the CLI.justdependency fromflake.nix— no longer needed.jq,curl,openssldependencies — version-check functions that shelled out to these tools are replaced by native Go equivalents. Password generation for K8s secrets now usescrypto/randinstead ofopenssl rand.Docs
cli/CONTRIBUTING.md— comprehensive guide covering project structure, adding commands, UI guidelines, error handling, testing, linting, building, and the Nix build chain.README.md— all command references updated fromjusttodap, devShell table added, project structure updated to showcli/, tooling section updated.Why Go?
go test. Linting usesgo vetandgofmt.dap --versionwith version, commit, and build date injected at compile time viago build -ldflags.nix developornix build .#dap) or downloaded as a pre-built binary from GitHub releases.Why this matters for onboarding and daily work
Onboarding friction typically comes from two places: setting up the environment and discovering what commands exist. This branch eliminates both.
nix developprovides a complete, reproducible environment with Python, uv, Go, all linters and formatters included — nothing to install manually. ThedapCLI organizes every development task into discoverable command groups with built-in documentation. Contributing new tooling means writing Go with tests, not appending shell scripts. The Nix-based setup also prepares the project for GitHub Codespaces, where the same dev environment can be replicated in the cloud with zero additional configuration.Appendix
dap welcome(TTY)dap --help