# omlahore/removemacai architecture

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

- Interactive diagram: https://gitdiagram.com/omlahore/removemacai
- Repository: https://github.com/omlahore/removemacai

## Overview

RemoveMacAI is a macOS command-line tool for switching off Apple Intelligence features, removing downloaded models, and preventing their redownload; removing its configuration profile reverts the changes. The main workflow starts in the CLI dispatcher, proceeds through feature/model selection and profile approval, then requests model removal and verifies the result. Status and feature-list commands share the catalog and system-state layer. The graph uses the provided excerpts and README; unsampled implementation details are represented only where documented, and self-test is shown as an auxiliary CLI command.

Main entry points: [`Sources/removemacai/Commands.swift`](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Commands.swift) (Command workflows), [`Sources/removemacai/main.swift`](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/main.swift) (CLI dispatcher), [`Sources/removemacai/Profile.swift`](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Profile.swift) (Configuration profile), [`Sources/removemacai/System.swift`](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/System.swift) (Model inventory and removal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli["CLI dispatcher<br/>[main.swift]"]
  node_commands["Command workflows<br/>[Commands.swift]"]
  node_terminal["Terminal I/O<br/>[Term.swift]"]
  node_selftest["Self-test<br/>[SelfTest.swift]"]
end

subgraph group_policy["Feature policy"]
  node_catalog["Feature and model catalog<br/>[Catalog.swift]"]
  node_profile["Configuration profile<br/>[Profile.swift]"]
  node_settings["Feature state<br/>[System.swift]"]
end

subgraph group_models["Model management"]
  node_models["Model inventory and removal<br/>[System.swift]"]
  node_uaf["UAF bridge<br/>[UAF.m]"]
end

subgraph group_macos["macOS integration"]
  node_assetservice["Apple asset service"]
  node_systemsettings["System Settings approval"]
  node_managedconfig["macOS profile enforcement"]
end

node_user(("User"))

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches"| node_commands
node_cli -->|"runs self-test"| node_selftest
node_cli -->|"reports errors"| node_terminal
node_commands -->|"selects features"| node_catalog
node_commands -->|"builds and checks"| node_profile
node_commands -->|"reads feature state"| node_settings
node_commands -->|"checks and removes"| node_models
node_commands -->|"prompts and reports"| node_terminal
node_commands -->|"requests confirmation"| node_user
node_commands -->|"opens for approval"| node_systemsettings
node_profile -->|"applies feature rules"| node_catalog
node_settings -->|"checks installed profile"| node_profile
node_settings -->|"reads model state"| node_models
node_models -->|"validates model sets"| node_catalog
node_models -->|"queries and resets"| node_uaf
node_uaf -->|"uses asset interface"| node_assetservice
node_systemsettings -->|"installs or removes"| node_managedconfig
node_profile -->|"configures restrictions"| node_managedconfig
node_managedconfig -->|"blocks redownloads"| node_assetservice

click node_cli "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/main.swift"
click node_commands "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Commands.swift"
click node_terminal "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Term.swift"
click node_selftest "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/SelfTest.swift"
click node_catalog "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Catalog.swift"
click node_profile "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Profile.swift"
click node_settings "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/System.swift"
click node_models "https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/System.swift"
click node_uaf "https://github.com/omlahore/removemacai/blob/main/Sources/UAF/UAF.m"

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_commands,node_terminal,node_selftest,node_user toneBlue
class node_catalog,node_profile,node_settings toneAmber
class node_models,node_uaf toneMint
class node_assetservice,node_systemsettings,node_managedconfig toneRose
```

## Components

### CLI workflow

- [CLI dispatcher](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/main.swift): `Sources/removemacai/main.swift`
- [Command workflows](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Commands.swift): `Sources/removemacai/Commands.swift`
- [Terminal I/O](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Term.swift): `Sources/removemacai/Term.swift`
- [Self-test](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/SelfTest.swift): `Sources/removemacai/SelfTest.swift`

### Feature policy

- [Feature and model catalog](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Catalog.swift): `Sources/removemacai/Catalog.swift`
- [Configuration profile](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/Profile.swift): `Sources/removemacai/Profile.swift`
- [Feature state](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/System.swift): `Sources/removemacai/System.swift`

### Model management

- [Model inventory and removal](https://github.com/omlahore/removemacai/blob/main/Sources/removemacai/System.swift): `Sources/removemacai/System.swift`
- [UAF bridge](https://github.com/omlahore/removemacai/blob/main/Sources/UAF/UAF.m): `Sources/UAF/UAF.m`

### macOS integration

- **Apple asset service**
- **System Settings approval**
- **macOS profile enforcement**

### Other components

- **User**

## Connections

- User → CLI dispatcher: runs commands (evidence: `Sources/removemacai/main.swift`)
- CLI dispatcher → Command workflows: dispatches (evidence: `Sources/removemacai/main.swift`)
- CLI dispatcher → Self-test: runs self-test (evidence: `Sources/removemacai/main.swift`)
- CLI dispatcher → Terminal I/O: reports errors (evidence: `Sources/removemacai/main.swift`)
- Command workflows → Feature and model catalog: selects features (evidence: `Sources/removemacai/Commands.swift`)
- Command workflows → Configuration profile: builds and checks (evidence: `Sources/removemacai/Commands.swift`)
- Command workflows → Feature state: reads feature state (evidence: `Sources/removemacai/Commands.swift`)
- Command workflows → Model inventory and removal: checks and removes (evidence: `Sources/removemacai/Commands.swift`)
- Command workflows → Terminal I/O: prompts and reports (evidence: `Sources/removemacai/Commands.swift`)
- Command workflows → User: requests confirmation (evidence: `README.md`)
- Command workflows → System Settings approval: opens for approval (evidence: `Sources/removemacai/Commands.swift`)
- Configuration profile → Feature and model catalog: applies feature rules (evidence: `Sources/removemacai/Profile.swift`)
- Feature state → Configuration profile: checks installed profile (evidence: `Sources/removemacai/System.swift`)
- Feature state → Model inventory and removal: reads model state (evidence: `Sources/removemacai/System.swift`)
- Model inventory and removal → Feature and model catalog: validates model sets (evidence: `Sources/removemacai/System.swift`)
- Model inventory and removal → UAF bridge: queries and resets (evidence: `Sources/removemacai/System.swift`)
- UAF bridge → Apple asset service: uses asset interface
- System Settings approval → macOS profile enforcement: installs or removes (evidence: `README.md`)
- Configuration profile → macOS profile enforcement: configures restrictions (evidence: `README.md`)
- macOS profile enforcement → Apple asset service: blocks redownloads (evidence: `README.md`)
