This project is organized as a Cargo workspace with three crates:
plaintextlabs/
├── Cargo.toml # Workspace root
├── plaintextlabs-core/ # Shared library
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs # Re-exports all modules
│ ├── types.rs # Data structures
│ ├── parser.rs # .lab file parser
│ ├── query.rs # Query language
│ └── trends.rs # Trend analysis & charts
├── plaintextlabs-cli/ # Command-line interface
│ ├── Cargo.toml
│ └── src/
│ └── main.rs # CLI entry point
└── plaintextlabs-tui/ # Terminal UI (ratatui)
├── Cargo.toml
└── src/
└── main.rs # TUI entry point
cargo build --workspace --release# CLI only
cargo build --release -p plaintextlabs
# TUI only
cargo build --release -p plaintextlabs-tui
# Core library only
cargo build --release -p plaintextlabs-core# From workspace root
cargo run --release -p plaintextlabs -- sample.lab
# Or directly
./target/release/plaintextlabs sample.lab# From workspace root
cargo run --release -p plaintextlabs-tui -- sample.lab
# Or directly
./target/release/plaintextlabs-tui sample.labThe core library (plaintextlabs-core) contains all the shared logic:
- Parsing .lab files
- Query language evaluation
- Trend analysis and statistics
- Chart generation
Both the CLI and TUI import and use this library, ensuring consistent behavior and avoiding code duplication.
- Core:
owo-colors,textplots(for trends) - CLI: Core +
tabled(tables),windows-sys(Windows console colors) - TUI: Core +
ratatui,crossterm(terminal UI)