1use clap::{Parser, Subcommand};
4
5#[derive(Parser)]
6#[command(name = "prompt-store", version, about = "Encrypted prompts manager")]
7pub struct Cli {
8 #[command(subcommand)]
9 pub command: Cmd,
10}
11
12#[derive(Subcommand)]
13pub enum Cmd {
14 List {
16 #[arg(long, help = "Filter prompts by tag(s)")]
17 tag: Vec<String>,
18 },
19 New,
21 Get { id: String },
23 Edit { id: String },
25 Delete { id: String },
27 Rename {
29 id: String,
30 #[arg(long, help = "New title for the prompt")]
31 title: String,
32 },
33 Search {
35 query: String,
36 #[arg(long, help = "Filter by specific tag")]
37 tag: Option<String>,
38 #[arg(long, help = "Search in prompt content")]
39 content: bool,
40 },
41 #[command(about = "Tag a prompt with one or more tags")]
43 Tag { id: String, changes: Vec<String> },
44 Copy { id: String },
46 Run {
48 id: String,
49 #[arg(long = "var", help = "Variable assignments in key=value format")]
50 vars: Vec<String>,
51 },
52 Export {
54 #[arg(long, help = "Comma-separated list of prompt IDs to export")]
55 ids: Option<String>,
56 #[arg(long, help = "Output file path")]
57 out: String,
58 },
59 Import { file: String },
61 History { id: String },
63 Revert {
65 id: String,
66 #[arg(long, help = "Specific timestamp to revert to")]
67 timestamp: Option<String>,
68 },
69 RotateKey {
71 #[arg(long, help = "Protect the new key with a password")]
72 password: bool,
73 },
74 #[command(subcommand)]
76 Chain(ChainCmd),
77 #[command(subcommand)]
79 Pack(PackCmd),
80 Deploy {
82 repo_url: String,
84 #[arg(long)]
86 alias: Option<String>,
87 #[arg(long, env = "PROMPT_PACK_PASSWORD")]
89 password: Option<String>,
90 },
91 Update {
93 alias: Option<String>,
95 },
96 Stats,
98 Interactive,
100}
101
102#[derive(Subcommand)]
103pub enum ChainCmd {
104 New,
106 Edit { id: String },
108 AddStep { id: String },
110 RmStep {
112 #[arg(help = "The ID of the step to remove (e.g., mychain/1)")]
113 step_id: String,
114 },
115}
116
117#[derive(Subcommand)]
118pub enum PackCmd {
119 Export {
121 #[arg(long)]
123 workspace: Option<String>,
124 },
125}