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#![doc = include_str!("../README.md")]
52#![warn(missing_docs)]
53#![warn(rustdoc::missing_crate_level_docs)]
54#![deny(unused_must_use)]
55#![deny(clippy::unwrap_used)]
56#![deny(clippy::expect_used)]
57// TODO: Re-enable after all commands are implemented
58// #![deny(clippy::todo)]
59#![deny(clippy::unimplemented)]
60#![deny(clippy::panic)]
61
62// Module declarations
63// Note: Modules are created as stubs and will be implemented in subsequent stories
64
65/// CLI framework and argument parsing
66pub mod cli;
67
68/// Command implementations
69pub mod commands;
70
71/// Error types and handling
72pub mod error;
73
74/// Output formatting and logging
75pub mod output;
76
77/// Interactive prompts and user input
78pub mod interactive;
79
80/// Utility modules
81pub(crate) mod utils;
82
83// Re-exports for convenience
84pub use cli::{Cli, Commands, LogLevel, OutputFormatArg};
85pub use error::{CliError, Result};
86pub use interactive::prompts;
87pub use output::{JsonResponse, MultiProgress, OutputFormat, ProgressBar, Spinner};