# mcellteam/mcell_tools architecture

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

- Interactive diagram: https://gitdiagram.com/mcellteam/mcell_tools
- Repository: https://github.com/mcellteam/mcell_tools

## Overview

mcell_tools is a command-line build and repository-management tool for MCell and related projects. Its principal workflow parses options, checks prerequisites, obtains source repositories, builds MCell and companion components, then optionally assembles a Blender/CellBlender bundle or a PyPI wheel. The README documents the checkout-and-build flow and the resulting build directory. Source excerpts are partial, so relationships within build orchestration and unsampled bundle stages are shown only where documented or directly evidenced.

Main entry points: [`run.py`](https://github.com/mcellteam/mcell_tools/blob/master/run.py) (CLI workflow), [`scripts/build.py`](https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py) (Build orchestration), [`scripts/bundle.py`](https://github.com/mcellteam/mcell_tools/blob/master/scripts/bundle.py) (Blender bundle), [`scripts/pypi_wheel.py`](https://github.com/mcellteam/mcell_tools/blob/master/scripts/pypi_wheel.py) (PyPI wheel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Workflow control"]
  node_run["CLI workflow<br/>[run.py]"]
  node_options["CLI options<br/>[options.py]"]
  node_git_tool["Multi-repo CLI<br/>[mcell_git.py]"]
end

subgraph group_sources["Source management"]
  node_repositories["Repository operations<br/>[repositories.py]"]
end

subgraph group_build["Build system"]
  node_build["Build orchestration<br/>[build.py]"]
  node_mcell_build["MCell build<br/>[build.py]"]
  node_companion_builds["Companion builds<br/>[build.py]"]
  node_cmake["CMake provisioner<br/>[cmake_builder.py]"]
end

subgraph group_outputs["Packaging outputs"]
  node_bundle["Blender bundle<br/>[bundle.py]"]
  node_plugin["Plugin package"]
  node_wheel["PyPI wheel<br/>[pypi_wheel.py]"]
  node_wheel_setup["Wheel metadata<br/>[setup.py]"]
  node_build_artifact["Build directory"]
  node_archive["Bundle archive"]
end

subgraph group_shared["Shared configuration"]
  node_settings["Build settings<br/>[build_settings.py]"]
  node_utils["Process utilities<br/>[utils.py]"]
end

node_developer(("Developer"))
node_git["Git"]

node_developer -->|"runs"| node_run
node_run -->|"parses options"| node_options
node_run -->|"checks CMake"| node_cmake
node_run -->|"gets sources"| node_repositories
node_run -->|"starts builds"| node_build
node_run -->|"creates bundle"| node_bundle
node_run -->|"creates package"| node_plugin
node_run -->|"creates wheel"| node_wheel
node_git_tool -->|"dispatches commands"| node_repositories
node_repositories -->|"runs commands"| node_git
node_build -.->|"builds MCell"| node_mcell_build
node_build -.->|"builds companions"| node_companion_builds
node_build -->|"writes build output"| node_build_artifact
node_build -->|"uses settings"| node_settings
node_build -->|"uses utilities"| node_utils
node_bundle -->|"uses build command"| node_build
node_bundle -->|"uses settings"| node_settings
node_bundle -->|"uses utilities"| node_utils
node_bundle -->|"writes archive"| node_archive
node_plugin -->|"archives package"| node_bundle
node_wheel -->|"invokes metadata"| node_wheel_setup
node_wheel -->|"uses settings"| node_settings
node_wheel -->|"uses utilities"| node_utils

click node_run "https://github.com/mcellteam/mcell_tools/blob/master/run.py"
click node_options "https://github.com/mcellteam/mcell_tools/blob/master/scripts/options.py"
click node_git_tool "https://github.com/mcellteam/mcell_tools/blob/master/mcell_git.py"
click node_repositories "https://github.com/mcellteam/mcell_tools/blob/master/scripts/repositories.py"
click node_build "https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py"
click node_mcell_build "https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py"
click node_companion_builds "https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py"
click node_cmake "https://github.com/mcellteam/mcell_tools/blob/master/scripts/cmake_builder.py"
click node_settings "https://github.com/mcellteam/mcell_tools/blob/master/scripts/build_settings.py"
click node_utils "https://github.com/mcellteam/mcell_tools/blob/master/scripts/utils.py"
click node_bundle "https://github.com/mcellteam/mcell_tools/blob/master/scripts/bundle.py"
click node_plugin "https://github.com/mcellteam/mcell_tools/blob/master/scripts/cellblender_mcell_plugin.py"
click node_wheel "https://github.com/mcellteam/mcell_tools/blob/master/scripts/pypi_wheel.py"
click node_wheel_setup "https://github.com/mcellteam/mcell_tools/blob/master/pypi_wheel/setup.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_run,node_options,node_git_tool toneBlue
class node_repositories toneAmber
class node_build,node_mcell_build,node_companion_builds,node_cmake toneMint
class node_bundle,node_plugin,node_wheel,node_wheel_setup,node_build_artifact,node_archive toneRose
class node_settings,node_utils,node_developer,node_git toneIndigo
```

## Components

### Workflow control

- [CLI workflow](https://github.com/mcellteam/mcell_tools/blob/master/run.py): `run.py`
- [CLI options](https://github.com/mcellteam/mcell_tools/blob/master/scripts/options.py): `scripts/options.py`
- [Multi-repo CLI](https://github.com/mcellteam/mcell_tools/blob/master/mcell_git.py): `mcell_git.py`

### Source management

- [Repository operations](https://github.com/mcellteam/mcell_tools/blob/master/scripts/repositories.py): `scripts/repositories.py`

### Build system

- [Build orchestration](https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py): `scripts/build.py`
- [MCell build](https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py): `scripts/build.py`
- [Companion builds](https://github.com/mcellteam/mcell_tools/blob/master/scripts/build.py): `scripts/build.py`
- [CMake provisioner](https://github.com/mcellteam/mcell_tools/blob/master/scripts/cmake_builder.py): `scripts/cmake_builder.py`

### Packaging outputs

- [Blender bundle](https://github.com/mcellteam/mcell_tools/blob/master/scripts/bundle.py): `scripts/bundle.py`
- [Plugin package](https://github.com/mcellteam/mcell_tools/blob/master/scripts/cellblender_mcell_plugin.py): `scripts/cellblender_mcell_plugin.py`
- [PyPI wheel](https://github.com/mcellteam/mcell_tools/blob/master/scripts/pypi_wheel.py): `scripts/pypi_wheel.py`
- [Wheel metadata](https://github.com/mcellteam/mcell_tools/blob/master/pypi_wheel/setup.py): `pypi_wheel/setup.py`
- **Build directory**
- **Bundle archive**

### Shared configuration

- [Build settings](https://github.com/mcellteam/mcell_tools/blob/master/scripts/build_settings.py): `scripts/build_settings.py`
- [Process utilities](https://github.com/mcellteam/mcell_tools/blob/master/scripts/utils.py): `scripts/utils.py`

### Other components

- **Developer**
- **Git**

## Connections

- Developer → CLI workflow: runs (evidence: `README.md`)
- CLI workflow → CLI options: parses options (evidence: `run.py`)
- CLI workflow → CMake provisioner: checks CMake (evidence: `run.py`)
- CLI workflow → Repository operations: gets sources (evidence: `run.py`)
- CLI workflow → Build orchestration: starts builds (evidence: `run.py`)
- CLI workflow → Blender bundle: creates bundle (evidence: `run.py`)
- CLI workflow → Plugin package: creates package (evidence: `run.py`)
- CLI workflow → PyPI wheel: creates wheel (evidence: `run.py`)
- Multi-repo CLI → Repository operations: dispatches commands (evidence: `mcell_git.py`)
- Repository operations → Git: runs commands (evidence: `scripts/repositories.py`)
- Build orchestration → MCell build: builds MCell (evidence: `scripts/build.py`)
- Build orchestration → Companion builds: builds companions (evidence: `scripts/build.py`)
- Build orchestration → Build directory: writes build output (evidence: `README.md`)
- Build orchestration → Build settings: uses settings (evidence: `scripts/build.py`)
- Build orchestration → Process utilities: uses utilities (evidence: `scripts/build.py`)
- Blender bundle → Build orchestration: uses build command (evidence: `scripts/bundle.py`)
- Blender bundle → Build settings: uses settings (evidence: `scripts/bundle.py`)
- Blender bundle → Process utilities: uses utilities (evidence: `scripts/bundle.py`)
- Blender bundle → Bundle archive: writes archive (evidence: `scripts/bundle.py`)
- Plugin package → Blender bundle: archives package (evidence: `scripts/cellblender_mcell_plugin.py`)
- PyPI wheel → Wheel metadata: invokes metadata (evidence: `scripts/pypi_wheel.py`)
- PyPI wheel → Build settings: uses settings (evidence: `scripts/pypi_wheel.py`)
- PyPI wheel → Process utilities: uses utilities (evidence: `scripts/pypi_wheel.py`)
