How yannjor/krabby works
High-Level Architectural Components
a. CLI Layer
• Entry point (src/main.rs)
• Argument parsing & subcommand dispatch (e.g. list, name, random) using a CLI library (likely clap)
b. Business Logic Layer
• Command handlers (in src/main.rs or delegated to modules)
• Pokémon selection logic (src/pokemon.rs): reading filters, randomization, name lookup
c. Data Access Layer
• Static assets:
• Text-based sprites under assets/colorscripts/{regular,shiny}/…
• Metadata in assets/pokemon.json
• Configuration management (src/config.rs): load or write a TOML file in the user’s config directory
d. Output Formatting Layer
• Error handling (src/error.rs)
Relationships & Data Flows
• User invokes krabby from terminal → CLI Layer
• CLI Layer parses arguments and calls into Business Logic
• Business Logic consults:
• Config Module to load language, shiny probability
• Data Access to retrieve the appropriate sprite and JSON entry
• Errors bubble up to Error Handler → STDERR
Key Architectural Patterns & Principles
• Layered architecture (CLI → Logic → Data → Output)
• Separation of concerns: each Rust module focuses on one responsibility
• Static resource bundling: assets directory kept alongside the binary (or embedded) for offline use
• Configuration file per XDG spec, enabling extensibility
Technologies & Frameworks
• Rust toolchain & Cargo
• CLI parsing crate (e.g., clap)
• serde/serde_json for JSON
• toml crate for config