sublime_cli_tools/lib.rs
1//! # Workspace Tools CLI
2//!
3//! A comprehensive command-line interface for managing Node.js workspaces and monorepos
4//! with changeset-based version management.
5//!
6//! ## Supported Platforms
7//!
8//! - macOS (Apple Silicon and Intel)
9//! - Linux (x64 glibc, x64 musl, ARM64 glibc)
10//! - Windows (x64)
11//!
12//! ## What
13//!
14//! This crate provides the `workspace` CLI tool that offers:
15//! - Configuration management (`init`, `config`)
16//! - Changeset workflow (`changeset add`, `list`, `show`, etc.)
17//! - Version bumping (`bump`)
18//! - Dependency upgrades (`upgrade`)
19//! - Audit and health checks (`audit`)
20//! - Change analysis (`changes`)
21//!
22//! ## How
23//!
24//! The CLI is built using:
25//! - `clap` for argument parsing and command dispatch
26//! - `tokio` for async runtime
27//! - Internal crates (`sublime-package-tools`, `sublime-standard-tools`, `sublime-git-tools`)
28//! - Multiple output formats (human-readable, JSON, compact JSON)
29//! - Comprehensive error handling with user-friendly messages
30//!
31//! ## Why
32//!
33//! This CLI provides a unified interface for managing complex Node.js workspaces,
34//! supporting both single-package repositories and monorepos with multiple versioning
35//! strategies. It follows a changeset-based workflow for better change tracking and
36//! version management.
37//!
38//! ## Examples
39//!
40//! ```rust,no_run
41//! use sublime_cli_tools;
42//!
43//! // The CLI is primarily used as a binary, but the library exports
44//! // command execution functions for testing and integration purposes.
45//! ```
46//!
47//! ## Architecture
48//!
49//! The crate is organized into the following modules:
50//! - `cli`: CLI definition, argument parsing, and command dispatch
51//! - `commands`: Command implementations
52//! - `error`: Error types and user-friendly error messages
53//! - `output`: Output formatting (human, JSON, tables, progress bars)
54//! - `interactive`: Interactive prompts and user input (future)
55//! - `utils`: Shared utilities (future)
56
57#![doc = include_str!("../README.md")]
58#![warn(missing_docs)]
59#![warn(rustdoc::missing_crate_level_docs)]
60#![deny(unused_must_use)]
61#![deny(clippy::unwrap_used)]
62#![deny(clippy::expect_used)]
63// TODO: Re-enable after all commands are implemented
64// #![deny(clippy::todo)]
65#![deny(clippy::unimplemented)]
66#![deny(clippy::panic)]
67
68// Module declarations
69// Note: Modules are created as stubs and will be implemented in subsequent stories
70
71/// CLI framework and argument parsing
72pub mod cli;
73
74/// Command implementations
75pub mod commands;
76
77/// Error types and handling
78pub mod error;
79
80/// Output formatting and logging
81pub mod output;
82
83/// Interactive prompts and user input
84pub mod interactive;
85
86/// Utility modules
87pub(crate) mod utils;
88
89// Re-exports for convenience
90pub use cli::{Cli, Commands, LogLevel, OutputFormatArg};
91pub use error::{CliError, Result};
92pub use interactive::prompts;
93pub use output::{JsonResponse, MultiProgress, OutputFormat, ProgressBar, Spinner};