Skip to main content

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/// HTTP client implementation for the RomM API.
36pub mod client;
37/// CLI command handlers.
38pub mod commands;
39/// Configuration and authentication management.
40pub mod config;
41/// Internal core logic and shared utilities.
42pub mod core;
43/// Type-safe API endpoint definitions.
44pub mod endpoints;
45/// Typed error hierarchy (`ApiError`, `ConfigError`, `DownloadError`, `RommError`).
46pub mod error;
47/// Feature compatibility helpers based on OpenAPI endpoint availability.
48pub mod feature_compat;
49/// Frontend-specific logic (shared between CLI and TUI).
50pub mod frontend;
51/// OpenAPI parsing and endpoint lookup helpers.
52pub mod openapi;
53/// TUI implementation (requires the `tui` feature).
54#[cfg(feature = "tui")]
55pub mod tui;
56/// Shared data models and types.
57pub mod types;
58/// Auto-update logic.
59pub mod update;