# github-for-unity/unity architecture

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

- Interactive diagram: https://gitdiagram.com/github-for-unity/unity
- Repository: https://github.com/github-for-unity/unity

## Overview

GitHub for Unity is a Unity extension for Git and GitHub source-control workflows. Its principal runtime path is application setup, repository management, Git command execution, and process interaction; authentication and GitHub API access support the GitHub side. The tree also contains an octorun CLI with login and other app commands. The excerpts establish several orchestration and execution links, but do not show Unity UI wiring or most CLI command implementations, so those connections are omitted rather than inferred.

Main entry points: [`src/GitHub.Api/Application/ApplicationManagerBase.cs`](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Application/ApplicationManagerBase.cs) (Application manager), [`src/GitHub.Api/Git/RepositoryManager.cs`](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/RepositoryManager.cs) (Repository manager), [`src/GitHub.Api/Process/ProcessManager.cs`](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Process/ProcessManager.cs) (Process manager), [`octorun/src/bin/app-login.js`](https://github.com/github-for-unity/unity/blob/master/octorun/src/bin/app-login.js) (CLI login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and GitHub"]
  node_appmanager["Application manager"]
  node_apiclient["GitHub API client<br/>[ApiClient.cs]"]
  node_login["Login manager<br/>[LoginManager.cs]"]
  node_keychain["Credential keychain<br/>[Keychain.cs]"]
end

subgraph group_repo["Repository and Git"]
  node_repositorymgr["Repository manager"]
  node_repository["Repository model<br/>[Repository.cs]"]
  node_watcher["Repository watcher"]
  node_gitclient["Git client<br/>[GitClient.cs]"]
end

subgraph group_runtime["Runtime foundations"]
  node_installer["Git installer<br/>[GitInstaller.cs]"]
  node_taskmanager["Task manager<br/>[TaskManager.cs]"]
  node_procesmanager["Process manager<br/>[ProcessManager.cs]"]
  node_environment["Platform environment"]
  node_filesystem["File system<br/>[FileSystem.cs]"]
  node_logging["Logging<br/>[LogHelper.cs]"]
end

subgraph group_cli["Octorun CLI"]
  node_octorun["Octorun command<br/>[app.js]"]
  node_cli_login["CLI login<br/>[app-login.js]"]
  node_cli_api["CLI API access<br/>[api.js]"]
  node_cli_auth["CLI authentication<br/>[authentication.js]"]
  node_octokit["Octokit client<br/>[octokit.js]"]
  node_cli_commands["Other CLI commands"]
end

node_unity(("Unity user"))
node_github{{"GitHub service"}}
node_git{{"Git executable"}}

node_unity -.->|"uses"| node_appmanager
node_appmanager -->|"creates"| node_repositorymgr
node_appmanager -->|"uses"| node_installer
node_appmanager -->|"uses"| node_taskmanager
node_appmanager -.->|"uses"| node_apiclient
node_login -->|"stores credentials"| node_keychain
node_login -.->|"authenticates"| node_github
node_apiclient -.->|"requests API"| node_github
node_repositorymgr -->|"starts and stops"| node_watcher
node_repositorymgr -->|"dispatches Git tasks"| node_gitclient
node_repositorymgr -.->|"uses model"| node_repository
node_gitclient -->|"configures tasks"| node_procesmanager
node_procesmanager -->|"runs commands"| node_git
node_appmanager -->|"uses"| node_environment
node_procesmanager -->|"reads paths"| node_environment
node_procesmanager -->|"searches executables"| node_filesystem
node_repositorymgr -.->|"schedules tasks"| node_taskmanager
node_octorun -.->|"dispatches commands"| node_cli_login
node_cli_login -->|"calls authentication"| node_cli_auth
node_cli_login -->|"writes output"| node_octokit
node_cli_auth -->|"uses client"| node_octokit
node_cli_api -->|"uses client"| node_octokit
node_octorun -.->|"offers commands"| node_cli_commands

click node_appmanager "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Application/ApplicationManagerBase.cs"
click node_apiclient "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Application/ApiClient.cs"
click node_login "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Authentication/LoginManager.cs"
click node_keychain "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Authentication/Keychain.cs"
click node_repositorymgr "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/RepositoryManager.cs"
click node_repository "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/Repository.cs"
click node_watcher "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Events/RepositoryWatcher.cs"
click node_gitclient "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/GitClient.cs"
click node_installer "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Installer/GitInstaller.cs"
click node_taskmanager "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Tasks/TaskManager.cs"
click node_procesmanager "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Process/ProcessManager.cs"
click node_environment "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Platform/DefaultEnvironment.cs"
click node_filesystem "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/IO/FileSystem.cs"
click node_logging "https://github.com/github-for-unity/unity/blob/master/src/GitHub.Logging/LogHelper.cs"
click node_octorun "https://github.com/github-for-unity/unity/blob/master/octorun/src/bin/app.js"
click node_cli_login "https://github.com/github-for-unity/unity/blob/master/octorun/src/bin/app-login.js"
click node_cli_api "https://github.com/github-for-unity/unity/blob/master/octorun/src/api.js"
click node_cli_auth "https://github.com/github-for-unity/unity/blob/master/octorun/src/authentication.js"
click node_octokit "https://github.com/github-for-unity/unity/blob/master/octorun/src/octokit.js"
click node_cli_commands "https://github.com/github-for-unity/unity/tree/master/octorun/src/bin"

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_appmanager,node_apiclient,node_login,node_keychain,node_unity toneBlue
class node_repositorymgr,node_repository,node_watcher,node_gitclient toneAmber
class node_installer,node_taskmanager,node_procesmanager,node_environment,node_filesystem,node_logging toneMint
class node_octorun,node_cli_login,node_cli_api,node_cli_auth,node_octokit,node_cli_commands toneRose
class node_github,node_git toneIndigo
```

## Components

### Application and GitHub

- [Application manager](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Application/ApplicationManagerBase.cs): `src/GitHub.Api/Application/ApplicationManagerBase.cs`
- [GitHub API client](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Application/ApiClient.cs): `src/GitHub.Api/Application/ApiClient.cs`
- [Login manager](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Authentication/LoginManager.cs): `src/GitHub.Api/Authentication/LoginManager.cs`
- [Credential keychain](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Authentication/Keychain.cs): `src/GitHub.Api/Authentication/Keychain.cs`

### Repository and Git

- [Repository manager](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/RepositoryManager.cs): `src/GitHub.Api/Git/RepositoryManager.cs`
- [Repository model](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/Repository.cs): `src/GitHub.Api/Git/Repository.cs`
- [Repository watcher](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Events/RepositoryWatcher.cs): `src/GitHub.Api/Events/RepositoryWatcher.cs`
- [Git client](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Git/GitClient.cs): `src/GitHub.Api/Git/GitClient.cs`

### Runtime foundations

- [Git installer](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Installer/GitInstaller.cs): `src/GitHub.Api/Installer/GitInstaller.cs`
- [Task manager](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Tasks/TaskManager.cs): `src/GitHub.Api/Tasks/TaskManager.cs`
- [Process manager](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Process/ProcessManager.cs): `src/GitHub.Api/Process/ProcessManager.cs`
- [Platform environment](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/Platform/DefaultEnvironment.cs): `src/GitHub.Api/Platform/DefaultEnvironment.cs`
- [File system](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Api/IO/FileSystem.cs): `src/GitHub.Api/IO/FileSystem.cs`
- [Logging](https://github.com/github-for-unity/unity/blob/master/src/GitHub.Logging/LogHelper.cs): `src/GitHub.Logging/LogHelper.cs`

### Octorun CLI

- [Octorun command](https://github.com/github-for-unity/unity/blob/master/octorun/src/bin/app.js): `octorun/src/bin/app.js`
- [CLI login](https://github.com/github-for-unity/unity/blob/master/octorun/src/bin/app-login.js): `octorun/src/bin/app-login.js`
- [CLI API access](https://github.com/github-for-unity/unity/blob/master/octorun/src/api.js): `octorun/src/api.js`
- [CLI authentication](https://github.com/github-for-unity/unity/blob/master/octorun/src/authentication.js): `octorun/src/authentication.js`
- [Octokit client](https://github.com/github-for-unity/unity/blob/master/octorun/src/octokit.js): `octorun/src/octokit.js`
- [Other CLI commands](https://github.com/github-for-unity/unity/tree/master/octorun/src/bin): `octorun/src/bin`

### Other components

- **Unity user**
- **GitHub service**
- **Git executable**

## Connections

- Unity user → Application manager: uses (evidence: `README.md`)
- Application manager → Repository manager: creates (evidence: `src/GitHub.Api/Application/ApplicationManagerBase.cs`)
- Application manager → Git installer: uses (evidence: `src/GitHub.Api/Application/ApplicationManagerBase.cs`)
- Application manager → Task manager: uses (evidence: `src/GitHub.Api/Application/ApplicationManagerBase.cs`)
- Application manager → GitHub API client: uses
- Login manager → Credential keychain: stores credentials (evidence: `src/GitHub.Api/Authentication/LoginManager.cs`)
- Login manager → GitHub service: authenticates
- GitHub API client → GitHub service: requests API
- Repository manager → Repository watcher: starts and stops (evidence: `src/GitHub.Api/Git/RepositoryManager.cs`)
- Repository manager → Git client: dispatches Git tasks (evidence: `src/GitHub.Api/Git/RepositoryManager.cs`)
- Repository manager → Repository model: uses model
- Git client → Process manager: configures tasks (evidence: `src/GitHub.Api/Git/GitClient.cs`)
- Process manager → Git executable: runs commands (evidence: `src/GitHub.Api/Process/ProcessManager.cs`)
- Application manager → Platform environment: uses (evidence: `src/GitHub.Api/Application/ApplicationManagerBase.cs`)
- Process manager → Platform environment: reads paths (evidence: `src/GitHub.Api/Process/ProcessManager.cs`)
- Process manager → File system: searches executables (evidence: `src/GitHub.Api/Process/ProcessManager.cs`)
- Repository manager → Task manager: schedules tasks
- Octorun command → CLI login: dispatches commands
- CLI login → CLI authentication: calls authentication (evidence: `octorun/src/bin/app-login.js`)
- CLI login → Octokit client: writes output (evidence: `octorun/src/bin/app-login.js`)
- CLI authentication → Octokit client: uses client (evidence: `octorun/src/authentication.js`)
- CLI API access → Octokit client: uses client (evidence: `octorun/src/api.js`)
- Octorun command → Other CLI commands: offers commands
