ferric_ai/cli/
mod.rs

1use clap::{Parser, Subcommand};
2use std::path::PathBuf;
3
4// Import all help text constants
5pub mod main_help;
6
7use main_help::{CLI_ABOUT, CLI_LONG_ABOUT};
8use crate::commands::stats::{StatsCommands, STATS_LONG_ABOUT};
9
10/// LLM-friendly performance profiling tool for flamegraph analysis
11#[derive(Parser)]
12#[command(name = "ferric")]
13#[command(about = CLI_ABOUT)]
14#[command(long_about = CLI_LONG_ABOUT)]
15pub struct Cli {
16    /// Path to flamegraph SVG file or directory to analyze
17    #[arg(short = 'f', long = "flamegraph", help = "Flamegraph SVG file or directory to analyze")]
18    pub flamegraph: PathBuf,
19
20    /// Path to comparison flamegraph SVG file or directory (enables comparison mode)
21    #[arg(short = 'c', long = "compare", help = "Compare with this flamegraph file or directory")]
22    pub compare: Option<PathBuf>,
23
24    /// Command to execute
25    #[command(subcommand)]
26    pub command: Commands,
27}
28
29/// Available commands for flamegraph analysis
30#[derive(Subcommand)]
31pub enum Commands {
32    /// Pretty-print the call tree structure in human-readable format
33    #[command(name = "pretty-print", about = "Display the flamegraph as a formatted call tree")]
34    PrettyPrint,
35
36    /// Provide comprehensive guidance for LLMs working with flamegraph analysis
37    #[command(name = "llm-guide", about = "Provide LLM guidance and documentation for performance analysis")]
38    LlmGuide,
39
40    /// Generate statistical analysis of flamegraph characteristics for threshold configuration
41    #[command(name = "stats", about = "Analyze flamegraph statistics and performance characteristics")]
42    #[command(long_about = STATS_LONG_ABOUT)]
43    #[command(subcommand)]
44    Stats(StatsCommands),
45}