Skip to main content

rec/
lib.rs

1// Pedantic lints — enabled globally, with pragmatic exceptions
2#![warn(clippy::pedantic)]
3// These are noisy in a CLI app and don't improve readability or safety:
4#![allow(clippy::module_name_repetitions)] // e.g. RecError in rec::error is fine
5#![allow(clippy::struct_excessive_bools)] // CLI option structs legitimately have many bools
6#![allow(clippy::too_many_lines)] // will be addressed when main.rs is refactored
7#![allow(clippy::cast_possible_truncation)] // u64→u32 etc. are intentional in duration/size calcs
8#![allow(clippy::cast_sign_loss)] // f64→u64 for timestamps is intentional
9#![allow(clippy::cast_precision_loss)] // u64→f64 for display purposes is acceptable
10#![allow(clippy::cast_possible_wrap)] // usize→i64 is intentional
11#![allow(clippy::similar_names)] // short variable names in tight scopes are fine
12#![allow(clippy::unreadable_literal)] // timestamp literals like 1700000000.0 are clearer without separators
13
14//! # rec — CLI Terminal Recorder
15//!
16//! `rec` is a command-line tool for recording, replaying, and exporting terminal
17//! sessions. It captures commands as you work and lets you export them to
18//! executable formats like bash scripts, Makefiles, and CI/CD pipelines.
19//!
20//! ## Architecture
21//!
22//! - [`cli`] — Command-line argument parsing and dispatch (clap-based)
23//! - [`config`] — Configuration loading and management (TOML-based)
24//! - [`recording`] — Session recording lifecycle (start/stop/status/hook)
25//! - [`session`] — Session data model and storage operations
26//! - [`storage`] — XDG-compliant filesystem paths and persistence
27//! - [`replay`] — Command replay engine with safety controls
28//! - [`export`] — Multi-format export (bash, makefile, markdown, etc.)
29//! - [`import`] — Import sessions from shell history files
30//! - [`doctor`] — Diagnostic checks for installation health
31//! - [`hooks`] — Shell hook scripts for bash, zsh, and fish
32//! - [`error`] — Error types with semantic exit codes
33//! - [`models`] — Shared data models (sessions, commands, config)
34//! - [`demo`] — Demo session generation for testing
35
36pub mod cli;
37pub mod config;
38pub mod demo;
39pub mod doctor;
40pub mod error;
41pub mod export;
42pub mod hooks;
43pub mod import;
44pub mod models;
45pub mod recording;
46pub mod replay;
47pub mod session;
48pub mod storage;
49
50#[cfg(feature = "tui")]
51pub mod tui;