# skevetter/devpod architecture

> Architecture diagram of the GitHub repository skevetter/devpod, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skevetter/devpod
- Repository: https://github.com/skevetter/devpod

## Overview

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: [`cmd/root.go`](https://github.com/skevetter/devpod/blob/main/cmd/root.go) (CLI commands), [`cmd/up.go`](https://github.com/skevetter/devpod/blob/main/cmd/up.go) (Workspace cmds), [`pkg/devcontainer/config.go`](https://github.com/skevetter/devpod/blob/main/pkg/devcontainer/config.go) (Devcontainer engine), [`pkg/driver/types.go`](https://github.com/skevetter/devpod/blob/main/pkg/driver/types.go) (Drivers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_cli_go["Go CLI"]
  node_node_main["main.go<br/>go entrypoint<br/>[main.go]"]
  node_node_cmd_root["CLI commands<br/>cobra cmds<br/>[root.go]"]
  node_node_cmd_provider["Provider cmds<br/>provider ops<br/>[provider.go]"]
  node_node_cmd_workspace["Workspace cmds<br/>workspace ops<br/>[up.go]"]
  node_node_cmd_agent["Agent cmds<br/>agent runtime<br/>[agent.go]"]
  node_node_cmd_pro["Pro CLI<br/>pro overlay<br/>[pro.go]"]
end

subgraph group_group_core_go["Shared Go Core"]
  node_node_pkg_client["Client layer<br/>local client<br/>[client.go]"]
  node_node_pkg_provider["Provider model<br/>provider config<br/>[provider.go]"]
  node_node_pkg_workspace["Workspace model<br/>workspace state<br/>[workspace.go]"]
  node_node_pkg_devcontainer["Devcontainer engine<br/>devcontainer runtime<br/>[config.go]"]
  node_node_pkg_driver["Drivers<br/>[types.go]"]
  node_node_pkg_agent["Workspace agent<br/>agent runtime<br/>[agent.go]"]
  node_node_pkg_ssh_tunnel["SSH & tunnels<br/>connectivity<br/>[ssh_supported.go]"]
  node_node_pkg_credentials["Credentials<br/>secrets flows<br/>[server.go]"]
  node_node_pkg_ide["IDE layer<br/>ide integration<br/>[parse.go]"]
  node_node_pkg_daemon["Daemon<br/>local coordinator<br/>[daemon.go]"]
end

subgraph group_group_desktop["Desktop App"]
  node_node_desktop_tauri["Tauri backend<br/>native backend<br/>[main.rs]"]
  node_node_desktop_client["UI clients<br/>typed client<br/>[client.ts]"]
  node_node_desktop_ui["React app<br/>frontend ui<br/>[App.tsx]"]
end

subgraph group_group_support["Supporting Systems"]
  node_node_docs_tests["Docs & e2e<br/>validation assets<br/>[README.md]"]
end

node_node_main -->|"starts"| node_node_cmd_root
node_node_cmd_root -->|"workspace flows"| node_node_cmd_workspace
node_node_cmd_root -->|"provider flows"| node_node_cmd_provider
node_node_cmd_root -->|"uses"| node_node_pkg_client
node_node_cmd_root -->|"resolves"| node_node_pkg_workspace
node_node_cmd_provider -->|"reads/writes"| node_node_pkg_provider
node_node_cmd_workspace -->|"builds from"| node_node_pkg_devcontainer
node_node_cmd_workspace -->|"executes on"| node_node_pkg_driver
node_node_cmd_workspace -->|"attaches via"| node_node_pkg_ssh_tunnel
node_node_cmd_workspace -->|"injects"| node_node_pkg_credentials
node_node_cmd_agent -->|"implements"| node_node_pkg_agent
node_node_pkg_devcontainer -->|"selects backend"| node_node_pkg_driver
node_node_pkg_devcontainer -->|"uses"| node_node_pkg_credentials
node_node_pkg_devcontainer -->|"prepares attach"| node_node_pkg_ssh_tunnel
node_node_pkg_driver -->|"boots agent"| node_node_pkg_agent
node_node_pkg_agent -->|"serves"| node_node_pkg_ssh_tunnel
node_node_pkg_daemon -->|"served through"| node_node_pkg_client
node_node_cmd_pro -->|"overlays"| node_node_pkg_provider
node_node_cmd_pro -->|"manages"| node_node_pkg_workspace
node_node_desktop_ui -->|"calls"| node_node_desktop_client
node_node_desktop_client -->|"bridges to"| node_node_desktop_tauri
node_node_desktop_tauri -->|"controls"| node_node_pkg_daemon
node_node_desktop_ui -->|"pro surface"| node_node_cmd_pro
node_node_pkg_ide -->|"opens through"| node_node_pkg_ssh_tunnel
node_node_docs_tests -.->|"specifies"| node_node_pkg_devcontainer
node_node_docs_tests -.->|"verifies"| node_node_pkg_driver
node_node_docs_tests -.->|"covers"| node_node_pkg_ide

click node_node_main "https://github.com/skevetter/devpod/blob/main/main.go"
click node_node_cmd_root "https://github.com/skevetter/devpod/blob/main/cmd/root.go"
click node_node_cmd_provider "https://github.com/skevetter/devpod/blob/main/cmd/provider/provider.go"
click node_node_cmd_workspace "https://github.com/skevetter/devpod/blob/main/cmd/up.go"
click node_node_cmd_agent "https://github.com/skevetter/devpod/blob/main/cmd/agent/agent.go"
click node_node_pkg_client "https://github.com/skevetter/devpod/blob/main/pkg/client/client.go"
click node_node_pkg_provider "https://github.com/skevetter/devpod/blob/main/pkg/provider/provider.go"
click node_node_pkg_workspace "https://github.com/skevetter/devpod/blob/main/pkg/workspace/workspace.go"
click node_node_pkg_devcontainer "https://github.com/skevetter/devpod/blob/main/pkg/devcontainer/config.go"
click node_node_pkg_driver "https://github.com/skevetter/devpod/blob/main/pkg/driver/types.go"
click node_node_pkg_agent "https://github.com/skevetter/devpod/blob/main/pkg/agent/agent.go"
click node_node_pkg_ssh_tunnel "https://github.com/skevetter/devpod/blob/main/pkg/ssh/ssh_supported.go"
click node_node_pkg_credentials "https://github.com/skevetter/devpod/blob/main/pkg/credentials/server.go"
click node_node_pkg_ide "https://github.com/skevetter/devpod/blob/main/pkg/ide/ideparse/parse.go"
click node_node_pkg_daemon "https://github.com/skevetter/devpod/blob/main/pkg/daemon/platform/daemon.go"
click node_node_cmd_pro "https://github.com/skevetter/devpod/blob/main/cmd/pro/pro.go"
click node_node_desktop_tauri "https://github.com/skevetter/devpod/blob/main/desktop/src-tauri/src/main.rs"
click node_node_desktop_client "https://github.com/skevetter/devpod/blob/main/desktop/src/client/client.ts"
click node_node_desktop_ui "https://github.com/skevetter/devpod/blob/main/desktop/src/App/App.tsx"
click node_node_docs_tests "https://github.com/skevetter/devpod/blob/main/docs/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_main,node_node_cmd_root,node_node_cmd_provider,node_node_cmd_workspace,node_node_cmd_agent,node_node_cmd_pro toneBlue
class node_node_pkg_client,node_node_pkg_provider,node_node_pkg_workspace,node_node_pkg_devcontainer,node_node_pkg_driver,node_node_pkg_agent,node_node_pkg_ssh_tunnel,node_node_pkg_credentials,node_node_pkg_ide,node_node_pkg_daemon toneAmber
class node_node_desktop_tauri,node_node_desktop_client,node_node_desktop_ui toneMint
class node_node_docs_tests toneRose
```

## Components

### Go CLI

Command-line entrypoints and command wiring.

- [main.go](https://github.com/skevetter/devpod/blob/main/main.go): go entrypoint · CLI entrypoint. · `main.go`
- [CLI commands](https://github.com/skevetter/devpod/blob/main/cmd/root.go): cobra cmds · Top-level command wiring for workspace, provider, machine, ssh, and pro flows. · `cmd/root.go`
- [Provider cmds](https://github.com/skevetter/devpod/blob/main/cmd/provider/provider.go): provider ops · CLI surface for adding, updating, listing, and selecting providers. · `cmd/provider/provider.go`
- [Workspace cmds](https://github.com/skevetter/devpod/blob/main/cmd/up.go): workspace ops · CLI lifecycle actions such as up, stop, delete, logs, and status. · `cmd/up.go`
- [Agent cmds](https://github.com/skevetter/devpod/blob/main/cmd/agent/agent.go): agent runtime · Agent entrypoints and workspace-side bootstrapping commands. · `cmd/agent/agent.go`
- [Pro CLI](https://github.com/skevetter/devpod/blob/main/cmd/pro/pro.go): pro overlay · 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](https://github.com/skevetter/devpod/blob/main/pkg/client/client.go): local client · Abstract client implementations used by CLI and desktop to reach daemon, machine, and proxy services. · `pkg/client/client.go`
- [Provider model](https://github.com/skevetter/devpod/blob/main/pkg/provider/provider.go): provider config · Provider parsing, export, environment resolution, and pro/machine/provider metadata. · `pkg/provider/provider.go`
- [Workspace model](https://github.com/skevetter/devpod/blob/main/pkg/workspace/workspace.go): workspace state · Workspace identity, listing, image, provider, machine, and pro workspace helpers. · `pkg/workspace/workspace.go`
- [Devcontainer engine](https://github.com/skevetter/devpod/blob/main/pkg/devcontainer/config.go): devcontainer runtime · Parses devcontainer.json, resolves options, composes build/feature metadata, and prepares lifecycle setup. · `pkg/devcontainer/config.go`
- [Drivers](https://github.com/skevetter/devpod/blob/main/pkg/driver/types.go): backend drivers · Concrete infrastructure backends for Docker, Kubernetes, custom, and driver creation. · `pkg/driver/types.go`
- [Workspace agent](https://github.com/skevetter/devpod/blob/main/pkg/agent/agent.go): agent runtime · Agent-side workspace bootstrap, injection, and remote-side helpers. · `pkg/agent/agent.go`
- [SSH & tunnels](https://github.com/skevetter/devpod/blob/main/pkg/ssh/ssh_supported.go): connectivity · SSH servers/clients, port forwarding, PTY, stdio, and tunnel services used for attach and access. · `pkg/ssh/ssh_supported.go`
- [Credentials](https://github.com/skevetter/devpod/blob/main/pkg/credentials/server.go): secrets flows · Docker, Git, SSH signing, GPG forwarding, and credential server flows. · `pkg/credentials/server.go`
- [IDE layer](https://github.com/skevetter/devpod/blob/main/pkg/ide/ideparse/parse.go): ide integration · IDE detection and launch support for VS Code, JetBrains, Zed, Jupyter, RStudio, and SSH-based workflows. · `pkg/ide/ideparse/parse.go`
- [Daemon](https://github.com/skevetter/devpod/blob/main/pkg/daemon/platform/daemon.go): local coordinator · 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](https://github.com/skevetter/devpod/blob/main/desktop/src-tauri/src/main.rs): native backend · Rust backend for tray, updater, windowing, daemon lifecycle, resource watching, and command bridges. · `desktop/src-tauri/src/main.rs`
- [UI clients](https://github.com/skevetter/devpod/blob/main/desktop/src/client/client.ts): typed client · Frontend client layer that maps UI actions to workspace, provider, pro, context, and IDE operations. · `desktop/src/client/client.ts`
- [React app](https://github.com/skevetter/devpod/blob/main/desktop/src/App/App.tsx): frontend ui · 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](https://github.com/skevetter/devpod/blob/main/docs/README.md): validation assets · Documentation, examples, and end-to-end tests that encode supported workspace and provider behavior. · `docs/README.md`

## Connections

- 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.
