# cordovat-dev/chuleta architecture

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

- Interactive diagram: https://gitdiagram.com/cordovat-dev/chuleta
- Repository: https://github.com/cordovat-dev/chuleta

## Overview

Chuleta is a Linux/Unix CLI for searching and maintaining plain-text cheat-sheets arranged in a topic directory tree. Its documented core flow is to index that tree into SQLite full-text search and let a user search, preview, and modify the files. The README also describes Bash completion, optional Git-based incremental updates, and rotating database backups. No source excerpts were provided, so relationships below are limited to those stated in the README; paths for undocumented subsystem implementations are omitted where uncertain.

Main entry points: [`main.sh`](https://github.com/cordovat-dev/chuleta/blob/master/main.sh) (Chuleta CLI), [`chuletas_fts_db_schema.sql`](https://github.com/cordovat-dev/chuleta/blob/master/chuletas_fts_db_schema.sql) (FTS database), [`gac.sh`](https://github.com/cordovat-dev/chuleta/blob/master/gac.sh) (Git-based updater), [`chu.auto`](https://github.com/cordovat-dev/chuleta/blob/master/chu.auto) (Bash completion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI experience"]
  node_cli["Chuleta CLI<br/>[main.sh]"]
  node_results["Search results"]
  node_completion["Bash completion<br/>[chu.auto]"]
end

subgraph group_indexing["Indexing and storage"]
  node_sheets["Cheat-sheet tree"]
  node_indexing["Text indexing"]
  node_fts[("FTS database")]
end

subgraph group_maintenance["Index maintenance"]
  node_gitupdate["Git-based updater<br/>[gac.sh]"]
  node_backups["Rotating backups"]
end

node_user(("CLI user"))
node_editor["Default text editor"]

node_user -->|"searches or edits"| node_cli
node_cli -->|"uses as entry point"| node_sheets
node_sheets -->|"provides text files"| node_indexing
node_indexing -->|"writes full-text index"| node_fts
node_cli -->|"searches"| node_fts
node_cli -->|"shows previews"| node_results
node_cli -->|"opens results"| node_editor
node_cli -->|"offers topic completion"| node_completion
node_gitupdate -.->|"partially updates"| node_fts
node_fts -.->|"backs up on update"| node_backups

click node_cli "https://github.com/cordovat-dev/chuleta/blob/master/main.sh"
click node_fts "https://github.com/cordovat-dev/chuleta/blob/master/chuletas_fts_db_schema.sql"
click node_completion "https://github.com/cordovat-dev/chuleta/blob/master/chu.auto"
click node_gitupdate "https://github.com/cordovat-dev/chuleta/blob/master/gac.sh"

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_results,node_completion,node_user toneBlue
class node_sheets,node_indexing,node_fts toneAmber
class node_gitupdate,node_backups toneMint
class node_editor toneIndigo
```

## Components

### CLI experience

- [Chuleta CLI](https://github.com/cordovat-dev/chuleta/blob/master/main.sh): `main.sh`
- **Search results**
- [Bash completion](https://github.com/cordovat-dev/chuleta/blob/master/chu.auto): `chu.auto`

### Indexing and storage

- **Cheat-sheet tree**
- **Text indexing**
- [FTS database](https://github.com/cordovat-dev/chuleta/blob/master/chuletas_fts_db_schema.sql): `chuletas_fts_db_schema.sql`

### Index maintenance

- [Git-based updater](https://github.com/cordovat-dev/chuleta/blob/master/gac.sh): `gac.sh`
- **Rotating backups**

### Other components

- **CLI user**
- **Default text editor**

## Connections

- CLI user → Chuleta CLI: searches or edits (evidence: `README.md`)
- Chuleta CLI → Cheat-sheet tree: uses as entry point (evidence: `README.md`)
- Cheat-sheet tree → Text indexing: provides text files (evidence: `README.md`)
- Text indexing → FTS database: writes full-text index (evidence: `README.md`)
- Chuleta CLI → FTS database: searches (evidence: `README.md`)
- Chuleta CLI → Search results: shows previews (evidence: `README.md`)
- Chuleta CLI → Default text editor: opens results (evidence: `README.md`)
- Chuleta CLI → Bash completion: offers topic completion (evidence: `README.md`)
- Git-based updater → FTS database: partially updates (evidence: `README.md`)
- FTS database → Rotating backups: backs up on update (evidence: `README.md`)
