# marshmallowneko/reveriecli architecture

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

- Interactive diagram: https://gitdiagram.com/marshmallowneko/reveriecli
- Repository: https://github.com/marshmallowneko/reveriecli

## Overview

ReverieCODE is a host-running autonomous coding agent. Users start it through the CLI or interactive shell; the agent sends tasks and tool definitions to a configured model, executes returned tool calls, and presents results. Its main stages are configuration and skill setup, model interaction, tool execution, and output. The README documents history, slash commands, streaming, context summarization, and the full tool suite; several relationships to these capabilities are documented rather than shown in the sampled excerpts.

Main entry points: [`reverie/agent.py`](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/agent.py) (Autonomous loop), [`reverie/main.py`](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/main.py) (CLI and shell), [`reverie/llm/factory.py`](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/factory.py) (Provider factory), [`reverie/llm/anthropic.py`](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/anthropic.py) (Anthropic provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and interaction"]
  node_cli["CLI and shell<br/>[main.py]"]
  node_history[("Command history<br/>[main.py]")]
  node_renderer["Rich renderer<br/>[renderer.py]"]
end

subgraph group_agent["Agent runtime"]
  node_agent["Autonomous loop<br/>[agent.py]"]
  node_context["Context manager<br/>[context.py]"]
  node_skills["Skill registry<br/>[base.py]"]
  node_skillloader["Skill loader<br/>[loader.py]"]
  node_skillfiles["Built-in skills"]
end

subgraph group_models["Model providers"]
  node_factory["Provider factory<br/>[factory.py]"]
  node_providerbase["Provider interface<br/>[base.py]"]
  node_anthropic["Anthropic provider<br/>[anthropic.py]"]
  node_openai["OpenAI-compatible provider<br/>[openai.py]"]
  node_deepseek["DeepSeek provider<br/>[deepseek.py]"]
end

subgraph group_tools["Execution tools"]
  node_files["File operations<br/>[files.py]"]
  node_shell["Host commands<br/>[shell.py]"]
  node_browser["Browser automation<br/>[browser.py]"]
  node_search["Web search<br/>[search.py]"]
end

subgraph group_support["Runtime support"]
  node_config["Configuration<br/>[config.py]"]
  node_logging[("Rotating logs<br/>[logging.py]")]
end

node_user(("User"))
node_configfile[("Config file")]
node_modelservice{{"Model API"}}
node_workspace[("Host workspace")]
node_web{{"Web pages"}}
node_bing{{"Bing search"}}

node_user -->|"starts task"| node_cli
node_cli -->|"loads settings"| node_config
node_config -->|"reads and writes"| node_configfile
node_cli -->|"runs task"| node_agent
node_cli -->|"uses interface"| node_renderer
node_cli -->|"persists history"| node_history
node_cli -->|"manages skills"| node_skills
node_cli -->|"initializes logging"| node_logging
node_agent -->|"manages context"| node_context
node_agent -->|"selects provider"| node_factory
node_agent -->|"uses skills"| node_skills
node_agent -->|"renders responses"| node_renderer
node_agent -->|"records activity"| node_logging
node_skillloader -->|"registers skills"| node_skills
node_skillloader -->|"loads built-ins"| node_skillfiles
node_factory -->|"creates provider"| node_anthropic
node_factory -->|"creates provider"| node_openai
node_factory -->|"creates provider"| node_deepseek
node_anthropic -->|"implements interface"| node_providerbase
node_openai -->|"implements interface"| node_providerbase
node_deepseek -->|"implements interface"| node_providerbase
node_anthropic -.->|"calls model API"| node_modelservice
node_openai -.->|"calls model API"| node_modelservice
node_deepseek -.->|"calls model API"| node_modelservice
node_agent -->|"dispatches tools"| node_files
node_agent -->|"dispatches tools"| node_shell
node_agent -->|"dispatches tools"| node_browser
node_agent -->|"dispatches tools"| node_search
node_files -.->|"operates on files"| node_workspace
node_shell -.->|"runs host commands"| node_workspace
node_browser -.->|"automates pages"| node_web
node_search -->|"queries search"| node_bing

click node_cli "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/main.py"
click node_config "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/config.py"
click node_history "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/main.py"
click node_renderer "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/ui/renderer.py"
click node_agent "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/agent.py"
click node_context "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/context.py"
click node_skills "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/skills/base.py"
click node_skillloader "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/skills/loader.py"
click node_skillfiles "https://github.com/marshmallowneko/reveriecli/tree/main/reverie/skills/builtin"
click node_factory "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/factory.py"
click node_providerbase "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/base.py"
click node_anthropic "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/anthropic.py"
click node_openai "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/openai.py"
click node_deepseek "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/deepseek.py"
click node_files "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/files.py"
click node_shell "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/shell.py"
click node_browser "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/browser.py"
click node_search "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/search.py"
click node_logging "https://github.com/marshmallowneko/reveriecli/blob/main/reverie/logging.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_cli,node_history,node_renderer,node_user toneBlue
class node_agent,node_context,node_skills,node_skillloader,node_skillfiles,node_configfile,node_workspace toneAmber
class node_factory,node_providerbase,node_anthropic,node_openai,node_deepseek,node_modelservice toneMint
class node_files,node_shell,node_browser,node_search toneRose
class node_config,node_logging,node_web,node_bing toneIndigo
```

## Components

### CLI and interaction

- [CLI and shell](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/main.py): `reverie/main.py`
- [Command history](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/main.py): `reverie/main.py`
- [Rich renderer](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/ui/renderer.py): `reverie/ui/renderer.py`

### Agent runtime

- [Autonomous loop](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/agent.py): `reverie/agent.py`
- [Context manager](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/context.py): `reverie/context.py`
- [Skill registry](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/skills/base.py): `reverie/skills/base.py`
- [Skill loader](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/skills/loader.py): `reverie/skills/loader.py`
- [Built-in skills](https://github.com/marshmallowneko/reveriecli/tree/main/reverie/skills/builtin): `reverie/skills/builtin`

### Model providers

- [Provider factory](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/factory.py): `reverie/llm/factory.py`
- [Provider interface](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/base.py): `reverie/llm/base.py`
- [Anthropic provider](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/anthropic.py): `reverie/llm/anthropic.py`
- [OpenAI-compatible provider](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/openai.py): `reverie/llm/openai.py`
- [DeepSeek provider](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/llm/deepseek.py): `reverie/llm/deepseek.py`

### Execution tools

- [File operations](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/files.py): `reverie/tools/files.py`
- [Host commands](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/shell.py): `reverie/tools/shell.py`
- [Browser automation](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/browser.py): `reverie/tools/browser.py`
- [Web search](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/tools/search.py): `reverie/tools/search.py`

### Runtime support

- [Configuration](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/config.py): `reverie/config.py`
- [Rotating logs](https://github.com/marshmallowneko/reveriecli/blob/main/reverie/logging.py): `reverie/logging.py`

### Other components

- **User**
- **Config file**
- **Model API**
- **Host workspace**
- **Web pages**
- **Bing search**

## Connections

- User → CLI and shell: starts task (evidence: `README.md`)
- CLI and shell → Configuration: loads settings (evidence: `reverie/main.py`)
- Configuration → Config file: reads and writes (evidence: `README.md`)
- CLI and shell → Autonomous loop: runs task (evidence: `reverie/main.py`)
- CLI and shell → Rich renderer: uses interface (evidence: `reverie/main.py`)
- CLI and shell → Command history: persists history (evidence: `README.md`)
- CLI and shell → Skill registry: manages skills (evidence: `reverie/main.py`)
- CLI and shell → Rotating logs: initializes logging (evidence: `reverie/main.py`)
- Autonomous loop → Context manager: manages context (evidence: `reverie/agent.py`)
- Autonomous loop → Provider factory: selects provider (evidence: `reverie/agent.py`)
- Autonomous loop → Skill registry: uses skills (evidence: `reverie/agent.py`)
- Autonomous loop → Rich renderer: renders responses (evidence: `reverie/agent.py`)
- Autonomous loop → Rotating logs: records activity (evidence: `reverie/agent.py`)
- Skill loader → Skill registry: registers skills (evidence: `reverie/skills/loader.py`)
- Skill loader → Built-in skills: loads built-ins (evidence: `reverie/skills/loader.py`)
- Provider factory → Anthropic provider: creates provider (evidence: `reverie/llm/factory.py`)
- Provider factory → OpenAI-compatible provider: creates provider (evidence: `reverie/llm/factory.py`)
- Provider factory → DeepSeek provider: creates provider (evidence: `reverie/llm/factory.py`)
- Anthropic provider → Provider interface: implements interface (evidence: `reverie/llm/anthropic.py`)
- OpenAI-compatible provider → Provider interface: implements interface (evidence: `reverie/llm/openai.py`)
- DeepSeek provider → Provider interface: implements interface (evidence: `reverie/llm/deepseek.py`)
- Anthropic provider → Model API: calls model API
- OpenAI-compatible provider → Model API: calls model API
- DeepSeek provider → Model API: calls model API
- Autonomous loop → File operations: dispatches tools (evidence: `reverie/agent.py`)
- Autonomous loop → Host commands: dispatches tools (evidence: `reverie/agent.py`)
- Autonomous loop → Browser automation: dispatches tools (evidence: `reverie/agent.py`)
- Autonomous loop → Web search: dispatches tools (evidence: `reverie/agent.py`)
- File operations → Host workspace: operates on files
- Host commands → Host workspace: runs host commands
- Browser automation → Web pages: automates pages
- Web search → Bing search: queries search (evidence: `reverie/tools/search.py`)
