# krivson/devkit architecture

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

- Interactive diagram: https://gitdiagram.com/krivson/devkit
- Repository: https://github.com/krivson/devkit

## Overview

DevKit is a non-interactive macOS developer command center. Users invoke diagnostics or explicit operations through the CLI; the registry dispatches to command handlers, which collect host/network/process data or perform guarded actions, then present results. Major documented capabilities include system and macOS inspection, VPN, Git, SSH, OpenCode, cleanup, and local snapshots. The sampled code confirms CLI dispatch, network diagnostics, process inspection, snapshots, system data, configuration, and subprocess execution; unsampled command internals are represented from documented command scope, without inferred call links.

Main entry points: [`src/devkit/core/registry.py`](https://github.com/krivson/devkit/blob/main/src/devkit/core/registry.py) (Command registry), [`src/devkit/runner.py`](https://github.com/krivson/devkit/blob/main/src/devkit/runner.py) (Safe command runner), [`src/devkit/commands/doctor.py`](https://github.com/krivson/devkit/blob/main/src/devkit/commands/doctor.py) (Environment health), [`src/devkit/commands/network.py`](https://github.com/krivson/devkit/blob/main/src/devkit/commands/network.py) (Network diagnostics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI dispatch"]
  node_cli["Command-line entry<br/>[cli.py]"]
  node_registry["Command registry<br/>[registry.py]"]
end

subgraph group_diagnostics["Host diagnostics"]
  node_doctor["Environment health<br/>[doctor.py]"]
  node_systemcmd["System summary<br/>[system.py]"]
  node_maccmd["macOS details<br/>[mac.py]"]
  node_networkcmd["Network diagnostics<br/>[network.py]"]
end

subgraph group_operations["Developer operations"]
  node_vpncmd["VPN actions<br/>[vpn.py]"]
  node_gitcmd["Git inspection<br/>[git.py]"]
  node_sshcmd["SSH inspection<br/>[ssh.py]"]
  node_processcmd["Process and ports<br/>[process.py]"]
  node_cleanupcmd["Project cleanup<br/>[cleanup.py]"]
  node_opencodecmd["OpenCode actions<br/>[opencode.py]"]
  node_snapshotcmd["Snapshot actions<br/>[snapshot.py]"]
end

subgraph group_platform["Platform services"]
  node_systeminfo["Host information<br/>[system.py]"]
  node_networkservice["Network intelligence<br/>[network.py]"]
  node_vpnservice["VPN control<br/>[vpn.py]"]
  node_snapshotstore[("Local snapshots<br/>[snapshot.py]")]
end

subgraph group_shared["Shared runtime"]
  node_config[("User configuration<br/>[config.py]")]
  node_runner["Safe command runner<br/>[runner.py]"]
  node_logger["Console and logs<br/>[logger.py]"]
end

node_developer(("Developer"))

node_developer -->|"invokes"| node_cli
node_cli -->|"resolves command"| node_registry
node_registry -->|"registers"| node_doctor
node_registry -->|"registers"| node_systemcmd
node_registry -->|"registers"| node_maccmd
node_registry -->|"registers"| node_networkcmd
node_registry -->|"registers"| node_vpncmd
node_registry -->|"registers"| node_gitcmd
node_registry -->|"registers"| node_sshcmd
node_registry -->|"registers"| node_processcmd
node_registry -->|"registers"| node_cleanupcmd
node_registry -->|"registers"| node_opencodecmd
node_registry -->|"registers"| node_snapshotcmd
node_systemcmd -->|"collects"| node_systeminfo
node_networkcmd -->|"queries"| node_networkservice
node_vpncmd -->|"controls"| node_vpnservice
node_snapshotcmd -->|"reads and writes"| node_snapshotstore
node_doctor -->|"checks config"| node_config
node_vpnservice -->|"loads settings"| node_config
node_doctor -->|"runs checks"| node_runner
node_gitcmd -->|"runs commands"| node_runner
node_maccmd -->|"runs commands"| node_runner
node_sshcmd -->|"runs commands"| node_runner
node_opencodecmd -->|"runs commands"| node_runner
node_vpnservice -->|"runs scutil"| node_runner
node_networkcmd -->|"reports findings"| node_logger
node_processcmd -->|"reports results"| node_logger

click node_cli "https://github.com/krivson/devkit/blob/main/src/devkit/cli.py"
click node_registry "https://github.com/krivson/devkit/blob/main/src/devkit/core/registry.py"
click node_doctor "https://github.com/krivson/devkit/blob/main/src/devkit/commands/doctor.py"
click node_systemcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/system.py"
click node_systeminfo "https://github.com/krivson/devkit/blob/main/src/devkit/services/system.py"
click node_maccmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/mac.py"
click node_networkcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/network.py"
click node_networkservice "https://github.com/krivson/devkit/blob/main/src/devkit/services/network.py"
click node_vpncmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/vpn.py"
click node_vpnservice "https://github.com/krivson/devkit/blob/main/src/devkit/services/vpn.py"
click node_gitcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/git.py"
click node_sshcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/ssh.py"
click node_processcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/process.py"
click node_cleanupcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/cleanup.py"
click node_opencodecmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/opencode.py"
click node_snapshotcmd "https://github.com/krivson/devkit/blob/main/src/devkit/commands/snapshot.py"
click node_snapshotstore "https://github.com/krivson/devkit/blob/main/src/devkit/core/snapshot.py"
click node_config "https://github.com/krivson/devkit/blob/main/src/devkit/core/config.py"
click node_runner "https://github.com/krivson/devkit/blob/main/src/devkit/runner.py"
click node_logger "https://github.com/krivson/devkit/blob/main/src/devkit/logger.py"

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_cli,node_registry toneBlue
class node_doctor,node_systemcmd,node_maccmd,node_networkcmd toneAmber
class node_vpncmd,node_gitcmd,node_sshcmd,node_processcmd,node_cleanupcmd,node_opencodecmd,node_snapshotcmd toneMint
class node_systeminfo,node_networkservice,node_vpnservice,node_snapshotstore toneRose
class node_config,node_runner,node_logger,node_developer toneIndigo
```

## Components

### CLI dispatch

- [Command-line entry](https://github.com/krivson/devkit/blob/main/src/devkit/cli.py): `src/devkit/cli.py`
- [Command registry](https://github.com/krivson/devkit/blob/main/src/devkit/core/registry.py): `src/devkit/core/registry.py`

### Host diagnostics

- [Environment health](https://github.com/krivson/devkit/blob/main/src/devkit/commands/doctor.py): `src/devkit/commands/doctor.py`
- [System summary](https://github.com/krivson/devkit/blob/main/src/devkit/commands/system.py): `src/devkit/commands/system.py`
- [macOS details](https://github.com/krivson/devkit/blob/main/src/devkit/commands/mac.py): `src/devkit/commands/mac.py`
- [Network diagnostics](https://github.com/krivson/devkit/blob/main/src/devkit/commands/network.py): `src/devkit/commands/network.py`

### Developer operations

- [VPN actions](https://github.com/krivson/devkit/blob/main/src/devkit/commands/vpn.py): `src/devkit/commands/vpn.py`
- [Git inspection](https://github.com/krivson/devkit/blob/main/src/devkit/commands/git.py): `src/devkit/commands/git.py`
- [SSH inspection](https://github.com/krivson/devkit/blob/main/src/devkit/commands/ssh.py): `src/devkit/commands/ssh.py`
- [Process and ports](https://github.com/krivson/devkit/blob/main/src/devkit/commands/process.py): `src/devkit/commands/process.py`
- [Project cleanup](https://github.com/krivson/devkit/blob/main/src/devkit/commands/cleanup.py): `src/devkit/commands/cleanup.py`
- [OpenCode actions](https://github.com/krivson/devkit/blob/main/src/devkit/commands/opencode.py): `src/devkit/commands/opencode.py`
- [Snapshot actions](https://github.com/krivson/devkit/blob/main/src/devkit/commands/snapshot.py): `src/devkit/commands/snapshot.py`

### Platform services

- [Host information](https://github.com/krivson/devkit/blob/main/src/devkit/services/system.py): `src/devkit/services/system.py`
- [Network intelligence](https://github.com/krivson/devkit/blob/main/src/devkit/services/network.py): `src/devkit/services/network.py`
- [VPN control](https://github.com/krivson/devkit/blob/main/src/devkit/services/vpn.py): `src/devkit/services/vpn.py`
- [Local snapshots](https://github.com/krivson/devkit/blob/main/src/devkit/core/snapshot.py): `src/devkit/core/snapshot.py`

### Shared runtime

- [User configuration](https://github.com/krivson/devkit/blob/main/src/devkit/core/config.py): `src/devkit/core/config.py`
- [Safe command runner](https://github.com/krivson/devkit/blob/main/src/devkit/runner.py): `src/devkit/runner.py`
- [Console and logs](https://github.com/krivson/devkit/blob/main/src/devkit/logger.py): `src/devkit/logger.py`

### Other components

- **Developer**

## Connections

- Developer → Command-line entry: invokes (evidence: `README.md`)
- Command-line entry → Command registry: resolves command (evidence: `src/devkit/cli.py`)
- Command registry → Environment health: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → System summary: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → macOS details: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → Network diagnostics: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → VPN actions: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → Git inspection: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → SSH inspection: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → Process and ports: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → Project cleanup: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → OpenCode actions: registers (evidence: `src/devkit/core/registry.py`)
- Command registry → Snapshot actions: registers (evidence: `src/devkit/core/registry.py`)
- System summary → Host information: collects (evidence: `src/devkit/commands/system.py`)
- Network diagnostics → Network intelligence: queries (evidence: `src/devkit/commands/network.py`)
- VPN actions → VPN control: controls (evidence: `src/devkit/commands/vpn.py`)
- Snapshot actions → Local snapshots: reads and writes (evidence: `src/devkit/commands/snapshot.py`)
- Environment health → User configuration: checks config (evidence: `src/devkit/commands/doctor.py`)
- VPN control → User configuration: loads settings (evidence: `src/devkit/services/vpn.py`)
- Environment health → Safe command runner: runs checks (evidence: `src/devkit/commands/doctor.py`)
- Git inspection → Safe command runner: runs commands (evidence: `src/devkit/commands/git.py`)
- macOS details → Safe command runner: runs commands (evidence: `src/devkit/commands/mac.py`)
- SSH inspection → Safe command runner: runs commands (evidence: `src/devkit/commands/ssh.py`)
- OpenCode actions → Safe command runner: runs commands (evidence: `src/devkit/commands/opencode.py`)
- VPN control → Safe command runner: runs scutil (evidence: `src/devkit/services/vpn.py`)
- Network diagnostics → Console and logs: reports findings (evidence: `src/devkit/commands/network.py`)
- Process and ports → Console and logs: reports results (evidence: `src/devkit/commands/process.py`)
