# tesserato/codeweaver architecture

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

- Interactive diagram: https://gitdiagram.com/tesserato/codeweaver
- Repository: https://github.com/tesserato/codeweaver

## Overview

CodeWeaver is a CLI that scans a chosen directory, filters paths, and produces a Markdown document containing a file tree and file contents. Its documented options also support included/excluded path logs, a prepended instruction, and clipboard copying. The sampled source is partial, so some internal calls and output wiring are not visible; those relationships are omitted or marked unverified.

Main entry points: [`main.go`](https://github.com/tesserato/codeweaver/blob/main/main.go) (Markdown orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and Configuration"]
  node_flags["Flag parsing<br/>[main.go]"]
  node_pattern_compile["Regex compilation<br/>[main.go]"]
end

subgraph group_generation["Document Generation"]
  node_generator["Markdown orchestration<br/>[main.go]"]
  node_content_scan["Content scanning<br/>[main.go]"]
  node_path_filter["Path filtering<br/>[main.go]"]
  node_file_contents["File contents<br/>[main.go]"]
  node_tree_builder["File tree<br/>[main.go]"]
  node_markdown["Markdown document<br/>[main.go]"]
end

subgraph group_outputs["Output Options"]
  node_output_file["Output file<br/>[main.go]"]
  node_path_logs["Path log files<br/>[main.go]"]
  node_clipboard["Clipboard"]
end

node_user(("CLI user"))

node_user -->|"sets options"| node_flags
node_flags -->|"provides patterns"| node_pattern_compile
node_flags -->|"configures"| node_generator
node_pattern_compile -->|"provides matchers"| node_generator
node_generator -->|"builds content"| node_content_scan
node_content_scan -->|"filters paths"| node_path_filter
node_content_scan -->|"embeds contents"| node_file_contents
node_generator -->|"builds tree"| node_tree_builder
node_content_scan -->|"supplies paths"| node_tree_builder
node_generator -->|"assembles"| node_markdown
node_markdown -.->|"writes"| node_output_file
node_generator -.->|"records paths"| node_path_logs
node_markdown -.->|"copies optionally"| node_clipboard

click node_flags "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_pattern_compile "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_generator "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_content_scan "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_path_filter "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_file_contents "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_tree_builder "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_markdown "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_output_file "https://github.com/tesserato/codeweaver/blob/main/main.go"
click node_path_logs "https://github.com/tesserato/codeweaver/blob/main/main.go"

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_flags,node_pattern_compile,node_user toneBlue
class node_generator,node_content_scan,node_path_filter,node_file_contents,node_tree_builder,node_markdown toneAmber
class node_output_file,node_path_logs,node_clipboard toneMint
```

## Components

### CLI and Configuration

- [Flag parsing](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [Regex compilation](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`

### Document Generation

- [Markdown orchestration](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [Content scanning](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [Path filtering](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [File contents](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [File tree](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [Markdown document](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`

### Output Options

- [Output file](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- [Path log files](https://github.com/tesserato/codeweaver/blob/main/main.go): `main.go`
- **Clipboard**

### Other components

- **CLI user**

## Connections

- CLI user → Flag parsing: sets options (evidence: `README.md`)
- Flag parsing → Regex compilation: provides patterns (evidence: `main.go`)
- Flag parsing → Markdown orchestration: configures (evidence: `main.go`)
- Regex compilation → Markdown orchestration: provides matchers (evidence: `main.go`)
- Markdown orchestration → Content scanning: builds content (evidence: `main.go`)
- Content scanning → Path filtering: filters paths (evidence: `README.md`)
- Content scanning → File contents: embeds contents (evidence: `README.md`)
- Markdown orchestration → File tree: builds tree (evidence: `main.go`)
- Content scanning → File tree: supplies paths (evidence: `main.go`)
- Markdown orchestration → Markdown document: assembles (evidence: `main.go`)
- Markdown document → Output file: writes (evidence: `main.go`)
- Markdown orchestration → Path log files: records paths (evidence: `main.go`)
- Markdown document → Clipboard: copies optionally
