Skip to main content

Crate calcli

Crate calcli 

Source
Expand description

calcli - a fast terminal calculator (TUI) with history, variables and engineering helpers.

The crate is organized into layers: domain holds the pure calculator core, services orchestrates it, storage and config handle persistence and settings, tui is the Ratatui front-end and util gathers stateless helpers. keymap is the single source for key bindings, shared by the TUI dispatch and the shortcut hints. The binary wires them together in main.rs.

Modules§

config
User-facing configuration.
demo
Sample data for the --demo launch flag.
domain
The calculator core: errors, evaluation, expression preprocessing, number formatting, variables and history. This layer is pure (no I/O) and holds the single source of truth for how calcli computes and renders values.
keymap
Configurable key bindings for the app’s own shortcuts.
services
The service layer: stateful orchestration of the domain core, free of I/O.
storage
The persistence layer: a StateRepository port and its TOML implementation, decoupling the rest of the app from the on-disk format.
theme
Colours, glyphs, palettes and skins come from the shared TUI toolkit, so crate::theme stays the one path the rest of the crate reaches for. Framework-agnostic theming: colors, palette, glyphs and themes.
tui
The Ratatui front-end.
util
Shared, stateless helpers: atomic writes, paths and logging.

Constants§

APP_ABOUT
A one-line description of the application.
APP_NAME
The application name, used for paths, the brand and the env prefix.
APP_VERSION
The application version, shown in the help overlay.