use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "prompt-store", version, about = "Encrypted prompts manager")]
pub struct Cli {
#[command(subcommand)]
pub command: Cmd,
}
#[derive(Subcommand)]
pub enum Cmd {
List {
#[arg(long, help = "Filter prompts by tag(s)")]
tag: Vec<String>,
},
New,
Get { id: String },
Edit { id: String },
Delete { id: String },
Rename {
id: String,
#[arg(long, help = "New title for the prompt")]
title: String,
},
Search {
query: String,
#[arg(long, help = "Filter by specific tag")]
tag: Option<String>,
#[arg(long, help = "Search in prompt content")]
content: bool,
},
#[command(about = "Tag a prompt with one or more tags")]
Tag { id: String, changes: Vec<String> },
Copy { id: String },
Run {
id: String,
#[arg(long = "var", help = "Variable assignments in key=value format")]
vars: Vec<String>,
},
Export {
#[arg(long, help = "Comma-separated list of prompt IDs to export")]
ids: Option<String>,
#[arg(long, help = "Output file path")]
out: String,
},
Import { file: String },
History { id: String },
Revert {
id: String,
#[arg(long, help = "Specific timestamp to revert to")]
timestamp: Option<String>,
},
RotateKey {
#[arg(long, help = "Protect the new key with a password")]
password: bool,
},
#[command(subcommand)]
Chain(ChainCmd),
#[command(subcommand)]
Pack(PackCmd),
Deploy {
repo_url: String,
#[arg(long)]
alias: Option<String>,
#[arg(long, env = "PROMPT_PACK_PASSWORD")]
password: Option<String>,
},
Update {
alias: Option<String>,
},
Stats,
Interactive,
}
#[derive(Subcommand)]
pub enum ChainCmd {
New,
Edit { id: String },
AddStep { id: String },
RmStep {
#[arg(help = "The ID of the step to remove (e.g., mychain/1)")]
step_id: String,
},
}
#[derive(Subcommand)]
pub enum PackCmd {
Export {
#[arg(long)]
workspace: Option<String>,
},
}