# blue-pigeon-software/claudea architecture

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

- Interactive diagram: https://gitdiagram.com/blue-pigeon-software/claudea
- Repository: https://github.com/blue-pigeon-software/claudea

## Overview

claudea is an interactive and command-line manager for independent Claude Code accounts. Users create, import, organize, inspect, log in to, and remove accounts, then launch Claude Code with the selected account’s `CLAUDE_CONFIG_DIR`. The CLI and interactive menu are separate entry surfaces over shared account and Claude operations; optional shell integration edits startup files to provide an alias. The graph includes the registry and per-account configuration directories as state. Relationships are supported by the excerpts, source-index references, or README; unsampled implementation details are not inferred.

Main entry points: [`src/interactive.js`](https://github.com/blue-pigeon-software/claudea/blob/main/src/interactive.js) (Interactive menu), [`src/cli.js`](https://github.com/blue-pigeon-software/claudea/blob/main/src/cli.js) (Command dispatcher), [`src/accounts.js`](https://github.com/blue-pigeon-software/claudea/blob/main/src/accounts.js) (Account operations), [`src/claude.js`](https://github.com/blue-pigeon-software/claudea/blob/main/src/claude.js) (Claude commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry surfaces"]
  node_cli["Command dispatcher<br/>[cli.js]"]
  node_menu["Interactive menu<br/>[interactive.js]"]
  node_terminal_ui["Terminal interface<br/>[ui.js]"]
end

subgraph group_accounts["Account management"]
  node_account_ops["Account operations<br/>[accounts.js]"]
  node_registry[("Account registry<br/>[config.js]")]
  node_account_dirs[("Account directories")]
end

subgraph group_claude["Claude operations"]
  node_claude_ops["Claude commands<br/>[claude.js]"]
  node_shell_integration["Shell integration<br/>[shell.js]"]
end

subgraph group_support["Runtime support"]
  node_formatting["Account formatting<br/>[format.js]"]
  node_paths["Path handling<br/>[paths.js]"]
  node_filesystem["File utilities<br/>[fsutil.js]"]
  node_logging["Logging and errors<br/>[log.js]"]
end

node_user(("User"))
node_claude_code["Claude Code"]
node_shell_startup["Shell startup files"]

node_user -->|"runs commands"| node_cli
node_user -->|"opens menu"| node_menu
node_cli -->|"opens interactive mode"| node_menu
node_cli -->|"loads configuration"| node_registry
node_cli -->|"dispatches account actions"| node_account_ops
node_cli -->|"dispatches Claude actions"| node_claude_ops
node_cli -->|"controls integration"| node_shell_integration
node_menu -->|"loads state"| node_registry
node_menu -->|"manages accounts"| node_account_ops
node_menu -->|"checks and authenticates"| node_claude_ops
node_menu -->|"renders prompts"| node_terminal_ui
node_menu -->|"offers shell settings"| node_shell_integration
node_account_ops -->|"saves account changes"| node_registry
node_account_ops -->|"creates and removes"| node_account_dirs
node_account_ops -->|"normalizes locations"| node_paths
node_account_ops -->|"checks directories"| node_filesystem
node_registry -->|"writes JSON atomically"| node_filesystem
node_claude_ops -->|"runs auth and sessions"| node_claude_code
node_claude_ops -->|"sets account config path"| node_account_dirs
node_claude_ops -->|"reads fallback status"| node_filesystem
node_shell_integration -->|"edits alias block"| node_shell_startup
node_shell_integration -->|"writes atomically"| node_filesystem
node_shell_integration -->|"selects startup path"| node_paths
node_cli -->|"formats account status"| node_formatting
node_menu -->|"formats account status"| node_formatting
node_formatting -->|"abbreviates directories"| node_paths
node_cli -->|"reports outcomes"| node_logging
node_menu -->|"reports errors"| node_logging

click node_cli "https://github.com/blue-pigeon-software/claudea/blob/main/src/cli.js"
click node_menu "https://github.com/blue-pigeon-software/claudea/blob/main/src/interactive.js"
click node_terminal_ui "https://github.com/blue-pigeon-software/claudea/blob/main/src/ui.js"
click node_account_ops "https://github.com/blue-pigeon-software/claudea/blob/main/src/accounts.js"
click node_registry "https://github.com/blue-pigeon-software/claudea/blob/main/src/config.js"
click node_claude_ops "https://github.com/blue-pigeon-software/claudea/blob/main/src/claude.js"
click node_shell_integration "https://github.com/blue-pigeon-software/claudea/blob/main/src/shell.js"
click node_formatting "https://github.com/blue-pigeon-software/claudea/blob/main/src/format.js"
click node_paths "https://github.com/blue-pigeon-software/claudea/blob/main/src/paths.js"
click node_filesystem "https://github.com/blue-pigeon-software/claudea/blob/main/src/fsutil.js"
click node_logging "https://github.com/blue-pigeon-software/claudea/blob/main/src/log.js"

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_menu,node_terminal_ui,node_user toneBlue
class node_account_ops,node_registry,node_account_dirs toneAmber
class node_claude_ops,node_shell_integration toneMint
class node_formatting,node_paths,node_filesystem,node_logging toneRose
class node_claude_code,node_shell_startup toneIndigo
```

## Components

### Entry surfaces

- [Command dispatcher](https://github.com/blue-pigeon-software/claudea/blob/main/src/cli.js): `src/cli.js`
- [Interactive menu](https://github.com/blue-pigeon-software/claudea/blob/main/src/interactive.js): `src/interactive.js`
- [Terminal interface](https://github.com/blue-pigeon-software/claudea/blob/main/src/ui.js): `src/ui.js`

### Account management

- [Account operations](https://github.com/blue-pigeon-software/claudea/blob/main/src/accounts.js): `src/accounts.js`
- [Account registry](https://github.com/blue-pigeon-software/claudea/blob/main/src/config.js): `src/config.js`
- **Account directories**

### Claude operations

- [Claude commands](https://github.com/blue-pigeon-software/claudea/blob/main/src/claude.js): `src/claude.js`
- [Shell integration](https://github.com/blue-pigeon-software/claudea/blob/main/src/shell.js): `src/shell.js`

### Runtime support

- [Account formatting](https://github.com/blue-pigeon-software/claudea/blob/main/src/format.js): `src/format.js`
- [Path handling](https://github.com/blue-pigeon-software/claudea/blob/main/src/paths.js): `src/paths.js`
- [File utilities](https://github.com/blue-pigeon-software/claudea/blob/main/src/fsutil.js): `src/fsutil.js`
- [Logging and errors](https://github.com/blue-pigeon-software/claudea/blob/main/src/log.js): `src/log.js`

### Other components

- **User**
- **Claude Code**
- **Shell startup files**

## Connections

- User → Command dispatcher: runs commands (evidence: `README.md`)
- User → Interactive menu: opens menu (evidence: `README.md`)
- Command dispatcher → Interactive menu: opens interactive mode (evidence: `README.md`)
- Command dispatcher → Account registry: loads configuration (evidence: `src/cli.js`)
- Command dispatcher → Account operations: dispatches account actions (evidence: `src/cli.js`)
- Command dispatcher → Claude commands: dispatches Claude actions (evidence: `src/cli.js`)
- Command dispatcher → Shell integration: controls integration (evidence: `src/cli.js`)
- Interactive menu → Account registry: loads state (evidence: `src/interactive.js`)
- Interactive menu → Account operations: manages accounts (evidence: `src/interactive.js`)
- Interactive menu → Claude commands: checks and authenticates (evidence: `src/interactive.js`)
- Interactive menu → Terminal interface: renders prompts (evidence: `src/interactive.js`)
- Interactive menu → Shell integration: offers shell settings (evidence: `README.md`)
- Account operations → Account registry: saves account changes (evidence: `src/accounts.js`)
- Account operations → Account directories: creates and removes (evidence: `src/accounts.js`)
- Account operations → Path handling: normalizes locations (evidence: `src/accounts.js`)
- Account operations → File utilities: checks directories (evidence: `src/accounts.js`)
- Account registry → File utilities: writes JSON atomically (evidence: `src/config.js`)
- Claude commands → Claude Code: runs auth and sessions (evidence: `src/claude.js`)
- Claude commands → Account directories: sets account config path (evidence: `README.md`)
- Claude commands → File utilities: reads fallback status (evidence: `src/claude.js`)
- Shell integration → Shell startup files: edits alias block (evidence: `src/shell.js`)
- Shell integration → File utilities: writes atomically (evidence: `src/shell.js`)
- Shell integration → Path handling: selects startup path (evidence: `src/shell.js`)
- Command dispatcher → Account formatting: formats account status (evidence: `README.md`)
- Interactive menu → Account formatting: formats account status (evidence: `src/interactive.js`)
- Account formatting → Path handling: abbreviates directories (evidence: `src/format.js`)
- Command dispatcher → Logging and errors: reports outcomes (evidence: `src/cli.js`)
- Interactive menu → Logging and errors: reports errors (evidence: `src/interactive.js`)
