How pet1h/memplace works
Mem is a terminal command saver and fuzzy searcher. The user invokes the CLI, whose entry point resolves the data-file path, loads saved commands, and dispatches either the save or search workflow. Saving collects a description and persists a record; searching ranks records by string distance, opens a keyboard-driven TUI, and prints the selected command. The README documents the cross-platform JSON data file and these capabilities. Edges reflect the shown calls; the file store is external to the source tree.
Main entry points: main.rs CLI dispatcher · save.rs Save command · search.rs Search command · tui.rs Result selector
Components 11
CLI entry
- CLI dispatcher
src/main.rs - Data path config
src/config.rs
Save workflow
- Save command
src/commands/save.rs - Description prompt
src/commands/save.rs
Search workflow
- Search command
src/commands/search.rs - Fuzzy ranking
src/storage.rs - Result selector
src/tui.rs
Data layer
- JSON persistence
src/storage.rs - JSON data file
Other components
- CLI user
- Terminal output
Connections 12
- CLI user → CLI dispatcher: invokes
README.md - CLI dispatcher → Data path config: gets data path
src/main.rs - CLI dispatcher → JSON persistence: loads records
src/main.rs - CLI dispatcher → Save command: dispatches save
src/main.rs - CLI dispatcher → Search command: dispatches search
src/main.rs - Save command → Description prompt: prompts for
src/commands/save.rs - Save command → JSON persistence: creates and writes
src/commands/save.rs - Search command → Fuzzy ranking: ranks records
src/commands/search.rs - Search command → Result selector: opens selector
src/commands/search.rs - Result selector → Terminal output: renders and reads keys
src/tui.rs - Result selector → Terminal output: prints selection
src/tui.rs - JSON persistence → JSON data file: reads and writes
src/storage.rs