# doomemacs/core architecture

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

- Interactive diagram: https://gitdiagram.com/doomemacs/core
- Repository: https://github.com/doomemacs/core

## Overview

Doom Emacs is a configuration framework and CLI for turning GNU Emacs into a modular, reproducible editing environment. Users either launch Emacs, which loads Doom and its modules, or invoke the Doom CLI to install, synchronize, upgrade, diagnose, and snapshot the shell environment. The runtime then composes packages and editor features such as Vim emulation, language tooling, projects, search, popups, and persistent workspaces. Relationships reflect the README and repository tree; no source excerpts were available.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Lifecycle"]
  node_doom_cli_entry["Doom CLI Entry"]
  node_doom_cli["CLI Dispatcher<br/>[doom-cli.el]"]
  node_doctor["System Doctor"]
end

subgraph group_core["Doom Core"]
  node_doom_runtime["Doom Runtime<br/>[doom.el]"]
  node_emacs_loader["Emacs Initialization<br/>[doom-emacs.el]"]
  node_module_loader["Module Loader<br/>[doom-modules.el]"]
  node_standard_library["Standard Library"]
end

subgraph group_packages["Package Management"]
  node_package_manager["Package Manager<br/>[doom-packages.el]"]
  node_straight_backend["Straight Backend<br/>[doom-straight.el]"]
end

subgraph group_features["Editor Features"]
  node_optional_modules["Optional Modules"]
  node_vim_emulation["Vim Emulation"]
  node_language_tooling["Language Tooling"]
  node_project_search["Project Search<br/>[projects.el]"]
  node_workspaces["Persistent Workspaces<br/>[sessions.el]"]
  node_popup_manager["Popup Manager"]
end

subgraph group_state["State &amp; Integrations"]
  node_state_store[("Persistent State<br/>[store.el]")]
  node_shell_environment["Shell Environment<br/>[sh.el]"]
end

node_user(("User"))
node_emacs["GNU Emacs"]
node_git["Git"]
node_ripgrep["Ripgrep"]
node_package_sources["Package Sources"]

node_user -->|"invokes"| node_doom_cli_entry
node_doom_cli_entry -->|"dispatches"| node_doom_cli
node_doom_cli -->|"syncs packages"| node_package_manager
node_doom_cli -->|"runs diagnosis"| node_doctor
node_doom_cli -->|"writes snapshot"| node_shell_environment
node_doom_cli -->|"regenerates caches"| node_state_store
node_package_manager -->|"uses backend"| node_straight_backend
node_straight_backend -->|"fetches revisions"| node_git
node_straight_backend -->|"retrieves packages"| node_package_sources
node_user -->|"launches"| node_emacs
node_emacs -->|"loads initialization"| node_emacs_loader
node_emacs_loader -->|"starts runtime"| node_doom_runtime
node_doom_runtime -->|"loads modules"| node_module_loader
node_doom_runtime -->|"uses utilities"| node_standard_library
node_module_loader -->|"configures modules"| node_optional_modules
node_module_loader -->|"declares packages"| node_package_manager
node_module_loader -->|"enables emulation"| node_vim_emulation
node_module_loader -->|"enables tooling"| node_language_tooling
node_module_loader -->|"enables projects"| node_project_search
node_module_loader -->|"enables workspaces"| node_workspaces
node_module_loader -->|"enables popups"| node_popup_manager
node_project_search -.->|"searches projects"| node_ripgrep
node_doom_runtime -->|"reads snapshot"| node_shell_environment
node_doom_runtime -->|"loads state"| node_state_store

