How skevetter/devpod works
1. What this repo is
DevPod is a client-side developer-environment manager. The core abstraction is a devcontainer.json-driven workspace that can be created on several backends: local Docker/Podman, Kubernetes, remote machines, and cloud/VM providers. There is no required central server; the client orchestrates everything.
2. Two main user-facing surfaces
The repository ships both a Go CLI (cmd/..., main.go) and a desktop app (desktop/...). They expose overlapping workspace/provider/IDE management flows, but the CLI is the direct automation surface while the desktop app adds native UI, tray, settings, and update handling.
3. Shared application core in Go
Most runtime logic lives in pkg/..., which is shared by CLI features and by the desktop backend. This core contains the provider model, workspace model, devcontainer parsing/building, SSH/tunneling, credentials handling, and platform-specific helpers. The cmd/... tree is mostly command wiring over these packages.
4. Provider layer is the backend abstraction
Providers are the key boundary for infrastructure. The repo supports built-in providers such as Docker and Kubernetes (pkg/driver/..., providers/docker, providers/kubernetes) plus a generic/custom provider path and a “pro” provider mode. Provider definitions and options are represented in YAML/typed config and then resolved into a concrete runtime backend.
5. Workspace lifecycle and devcontainer engine
Workspace creation/update/start/stop/delete flows are centered in pkg/devcontainer, pkg/workspace, and command handlers under cmd/.../workspace, cmd/up.go, cmd/stop.go, etc. This layer parses devcontainer.json, merges compose/build/feature metadata, resolves options, builds images when needed, and prepares the workspace container or machine instance.
6. Execution on the remote side uses an agent
When a workspace runs on a non-local backend, a small agent is involved (pkg/agent, cmd/agent). The agent is responsible for bootstrapping the container environment, setting up SSH access, handling async attach flows, and exposing helper services such as credentials servers. This creates the boundary between the local client and the actual workspace runtime.
7. Connectivity and interactive access
Access to a workspace is primarily through SSH and tunnels. The repo has dedicated support for SSH servers/clients, port forwarding, stdio/PTY handling, and tunnel services (pkg/ssh, pkg/pty, pkg/tunnel, pkg/ts, pkg/agent/tunnelserver). This is how terminals, file access, and forwarded ports reach the workspace from the local machine or IDE.
8. Credentials and secrets are first-class
The system has separate flows for Docker credentials, Git credentials, SSH signing, and GPG forwarding (pkg/dockercredentials, pkg/gitcredentials, pkg/gitsshsigning, pkg/gpg, pkg/credentials). These are not just utilities; they are part of workspace setup and attach so the remote environment can clone repos, sign commits, and authenticate to registries.
9. IDE integration is layered above the workspace
IDE support is handled as another abstraction (pkg/ide, cmd/ide, cmd/pro/provider/ssh.go, etc.). DevPod can open workspaces in VS Code variants, JetBrains IDEs, Zed, Jupyter, RStudio, or generic SSH-based workflows. The IDE layer consumes the same workspace/SSH/tunnel state rather than owning runtime state itself.
10. Desktop app architecture
The desktop app is a Tauri application: Rust backend (desktop/src-tauri) plus React/TypeScript frontend (desktop/src). The Rust side manages native concerns such as system tray, updater, windowing, local daemon lifecycle, file watching, and command bridges. The React side is structured around client modules, contexts, views, and shared UI components.
11. How the desktop UI talks to the core
The frontend does not directly implement backend logic; it talks through a typed client layer under desktop/src/client/... and Tauri commands. Those clients map UI actions to workspace/provider/pro/daemon operations, and the Rust backend connects them to local processes, daemon state, or filesystem resources. This keeps UI state separate from environment orchestration.
12. Local daemon and service boundaries
There is a daemon concept in both Go and Rust (pkg/daemon, cmd/pro/daemon, desktop/src-tauri/src/daemon*). It acts as the long-running local coordinator for status, networking checks, workspace watching, and cached state, especially for the desktop product. The CLI can also interact with daemon-backed functionality through client implementations in pkg/client/clientimplementation/....
13. Pro mode is an overlay, not a separate product
The cmd/pro, pkg/platform, and desktop/src/contexts/DevPodContext/Pro trees introduce Pro-specific concepts like projects, templates, clusters, and instances. Architecturally, this is a higher-level management layer sitting on top of the same provider/workspace machinery, not an entirely different runtime.
14. Supporting systems that matter to the architecture
Build and release automation is extensive (.github/workflows, goreleaser, Taskfile.yml), but operationally the important supporting pieces are the end-to-end tests in e2e/, the docs/examples that encode supported workspace patterns, and the provider manifests under providers/. Those assets define expected behavior across backends and are useful when drawing the system boundaries and flows.
15. Primary end-to-end flow to diagram
A good architecture diagram should show: user action in CLI or desktop UI → shared client/core logic → provider/workspace resolution from devcontainer.json → backend-specific execution via Docker/Kubernetes/machine/provider → agent/SSH/tunnel setup on the workspace → IDE/terminal/port forwarding back to the user. Credentials and updates sit as side flows, and Pro adds another management layer on top.
Main entry points: root.go CLI commands · up.go Workspace cmds · config.go Devcontainer engine · types.go Drivers
Components 20
Go CLI
Command-line entrypoints and command wiring.
- main.go · CLI entrypoint.
main.go - CLI commands · Top-level command wiring for workspace, provider, machine, ssh, and pro flows.
cmd/root.go - Provider cmds · CLI surface for adding, updating, listing, and selecting providers.
cmd/provider/provider.go - Workspace cmds · CLI lifecycle actions such as up, stop, delete, logs, and status.
cmd/up.go - Agent cmds · Agent entrypoints and workspace-side bootstrapping commands.
cmd/agent/agent.go - Pro CLI · Higher-level project, template, cluster, instance, and pro-provider management on top of the workspace stack.
cmd/pro/pro.go
Shared Go Core
Runtime logic reused by CLI, agent, and desktop integration.
- Client layer · Abstract client implementations used by CLI and desktop to reach daemon, machine, and proxy services.
pkg/client/client.go - Provider model · Provider parsing, export, environment resolution, and pro/machine/provider metadata.
pkg/provider/provider.go - Workspace model · Workspace identity, listing, image, provider, machine, and pro workspace helpers.
pkg/workspace/workspace.go - Devcontainer engine · Parses devcontainer.json, resolves options, composes build/feature metadata, and prepares lifecycle setup.
pkg/devcontainer/config.go - Drivers · Concrete infrastructure backends for Docker, Kubernetes, custom, and driver creation.
pkg/driver/types.go - Workspace agent · Agent-side workspace bootstrap, injection, and remote-side helpers.
pkg/agent/agent.go - SSH & tunnels · SSH servers/clients, port forwarding, PTY, stdio, and tunnel services used for attach and access.
pkg/ssh/ssh_supported.go - Credentials · Docker, Git, SSH signing, GPG forwarding, and credential server flows.
pkg/credentials/server.go - IDE layer · IDE detection and launch support for VS Code, JetBrains, Zed, Jupyter, RStudio, and SSH-based workflows.
pkg/ide/ideparse/parse.go - Daemon · Long-running local coordinator for status, networking checks, workspace watching, and cached state.
pkg/daemon/platform/daemon.go
Desktop App
Tauri backend and React frontend.
- Tauri backend · Rust backend for tray, updater, windowing, daemon lifecycle, resource watching, and command bridges.
desktop/src-tauri/src/main.rs - UI clients · Frontend client layer that maps UI actions to workspace, provider, pro, context, and IDE operations.
desktop/src/client/client.ts - React app · Views, contexts, components, and app shells for workspaces, providers, settings, and pro flows.
desktop/src/App/App.tsx
Supporting Systems
Docs, examples, and end-to-end validation assets.
- Docs & e2e · Documentation, examples, and end-to-end tests that encode supported workspace and provider behavior.
docs/README.md
Connections 27
- main.go → CLI commands: starts · CLI entrypoint dispatches into the command tree.
- CLI commands → Workspace cmds: workspace flows · Top-level commands expose workspace lifecycle actions.
- CLI commands → Provider cmds: provider flows · Top-level commands expose provider management.
- CLI commands → Client layer: uses · Commands call through shared client implementations.
- CLI commands → Workspace model: resolves · Commands operate on workspace identity and state.
- Provider cmds → Provider model: reads/writes · Provider commands manipulate provider config and selection.
- Workspace cmds → Devcontainer engine: builds from · Workspace lifecycle resolves devcontainer configuration and setup.
- Workspace cmds → Drivers: executes on · Workspace commands target a concrete backend driver.
- Workspace cmds → SSH & tunnels: attaches via · Workspace attach, terminals, and port forwarding use SSH/tunnels.
- Workspace cmds → Credentials: injects · Workspace setup includes credentials and secret forwarding.
- Agent cmds → Workspace agent: implements · Agent command surface is backed by shared agent logic.
- Devcontainer engine → Drivers: selects backend · Devcontainer resolution feeds the chosen infrastructure backend.
- Devcontainer engine → Credentials: uses · Build and attach flows need credential material and forwarding.
- Devcontainer engine → SSH & tunnels: prepares attach · Remote workspace setup ends in SSH/tunnel access.
- Drivers → Workspace agent: boots agent · Remote drivers rely on an agent-side runtime to initialize and attach.
- Workspace agent → SSH & tunnels: serves · Agent exposes SSH and tunnel services inside the workspace boundary.
- Daemon → Client layer: served through · Daemon-backed functionality is consumed via client implementations.
- Pro CLI → Provider model: overlays · Pro mode extends the provider abstraction with higher-level objects.
- Pro CLI → Workspace model: manages · Pro commands still operate on workspace lifecycle concepts.
- React app → UI clients: calls · React views use the typed client layer.
- UI clients → Tauri backend: bridges to · Frontend clients invoke Tauri commands and native services.
- Tauri backend → Daemon: controls · Native backend manages daemon lifecycle and status.
- React app → Pro CLI: pro surface · Desktop app includes the Pro management experience.
- IDE layer → SSH & tunnels: opens through · IDE attach and browser/editor workflows rely on SSH and tunnels.
- Docs & e2e → Devcontainer engine: specifies · Docs and e2e assets document supported devcontainer behavior.
- Docs & e2e → Drivers: verifies · E2E cases exercise backend provider behavior.
- Docs & e2e → IDE layer: covers · Docs and tests include IDE launch and attach patterns.