use clap::Parser;
use std::path::PathBuf;
#[derive(Debug, Clone, Parser)]
pub enum ProfileAction {
#[command(
about = "Initialize project with a profile",
after_help = "Examples:\n codanna profile init claude\n codanna profile init claude --source ~/.codanna/profiles"
)]
Init {
profile_name: String,
#[arg(long)]
source: Option<PathBuf>,
#[arg(short, long)]
force: bool,
},
#[command(
about = "Install a profile to current workspace",
after_help = "Examples:\n codanna profile install claude\n codanna profile install claude --source git@github.com:codanna/profiles.git"
)]
Install {
profile_name: String,
#[arg(long)]
source: Option<String>,
#[arg(long)]
r#ref: Option<String>,
#[arg(short, long)]
force: bool,
},
#[command(
about = "List available profiles",
after_help = "Example:\n codanna profile list\n codanna profile list --verbose"
)]
List {
#[arg(short, long)]
verbose: bool,
#[arg(long)]
json: bool,
},
#[command(
about = "Show active profile and installation status",
after_help = "Example:\n codanna profile status"
)]
Status {
#[arg(short, long)]
verbose: bool,
},
#[command(
about = "Register providers and install profiles from team configuration",
after_help = "Examples:\n codanna profile sync\n codanna profile sync --force"
)]
Sync {
#[arg(short, long)]
force: bool,
},
#[command(
about = "Update an installed profile from its provider",
after_help = "Examples:\n codanna profile update codanna\n codanna profile update codanna --force"
)]
Update {
profile_name: String,
#[arg(short, long)]
force: bool,
},
#[command(
about = "Remove an installed profile from workspace",
after_help = "Examples:\n codanna profile remove codanna\n codanna profile remove codanna --verbose"
)]
Remove {
profile_name: String,
#[arg(short, long)]
verbose: bool,
},
#[command(
about = "Manage profile providers",
after_help = "Examples:\n codanna profile provider add codanna/claude-provider\n codanna profile provider add ./my-provider --id custom\n codanna profile provider list\n codanna profile provider list --verbose\n codanna profile provider remove claude-provider"
)]
Provider {
#[command(subcommand)]
action: ProviderAction,
},
#[command(
about = "Verify profile integrity",
after_help = "Examples:\n codanna profile verify claude\n codanna profile verify --all\n codanna profile verify --all --verbose"
)]
Verify {
profile_name: Option<String>,
#[arg(long, conflicts_with = "profile_name")]
all: bool,
#[arg(short, long)]
verbose: bool,
},
}
#[derive(Debug, Clone, Parser)]
pub enum ProviderAction {
#[command(
about = "Add a provider to the global registry",
after_help = "Examples:\n codanna profile provider add codanna/claude-provider\n codanna profile provider add https://github.com/codanna/profiles.git\n codanna profile provider add ./my-provider --id custom"
)]
Add {
source: String,
#[arg(long)]
id: Option<String>,
},
#[command(
about = "Remove a provider from the global registry",
after_help = "Example:\n codanna profile provider remove claude-provider"
)]
Remove {
provider_id: String,
},
#[command(
about = "List registered providers",
after_help = "Examples:\n codanna profile provider list\n codanna profile provider list --verbose"
)]
List {
#[arg(short, long)]
verbose: bool,
},
}