romm_cli/lib.rs
1//! # romm-cli
2//!
3//! `romm-cli` is a powerful command-line interface and terminal user interface (TUI)
4//! for interacting with the [RomM](https://github.com/romm-apps/romm) API.
5//!
6//! It provides tools for:
7//! - Browsing and searching your ROM collection.
8//! - Downloading ROMs and game saves.
9//! - Uploading new ROMs and saves.
10//! - Managing server-side tasks (library scans, etc.).
11//! - Securely managing authentication via the OS keyring.
12//!
13//! ## Quick Start
14//!
15//! Most users will interact with the crate through the `romm-cli` binary.
16//! For library consumers, the core entry point is the [`client::RommClient`].
17//!
18//! ```no_run
19//! use romm_cli::config::load_config;
20//! use romm_cli::client::RommClient;
21//! use romm_cli::error::RommError;
22//!
23//! #[tokio::main]
24//! async fn main() -> Result<(), RommError> {
25//! let config = load_config()?;
26//! let client = RommClient::new(&config, false)?;
27//!
28//! let version = client.rom_server_version_from_heartbeat().await;
29//! println!("Connected to RomM server version: {:?}", version);
30//!
31//! Ok(())
32//! }
33//! ```
34
35/// CLI output presentation (color, progress, JSON vs text).
36pub mod cli_presentation;
37/// HTTP client implementation for the RomM API.
38pub mod client;
39/// CLI command handlers.
40pub mod commands;
41/// Configuration and authentication management.
42pub mod config;
43/// Internal core logic and shared utilities.
44pub mod core;
45/// Type-safe API endpoint definitions.
46pub mod endpoints;
47/// Typed error hierarchy (`ApiError`, `ConfigError`, `DownloadError`, `RommError`).
48pub mod error;
49/// Redaction helpers for tracing output (no secrets in logs).
50pub mod log_redact;
51pub use error::exit;
52/// Feature compatibility helpers based on OpenAPI endpoint availability.
53pub mod feature_compat;
54/// Frontend-specific logic (shared between CLI and TUI).
55pub mod frontend;
56/// OpenAPI parsing and endpoint lookup helpers.
57pub mod openapi;
58/// TUI implementation (requires the `tui` feature).
59#[cfg(feature = "tui")]
60pub mod tui;
61/// Shared data models and types.
62pub mod types;
63/// Auto-update logic.
64pub mod update;