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