etz 0.3.0

CLI for coordinating git worktrees across multi-repo parent directories.
Documentation
use clap::{Parser, Subcommand};

#[derive(Debug, Parser)]
#[command(name = "etz", about = "Multi-repo worktree manager")]
pub struct Cli {
    #[command(subcommand)]
    pub command: Commands,
}

#[derive(Debug, Subcommand)]
pub enum Commands {
    /// Initialize .etz metadata in the current directory
    Init,
    /// Add a coordinated workspace backed by git worktrees
    ///
    /// By default, new branches are created from each repo's default branch
    /// (main/master). Use --from-current to branch from whatever is currently
    /// checked out instead.
    Add {
        workspace: String,
        #[arg(long)]
        branch: String,
        /// Branch from each repo's currently checked-out branch instead of its default (main/master)
        #[arg(long, default_value_t = false)]
        from_current: bool,
        /// Copy .env* files from each source repo into its worktree
        #[arg(long, default_value_t = false)]
        copy_env: bool,
        /// Do not copy non-repo root files/directories into the workspace root
        #[arg(long, default_value_t = false)]
        no_copy_root: bool,
    },
    /// List known workspaces
    List,
    /// Re-discover direct-child repos and refresh manifest metadata
    Refresh {
        /// Show drift only without writing manifest
        #[arg(long)]
        check: bool,
        #[arg(long)]
        json: bool,
    },
    /// Show workspace status
    Status {
        workspace: Option<String>,
        /// Show only repos with changes
        #[arg(long)]
        changed: bool,
        /// Print condensed totals instead of per-repo lines
        #[arg(long)]
        summary: bool,
        #[arg(long)]
        json: bool,
    },
    /// Commit staged or tracked changes across all repos in a workspace
    Commit {
        workspace: Option<String>,
        #[arg(short = 'm', long, required_unless_present = "dry_run")]
        message: Option<String>,
        #[arg(long)]
        all: bool,
        #[arg(long)]
        dry_run: bool,
        #[arg(long)]
        json: bool,
    },
    /// Push ahead commits for repos in a workspace
    Push {
        workspace: Option<String>,
        #[arg(long)]
        dry_run: bool,
        #[arg(long)]
        json: bool,
    },
    /// Remove a workspace and its worktrees
    Remove {
        workspace: String,
        #[arg(long)]
        force: bool,
    },
    /// Prune stale git worktree metadata and reconcile state
    Prune,
    /// Validate metadata and detect inconsistencies
    Doctor {
        #[arg(long)]
        fix: bool,
        #[arg(long)]
        json: bool,
    },
}