Crate sublime_cli_tools

Crate sublime_cli_tools 

Source
Expand description

§Workspace Tools CLI

A comprehensive command-line interface for managing Node.js workspaces and monorepos with changeset-based version management.

§What

This crate provides the workspace CLI tool that offers:

  • Configuration management (init, config)
  • Changeset workflow (changeset add, list, show, etc.)
  • Version bumping (bump)
  • Dependency upgrades (upgrade)
  • Audit and health checks (audit)
  • Change analysis (changes)

§How

The CLI is built using:

  • clap for argument parsing and command dispatch
  • tokio for async runtime
  • Internal crates (sublime-package-tools, sublime-standard-tools, sublime-git-tools)
  • Multiple output formats (human-readable, JSON, compact JSON)
  • Comprehensive error handling with user-friendly messages

§Why

This CLI provides a unified interface for managing complex Node.js workspaces, supporting both single-package repositories and monorepos with multiple versioning strategies. It follows a changeset-based workflow for better change tracking and version management.

§Examples

use sublime_cli_tools;

// The CLI is primarily used as a binary, but the library exports
// command execution functions for testing and integration purposes.

§Architecture

The crate is organized into the following modules:

  • cli: CLI definition, argument parsing, and command dispatch
  • commands: Command implementations
  • error: Error types and user-friendly error messages
  • output: Output formatting (human, JSON, tables, progress bars)
  • interactive: Interactive prompts and user input (future)
  • utils: Shared utilities (future)

Re-exports§

pub use cli::Cli;
pub use cli::Commands;
pub use cli::LogLevel;
pub use cli::OutputFormatArg;
pub use error::CliError;
pub use error::Result;
pub use interactive::prompts;
pub use output::JsonResponse;
pub use output::MultiProgress;
pub use output::OutputFormat;
pub use output::ProgressBar;
pub use output::Spinner;

Modules§

cli
CLI framework and argument parsing CLI framework module.
commands
Command implementations Command implementations module.
error
Error types and handling Error handling module for the CLI.
interactive
Interactive prompts and user input Interactive prompt module for CLI commands.
output
Output formatting and logging Output formatting and logging module.