# mislav/hub architecture

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

- Interactive diagram: https://gitdiagram.com/mislav/hub
- Repository: https://github.com/mislav/hub

## Overview

hub is a Git-wrapping CLI that adds GitHub workflows, including issues, pull requests, releases, and direct API access. Users invoke the executable; its command runner dispatches features that use Git repository operations and GitHub services, then present results in the terminal. The graph preserves these major product branches and a supporting process-execution layer. Several command families and the runner are unsampled, so their internal connections are omitted rather than inferred.

Main entry points: [`github/client.go`](https://github.com/mislav/hub/blob/master/github/client.go) (GitHub client), [`main.go`](https://github.com/mislav/hub/blob/master/main.go) (Executable entry), [`git/git.go`](https://github.com/mislav/hub/blob/master/git/git.go) (Git operations), [`commands/api.go`](https://github.com/mislav/hub/blob/master/commands/api.go) (API command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commands["Command workflows"]
  node_dispatch["Command runner<br/>[runner.go]"]
  node_api_cmd["API command<br/>[api.go]"]
  node_issue_cmd["Issue workflows<br/>[issue.go]"]
  node_pr_cmd["PR workflows<br/>[pr.go]"]
  node_pull_request_cmd["Create pull request<br/>[pull_request.go]"]
  node_release_cmd["Release workflows<br/>[release.go]"]
  node_other_cmds["Other GitHub commands"]
end

subgraph group_git["Git integration"]
  node_git_adapter["Git operations<br/>[git.go]"]
end

subgraph group_github["GitHub integration"]
  node_github_client["GitHub client<br/>[client.go]"]
  node_http_transport["HTTP transport<br/>[http.go]"]
  node_repo_context["Repository context<br/>[localrepo.go]"]
end

subgraph group_runtime["Runtime support"]
  node_entry["Executable entry<br/>[main.go]"]
  node_process["Process execution<br/>[cmd.go]"]
  node_terminal["Terminal output<br/>[ui.go]"]
end

node_user(("CLI user"))
node_github_service{{"GitHub API"}}
node_git_service{{"Git executable"}}

node_user -->|"runs"| node_entry
node_entry -->|"executes"| node_dispatch
node_entry -->|"reports errors"| node_terminal
node_api_cmd -->|"requests API"| node_github_client
node_api_cmd -->|"accesses API"| node_github_service
node_issue_cmd -->|"manages issues"| node_github_client
node_issue_cmd -->|"prints results"| node_terminal
node_pr_cmd -->|"fetches requests"| node_github_client
node_pr_cmd -->|"checks branches"| node_git_adapter
node_pull_request_cmd -->|"creates request"| node_github_client
node_pull_request_cmd -->|"inspects branches"| node_git_adapter
node_release_cmd -->|"manages releases"| node_github_client
node_git_adapter -->|"runs commands"| node_process
node_process -->|"executes"| node_git_service

click node_entry "https://github.com/mislav/hub/blob/master/main.go"
click node_dispatch "https://github.com/mislav/hub/blob/master/commands/runner.go"
click node_api_cmd "https://github.com/mislav/hub/blob/master/commands/api.go"
click node_issue_cmd "https://github.com/mislav/hub/blob/master/commands/issue.go"
click node_pr_cmd "https://github.com/mislav/hub/blob/master/commands/pr.go"
click node_pull_request_cmd "https://github.com/mislav/hub/blob/master/commands/pull_request.go"
click node_release_cmd "https://github.com/mislav/hub/blob/master/commands/release.go"
click node_other_cmds "https://github.com/mislav/hub/tree/master/commands"
click node_git_adapter "https://github.com/mislav/hub/blob/master/git/git.go"
click node_process "https://github.com/mislav/hub/blob/master/cmd/cmd.go"
click node_github_client "https://github.com/mislav/hub/blob/master/github/client.go"
click node_http_transport "https://github.com/mislav/hub/blob/master/github/http.go"
click node_repo_context "https://github.com/mislav/hub/blob/master/github/localrepo.go"
click node_terminal "https://github.com/mislav/hub/blob/master/ui/ui.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_dispatch,node_api_cmd,node_issue_cmd,node_pr_cmd,node_pull_request_cmd,node_release_cmd,node_other_cmds,node_user toneBlue
class node_git_adapter toneAmber
class node_github_client,node_http_transport,node_repo_context,node_github_service toneMint
class node_entry,node_process,node_terminal toneRose
class node_git_service toneIndigo
```

## Components

### Command workflows

- [Command runner](https://github.com/mislav/hub/blob/master/commands/runner.go): `commands/runner.go`
- [API command](https://github.com/mislav/hub/blob/master/commands/api.go): `commands/api.go`
- [Issue workflows](https://github.com/mislav/hub/blob/master/commands/issue.go): `commands/issue.go`
- [PR workflows](https://github.com/mislav/hub/blob/master/commands/pr.go): `commands/pr.go`
- [Create pull request](https://github.com/mislav/hub/blob/master/commands/pull_request.go): `commands/pull_request.go`
- [Release workflows](https://github.com/mislav/hub/blob/master/commands/release.go): `commands/release.go`
- [Other GitHub commands](https://github.com/mislav/hub/tree/master/commands): `commands`

### Git integration

- [Git operations](https://github.com/mislav/hub/blob/master/git/git.go): `git/git.go`

### GitHub integration

- [GitHub client](https://github.com/mislav/hub/blob/master/github/client.go): `github/client.go`
- [HTTP transport](https://github.com/mislav/hub/blob/master/github/http.go): `github/http.go`
- [Repository context](https://github.com/mislav/hub/blob/master/github/localrepo.go): `github/localrepo.go`

### Runtime support

- [Executable entry](https://github.com/mislav/hub/blob/master/main.go): `main.go`
- [Process execution](https://github.com/mislav/hub/blob/master/cmd/cmd.go): `cmd/cmd.go`
- [Terminal output](https://github.com/mislav/hub/blob/master/ui/ui.go): `ui/ui.go`

### Other components

- **CLI user**
- **GitHub API**
- **Git executable**

## Connections

- CLI user → Executable entry: runs
- Executable entry → Command runner: executes (evidence: `main.go`)
- Executable entry → Terminal output: reports errors (evidence: `main.go`)
- API command → GitHub client: requests API (evidence: `commands/api.go`)
- API command → GitHub API: accesses API
- Issue workflows → GitHub client: manages issues (evidence: `commands/issue.go`)
- Issue workflows → Terminal output: prints results (evidence: `commands/issue.go`)
- PR workflows → GitHub client: fetches requests (evidence: `commands/pr.go`)
- PR workflows → Git operations: checks branches (evidence: `commands/pr.go`)
- Create pull request → GitHub client: creates request (evidence: `commands/pull_request.go`)
- Create pull request → Git operations: inspects branches (evidence: `commands/pull_request.go`)
- Release workflows → GitHub client: manages releases (evidence: `commands/release.go`)
- Git operations → Process execution: runs commands (evidence: `git/git.go`)
- Process execution → Git executable: executes (evidence: `cmd/cmd.go`)
