# lokarex/ccc architecture

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

- Interactive diagram: https://gitdiagram.com/lokarex/ccc
- Repository: https://github.com/lokarex/ccc

## Overview

ccc is a cross-platform C/C++ build tool configured with C++ project files. A user invokes a command; the runtime resolves and dispatches it, project processing initializes targets, and target processing compiles and links executables or libraries. The README also documents project creation, cleaning, descriptions, custom commands, and dependency handling. Installer behavior is shown as a separate operational capability. Relationships involving unsampled command implementations are included only where the README or SOURCE INDEX supports them.

Main entry points: [`packages/cccsdk/src/ccc/build_target.cpp`](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/build_target.cpp) (Build targets), [`project.cpp`](https://github.com/lokarex/ccc/blob/main/project.cpp) (C++ project definition), [`packages/cccruntime/src/cccruntime.cpp`](https://github.com/lokarex/ccc/blob/main/packages/cccruntime/src/cccruntime.cpp) (CLI entry), [`packages/cccsdk/src/ccc/global.cpp`](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/global.cpp) (Command registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command runtime"]
  node_runtime["CLI entry<br/>[cccruntime.cpp]"]
  node_registry["Command registry<br/>[global.cpp]"]
  node_commands["Built-in commands"]
  node_command_api["Command API<br/>[command.h]"]
end

subgraph group_project["Project model"]
  node_project_config["C++ project definition<br/>[project.cpp]"]
  node_project_model["Project processing<br/>[project.cpp]"]
  node_project_new["Project creation<br/>[new.hpp]"]
  node_clean["Clean products<br/>[clean.hpp]"]
  node_describe["Descriptions<br/>[desc.hpp]"]
  node_help["Help and version<br/>[info.hpp]"]
end

subgraph group_build["Build engine"]
  node_target_model["Build targets<br/>[build_target.cpp]"]
  node_execution["Executables<br/>[execution.cpp]"]
  node_library["Libraries<br/>[library.cpp]"]
  node_config["Build configuration<br/>[config.cpp]"]
  node_toolchain["Toolchain formats<br/>[toolchain.cpp]"]
  node_io["Command execution and I/O<br/>[io.cpp]"]
end

subgraph group_support["Setup utilities"]
  node_installer["Environment installer<br/>[installer.py]"]
  node_installer_common["Shell setup helpers"]
  node_bashrc["User shell config"]
end

node_user(("Project developer"))

node_user -->|"invokes"| node_runtime
node_runtime -->|"resolves command"| node_registry
node_runtime -->|"prints default help"| node_help
node_registry -->|"registers commands"| node_commands
node_commands -.->|"uses registrations"| node_command_api
node_user -->|"defines project"| node_project_config
node_project_config -->|"registers project"| node_project_model
node_project_model -->|"processes tasks"| node_target_model
node_target_model -->|"selects formats"| node_toolchain
node_target_model -->|"runs compiler commands"| node_io
node_execution -->|"inherits target processing"| node_target_model
node_library -->|"inherits target processing"| node_target_model
node_project_config -->|"declares executable"| node_execution
node_project_config -->|"declares libraries"| node_library
node_project_config -->|"configures project"| node_config
node_project_new -->|"uses utilities"| node_io
node_clean -->|"cleans targets"| node_target_model
node_describe -.->|"queries descriptions"| node_registry
node_help -->|"documents commands"| node_user
node_installer -->|"uses helpers"| node_installer_common
node_installer_common -->|"edits shell exports"| node_bashrc

click node_runtime "https://github.com/lokarex/ccc/blob/main/packages/cccruntime/src/cccruntime.cpp"
click node_registry "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/global.cpp"
click node_commands "https://github.com/lokarex/ccc/tree/main/packages/cccsdk/include/ccc/cmd"
click node_command_api "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/command.h"
click node_project_config "https://github.com/lokarex/ccc/blob/main/project.cpp"
click node_project_model "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/project.cpp"
click node_target_model "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/build_target.cpp"
click node_execution "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/execution.cpp"
click node_library "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/library.cpp"
click node_config "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/config.cpp"
click node_toolchain "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/toolchain.cpp"
click node_io "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/util/io.cpp"
click node_project_new "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/new.hpp"
click node_clean "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/clean.hpp"
click node_describe "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/desc.hpp"
click node_help "https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/info.hpp"
click node_installer "https://github.com/lokarex/ccc/blob/main/scripts/installer.py"
click node_installer_common "https://github.com/lokarex/ccc/blob/main/scripts/_installer_common.py"

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_runtime,node_registry,node_commands,node_command_api toneBlue
class node_project_config,node_project_model,node_project_new,node_clean,node_describe,node_help toneAmber
class node_target_model,node_execution,node_library,node_config,node_toolchain,node_io toneMint
class node_installer,node_installer_common,node_bashrc toneRose
class node_user toneIndigo
```

## Components

### Command runtime

- [CLI entry](https://github.com/lokarex/ccc/blob/main/packages/cccruntime/src/cccruntime.cpp): `packages/cccruntime/src/cccruntime.cpp`
- [Command registry](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/global.cpp): `packages/cccsdk/src/ccc/global.cpp`
- [Built-in commands](https://github.com/lokarex/ccc/tree/main/packages/cccsdk/include/ccc/cmd): `packages/cccsdk/include/ccc/cmd`
- [Command API](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/command.h): `packages/cccsdk/include/ccc/command.h`

### Project model

- [C++ project definition](https://github.com/lokarex/ccc/blob/main/project.cpp): `project.cpp`
- [Project processing](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/project.cpp): `packages/cccsdk/src/ccc/project.cpp`
- [Project creation](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/new.hpp): `packages/cccsdk/include/ccc/cmd/new.hpp`
- [Clean products](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/clean.hpp): `packages/cccsdk/include/ccc/cmd/clean.hpp`
- [Descriptions](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/cmd/desc.hpp): `packages/cccsdk/include/ccc/cmd/desc.hpp`
- [Help and version](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/include/ccc/info.hpp): `packages/cccsdk/include/ccc/info.hpp`

### Build engine

- [Build targets](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/build_target.cpp): `packages/cccsdk/src/ccc/build_target.cpp`
- [Executables](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/execution.cpp): `packages/cccsdk/src/ccc/execution.cpp`
- [Libraries](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/library.cpp): `packages/cccsdk/src/ccc/library.cpp`
- [Build configuration](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/config.cpp): `packages/cccsdk/src/ccc/config.cpp`
- [Toolchain formats](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/ccc/toolchain.cpp): `packages/cccsdk/src/ccc/toolchain.cpp`
- [Command execution and I/O](https://github.com/lokarex/ccc/blob/main/packages/cccsdk/src/util/io.cpp): `packages/cccsdk/src/util/io.cpp`

### Setup utilities

- [Environment installer](https://github.com/lokarex/ccc/blob/main/scripts/installer.py): `scripts/installer.py`
- [Shell setup helpers](https://github.com/lokarex/ccc/blob/main/scripts/_installer_common.py): `scripts/_installer_common.py`
- **User shell config**

### Other components

- **Project developer**

## Connections

- Project developer → CLI entry: invokes (evidence: `README.md`)
- CLI entry → Command registry: resolves command (evidence: `packages/cccruntime/src/cccruntime.cpp`)
- CLI entry → Help and version: prints default help (evidence: `packages/cccruntime/src/cccruntime.cpp`)
- Command registry → Built-in commands: registers commands (evidence: `packages/cccsdk/src/ccc/global.cpp`)
- Built-in commands → Command API: uses registrations
- Project developer → C++ project definition: defines project (evidence: `README.md`)
- C++ project definition → Project processing: registers project (evidence: `packages/cccsdk/src/ccc/project.cpp`)
- Project processing → Build targets: processes tasks
- Build targets → Toolchain formats: selects formats (evidence: `packages/cccsdk/src/ccc/build_target.cpp`)
- Build targets → Command execution and I/O: runs compiler commands (evidence: `packages/cccsdk/src/ccc/build_target.cpp`)
- Executables → Build targets: inherits target processing
- Libraries → Build targets: inherits target processing
- C++ project definition → Executables: declares executable (evidence: `README.md`)
- C++ project definition → Libraries: declares libraries (evidence: `README.md`)
- C++ project definition → Build configuration: configures project
- Project creation → Command execution and I/O: uses utilities (evidence: `packages/cccsdk/include/ccc/cmd/new.hpp`)
- Clean products → Build targets: cleans targets (evidence: `packages/cccsdk/include/ccc/cmd/clean.hpp`)
- Descriptions → Command registry: queries descriptions (evidence: `packages/cccsdk/src/ccc/global.cpp`)
- Help and version → Project developer: documents commands (evidence: `README.md`)
- Environment installer → Shell setup helpers: uses helpers (evidence: `scripts/installer.py`)
- Shell setup helpers → User shell config: edits shell exports (evidence: `scripts/_installer_common.py`)
