partiri-cli 0.1.8

Partiri CLI — Deploy and manage services on Partiri Cloud
use clap::{Parser, Subcommand};

#[derive(Parser)]
#[command(
    name = "partiri",
    version,
    about = "Deploy and manage services on Partiri Cloud",
    long_about = None,
)]
pub struct Cli {
    #[command(subcommand)]
    pub command: Commands,
}

#[derive(Subcommand)]
pub enum Commands {
    /// Configure your Partiri API key
    Auth,
    /// Run the interactive setup wizard and create .partiri.jsonc
    Init,
    /// Validate the local .partiri.jsonc config file
    Validate,
    /// Service management
    #[command(subcommand)]
    Service(ServiceCommands),
    /// Project management
    #[command(subcommand)]
    Projects(ProjectCommands),
    /// Workspace management
    #[command(subcommand)]
    Workspaces(WorkspaceCommands),
    /// Install or remove the Partiri MCP server in AI tools
    #[command(subcommand)]
    Mcp(McpCommands),
}

#[derive(Subcommand)]
pub enum McpCommands {
    /// Install the Partiri MCP server into an AI tool
    Install {
        /// Target client (claude-desktop, claude-code, cursor, vscode, copilot-cli, windsurf)
        #[arg(long)]
        client: Option<String>,
    },
    /// Remove the Partiri MCP server from an AI tool
    Uninstall {
        /// Target client (claude-desktop, claude-code, cursor, vscode, copilot-cli, windsurf)
        #[arg(long)]
        client: Option<String>,
    },
}

#[derive(Subcommand)]
pub enum ServiceCommands {
    /// Register the service on Partiri and update .partiri.jsonc
    Create,
    /// Pull an existing service and save it as .partiri.jsonc
    Pull,
    /// Push local config changes to the existing service
    Push,
    /// Show current service metrics and recent jobs
    Metrics,
    /// Show the last 35 log lines from the past hour
    Logs,
    /// List jobs for this service
    Jobs,
    /// Trigger a deploy job
    Deploy,
    /// Pause the service
    Pause,
    /// Resume a paused service
    Unpause,
    /// Kill the service (requires confirmation)
    Kill,
    /// Fill in workspace, project, region and pod UUIDs interactively
    Link,
    /// Link an authentication token to this service (for private repositories or registries)
    Token,
}

#[derive(Subcommand)]
pub enum ProjectCommands {
    /// List all projects in a workspace
    List,
    /// Create a new project in a workspace
    Create,
}

#[derive(Subcommand)]
pub enum WorkspaceCommands {
    /// List all workspaces
    List,
}