1use clap::{Parser, Subcommand};
7use std::path::{Path, PathBuf};
8
9mod commands;
10pub mod error;
11mod output;
12pub mod pipe;
13
14pub use error::CliError;
15
16pub mod qa_types {
18 pub use crate::commands::qa::{GateResult, QaReport, SystemInfo};
19}
20
21pub mod model_pull {
23 pub use crate::commands::pull::{list, run};
24}
25
26#[cfg(feature = "inference")]
27pub mod federation;
28
29use commands::{
31 bench, canary, canary::CanaryCommands, cbtop, chat, compare_hf, compile, convert, data, debug,
32 diagnose, diff, distill, eval, explain, export, flow, hex, import, inspect, lint, merge,
33 oracle, pipeline, probar, profile, prune, ptx_explain, publish, pull, qa, qualify, quantize,
34 rosetta, rosetta::RosettaCommands, run, serve, showcase, tensors, tokenize, trace, tree, tui,
35 validate,
36};
37#[cfg(feature = "training")]
38use commands::{finetune, gpu, train, tune};
39
40#[derive(Parser, Debug)]
45#[command(name = "apr")]
46#[command(author, version = concat!(env!("CARGO_PKG_VERSION"), " (", env!("APR_GIT_SHA"), ")"), about, long_about = None)]
47#[command(propagate_version = true)]
48pub struct Cli {
49 #[command(subcommand)]
50 pub command: Box<Commands>,
51
52 #[arg(long, global = true)]
54 pub json: bool,
55
56 #[arg(short, long, global = true)]
58 pub verbose: bool,
59
60 #[arg(short, long, global = true)]
62 pub quiet: bool,
63
64 #[arg(long, global = true)]
66 pub offline: bool,
67
68 #[arg(long, global = true)]
70 pub skip_contract: bool,
71}
72
73include!("commands_enum.rs");
74include!("model_ops_commands.rs");
75include!("extended_commands.rs");
76include!("tool_commands.rs");
77include!("data_commands.rs");
78#[cfg(feature = "training")]
79include!("train_commands.rs");
80include!("serve_commands.rs");
81include!("tokenize_commands.rs");
82include!("pipeline_commands.rs");
83include!("validate.rs");
84include!("dispatch_run.rs");
85include!("dispatch.rs");
86include!("dispatch_analysis.rs");
87include!("lib_07.rs");