click node_doom_cli_entry "https://github.com/doomemacs/core/blob/master/bin/doom"
click node_doom_cli "https://github.com/doomemacs/core/blob/master/lisp/doom-cli.el"
click node_doctor "https://github.com/doomemacs/core/blob/master/bin/doom-doctor"
click node_doom_runtime "https://github.com/doomemacs/core/blob/master/lisp/doom.el"
click node_emacs_loader "https://github.com/doomemacs/core/blob/master/lisp/doom-emacs.el"
click node_module_loader "https://github.com/doomemacs/core/blob/master/lisp/doom-modules.el"
click node_standard_library "https://github.com/doomemacs/core/tree/master/lisp/lib"
click node_package_manager "https://github.com/doomemacs/core/blob/master/lisp/doom-packages.el"
click node_straight_backend "https://github.com/doomemacs/core/blob/master/lisp/doom-straight.el"
click node_optional_modules "https://github.com/doomemacs/core/tree/master/modules"
click node_vim_emulation "https://github.com/doomemacs/core/tree/master/modules"
click node_language_tooling "https://github.com/doomemacs/core/tree/master/modules"
click node_project_search "https://github.com/doomemacs/core/blob/master/lisp/lib/projects.el"
click node_workspaces "https://github.com/doomemacs/core/blob/master/lisp/lib/sessions.el"
click node_popup_manager "https://github.com/doomemacs/core/tree/master/modules"
click node_state_store "https://github.com/doomemacs/core/blob/master/lisp/lib/store.el"
click node_shell_environment "https://github.com/doomemacs/core/blob/master/lisp/cli/sh.el"

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_doom_cli_entry,node_doom_cli,node_doctor,node_user toneBlue
class node_doom_runtime,node_emacs_loader,node_module_loader,node_standard_library toneAmber
class node_package_manager,node_straight_backend toneMint
class node_optional_modules,node_vim_emulation,node_language_tooling,node_project_search,node_workspaces,node_popup_manager toneRose
class node_state_store,node_shell_environment,node_emacs,node_git,node_ripgrep,node_package_sources toneIndigo
```

## Components

### Entry & Lifecycle

- [Doom CLI Entry](https://github.com/doomemacs/core/blob/master/bin/doom): `bin/doom`
- [CLI Dispatcher](https://github.com/doomemacs/core/blob/master/lisp/doom-cli.el): `lisp/doom-cli.el`
- [System Doctor](https://github.com/doomemacs/core/blob/master/bin/doom-doctor): `bin/doom-doctor`

### Doom Core

- [Doom Runtime](https://github.com/doomemacs/core/blob/master/lisp/doom.el): `lisp/doom.el`
- [Emacs Initialization](https://github.com/doomemacs/core/blob/master/lisp/doom-emacs.el): `lisp/doom-emacs.el`
- [Module Loader](https://github.com/doomemacs/core/blob/master/lisp/doom-modules.el): `lisp/doom-modules.el`
- [Standard Library](https://github.com/doomemacs/core/tree/master/lisp/lib): `lisp/lib`

### Package Management

- [Package Manager](https://github.com/doomemacs/core/blob/master/lisp/doom-packages.el): `lisp/doom-packages.el`
- [Straight Backend](https://github.com/doomemacs/core/blob/master/lisp/doom-straight.el): `lisp/doom-straight.el`

### Editor Features

- [Optional Modules](https://github.com/doomemacs/core/tree/master/modules): `modules`
- [Vim Emulation](https://github.com/doomemacs/core/tree/master/modules): `modules`
- [Language Tooling](https://github.com/doomemacs/core/tree/master/modules): `modules`
- [Project Search](https://github.com/doomemacs/core/blob/master/lisp/lib/projects.el): `lisp/lib/projects.el`
- [Persistent Workspaces](https://github.com/doomemacs/core/blob/master/lisp/lib/sessions.el): `lisp/lib/sessions.el`
- [Popup Manager](https://github.com/doomemacs/core/tree/master/modules): `modules`

### State & Integrations

- [Persistent State](https://github.com/doomemacs/core/blob/master/lisp/lib/store.el): `lisp/lib/store.el`
- [Shell Environment](https://github.com/doomemacs/core/blob/master/lisp/cli/sh.el): `lisp/cli/sh.el`

### Other components

- **User**
- **GNU Emacs**
- **Git**
- **Ripgrep**
- **Package Sources**

## Connections

- User → Doom CLI Entry: invokes
- Doom CLI Entry → CLI Dispatcher: dispatches
- CLI Dispatcher → Package Manager: syncs packages
- CLI Dispatcher → System Doctor: runs diagnosis
- CLI Dispatcher → Shell Environment: writes snapshot
- CLI Dispatcher → Persistent State: regenerates caches
- Package Manager → Straight Backend: uses backend
- Straight Backend → Git: fetches revisions
- Straight Backend → Package Sources: retrieves packages
- User → GNU Emacs: launches
- GNU Emacs → Emacs Initialization: loads initialization
- Emacs Initialization → Doom Runtime: starts runtime
- Doom Runtime → Module Loader: loads modules
- Doom Runtime → Standard Library: uses utilities
- Module Loader → Optional Modules: configures modules
- Module Loader → Package Manager: declares packages
- Module Loader → Vim Emulation: enables emulation
- Module Loader → Language Tooling: enables tooling
- Module Loader → Project Search: enables projects
- Module Loader → Persistent Workspaces: enables workspaces
- Module Loader → Popup Manager: enables popups
- Project Search → Ripgrep: searches projects
- Doom Runtime → Shell Environment: reads snapshot
- Doom Runtime → Persistent State: loads state
