1use clap::{Parser, Subcommand, ValueEnum};
2use std::path::PathBuf;
3
4#[derive(Parser, Debug)]
5#[command(name = "mermaid")]
6#[command(version = "0.1.0")]
7#[command(about = "An open-source, model-agnostic AI pair programmer", long_about = None)]
8pub struct Cli {
9 #[arg(short, long)]
11 pub model: Option<String>,
12
13 #[arg(short, long)]
15 pub path: Option<PathBuf>,
16
17 #[arg(short, long)]
19 pub verbose: bool,
20
21 #[arg(long, conflicts_with = "continue_session")]
23 pub sessions: bool,
24
25 #[arg(long = "continue", conflicts_with = "sessions")]
27 pub continue_session: bool,
28
29 #[command(subcommand)]
30 pub command: Option<Commands>,
31}
32
33#[derive(Subcommand, Debug)]
34pub enum Commands {
35 Init,
37 List,
39 Chat,
41 Version,
43 Status,
45 Run {
47 prompt: String,
49
50 #[arg(short, long, value_enum, default_value_t = OutputFormat::Text)]
52 format: OutputFormat,
53
54 #[arg(long)]
56 max_tokens: Option<usize>,
57
58 #[arg(long)]
60 no_execute: bool,
61 },
62}
63
64#[derive(Debug, Clone, Copy, ValueEnum)]
65pub enum OutputFormat {
66 Text,
68 Json,
70 Markdown,
72}