# jskswamy/aide architecture

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

- Interactive diagram: https://gitdiagram.com/jskswamy/aide
- Repository: https://github.com/jskswamy/aide

## Overview

aide is a CLI that selects a coding agent and project context, prepares credentials and capabilities, applies OS-native sandboxing, then hands off execution. The README also describes provisioning, gateway configuration, live session status, and redacted diagnostics as product features. The graph preserves those branches; sampled source confirms the CLI entry point and key implementation modules, while some subsystem connections are documented only in the README, noted as evidence rather than inferred from imports.

Main entry points: [`internal/launcher/launcher.go`](https://github.com/jskswamy/aide/blob/main/internal/launcher/launcher.go) (Agent launcher), [`internal/config/config.go`](https://github.com/jskswamy/aide/blob/main/internal/config/config.go) (Profiles and config), [`internal/sandbox/linux.go`](https://github.com/jskswamy/aide/blob/main/internal/sandbox/linux.go) (OS sandbox), [`cmd/aide/main.go`](https://github.com/jskswamy/aide/blob/main/cmd/aide/main.go) (aide CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and context"]
  node_cli["aide CLI<br/>[main.go]"]
  node_context["Context resolution<br/>[resolver.go]"]
  node_launcher["Agent launcher<br/>[launcher.go]"]
end

subgraph group_security["Sandbox and capabilities"]
  node_capabilities["Capabilities<br/>[builtin.go]"]
  node_sandbox["OS sandbox<br/>[linux.go]"]
  node_seatbelt["Seatbelt profiles<br/>[profile.go]"]
end

subgraph group_config["Configuration and gateways"]
  node_config["Profiles and config<br/>[config.go]"]
  node_gateway["Gateway settings<br/>[gateway.go]"]
  node_gateway_files["Harness gateway files<br/>[writers.go]"]
  node_secrets["Secret protection<br/>[envscrub.go]"]
end

subgraph group_provision["Provisioning"]
  node_provision["Agent provisioning<br/>[engine.go]"]
end

subgraph group_visibility["Session and diagnostics"]
  node_status["Statusline<br/>[statusline.go]"]
  node_session_env["Session environment<br/>[preview.go]"]
  node_diagnostics["Diagnostics reports<br/>[collector.go]"]
end

node_user(("User"))
node_agent["Coding agent"]

node_user -->|"invokes"| node_cli
node_cli -->|"launches"| node_launcher
node_launcher -->|"hands off"| node_agent
node_launcher -.->|"resolves context"| node_context
node_context -->|"reads profiles"| node_config
node_launcher -->|"enforces sandbox"| node_sandbox
node_capabilities -->|"grants scoped access"| node_sandbox
node_sandbox -->|"uses on macOS"| node_seatbelt
node_launcher -.->|"scrubs environment"| node_secrets
node_config -->|"defines gateways"| node_gateway
node_gateway -.->|"configures harnesses"| node_gateway_files
node_user -->|"syncs agents"| node_provision
node_config -->|"declares plugin set"| node_provision
node_launcher -->|"sets session state"| node_session_env
node_user -->|"installs statusline"| node_status
node_launcher -->|"collects failure data"| node_diagnostics

click node_cli "https://github.com/jskswamy/aide/blob/main/cmd/aide/main.go"
click node_context "https://github.com/jskswamy/aide/blob/main/internal/context/resolver.go"
click node_launcher "https://github.com/jskswamy/aide/blob/main/internal/launcher/launcher.go"
click node_capabilities "https://github.com/jskswamy/aide/blob/main/internal/capability/builtin.go"
click node_sandbox "https://github.com/jskswamy/aide/blob/main/internal/sandbox/linux.go"
click node_seatbelt "https://github.com/jskswamy/aide/blob/main/pkg/seatbelt/profile.go"
click node_config "https://github.com/jskswamy/aide/blob/main/internal/config/config.go"
click node_gateway "https://github.com/jskswamy/aide/blob/main/internal/config/gateway.go"
click node_gateway_files "https://github.com/jskswamy/aide/blob/main/internal/gateway/writers.go"
click node_secrets "https://github.com/jskswamy/aide/blob/main/internal/envscrub/envscrub.go"
click node_provision "https://github.com/jskswamy/aide/blob/main/internal/provision/engine.go"
click node_status "https://github.com/jskswamy/aide/blob/main/cmd/aide/statusline.go"
click node_session_env "https://github.com/jskswamy/aide/blob/main/internal/launcher/preview.go"
click node_diagnostics "https://github.com/jskswamy/aide/blob/main/internal/diag/collector.go"

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_context,node_launcher,node_user toneBlue
class node_capabilities,node_sandbox,node_seatbelt toneAmber
class node_config,node_gateway,node_gateway_files,node_secrets toneMint
class node_provision toneRose
class node_status,node_session_env,node_diagnostics,node_agent toneIndigo
```

## Components

### Launch and context

- [aide CLI](https://github.com/jskswamy/aide/blob/main/cmd/aide/main.go): `cmd/aide/main.go`
- [Context resolution](https://github.com/jskswamy/aide/blob/main/internal/context/resolver.go): `internal/context/resolver.go`
- [Agent launcher](https://github.com/jskswamy/aide/blob/main/internal/launcher/launcher.go): `internal/launcher/launcher.go`

### Sandbox and capabilities

- [Capabilities](https://github.com/jskswamy/aide/blob/main/internal/capability/builtin.go): `internal/capability/builtin.go`
- [OS sandbox](https://github.com/jskswamy/aide/blob/main/internal/sandbox/linux.go): `internal/sandbox/linux.go`
- [Seatbelt profiles](https://github.com/jskswamy/aide/blob/main/pkg/seatbelt/profile.go): `pkg/seatbelt/profile.go`

### Configuration and gateways

- [Profiles and config](https://github.com/jskswamy/aide/blob/main/internal/config/config.go): `internal/config/config.go`
- [Gateway settings](https://github.com/jskswamy/aide/blob/main/internal/config/gateway.go): `internal/config/gateway.go`
- [Harness gateway files](https://github.com/jskswamy/aide/blob/main/internal/gateway/writers.go): `internal/gateway/writers.go`
- [Secret protection](https://github.com/jskswamy/aide/blob/main/internal/envscrub/envscrub.go): `internal/envscrub/envscrub.go`

### Provisioning

- [Agent provisioning](https://github.com/jskswamy/aide/blob/main/internal/provision/engine.go): `internal/provision/engine.go`

### Session and diagnostics

- [Statusline](https://github.com/jskswamy/aide/blob/main/cmd/aide/statusline.go): `cmd/aide/statusline.go`
- [Session environment](https://github.com/jskswamy/aide/blob/main/internal/launcher/preview.go): `internal/launcher/preview.go`
- [Diagnostics reports](https://github.com/jskswamy/aide/blob/main/internal/diag/collector.go): `internal/diag/collector.go`

### Other components

- **User**
- **Coding agent**

## Connections

- User → aide CLI: invokes
- aide CLI → Agent launcher: launches (evidence: `cmd/aide/main.go`)
- Agent launcher → Coding agent: hands off
- Agent launcher → Context resolution: resolves context
- Context resolution → Profiles and config: reads profiles (evidence: `internal/context/resolver.go`)
- Agent launcher → OS sandbox: enforces sandbox
- Capabilities → OS sandbox: grants scoped access
- OS sandbox → Seatbelt profiles: uses on macOS
- Agent launcher → Secret protection: scrubs environment
- Profiles and config → Gateway settings: defines gateways
- Gateway settings → Harness gateway files: configures harnesses
- User → Agent provisioning: syncs agents
- Profiles and config → Agent provisioning: declares plugin set
- Agent launcher → Session environment: sets session state
- User → Statusline: installs statusline
- Agent launcher → Diagnostics reports: collects failure data
