1mod app;
2mod evaluate;
3mod inference_policy;
4mod llm;
5mod misc;
6mod qpu;
7mod science;
8mod solid;
9mod solve;
10mod webizen;
11
12pub use app::AppAction;
13pub use evaluate::EvaluateModality;
14pub use inference_policy::InferencePolicyAction;
15pub use llm::LlmAction;
16pub use misc::*;
17pub use qpu::QpuAction;
18pub use science::{
19 BioAction, ChemAction, ClinicalAction, EconomicsAction, GeoAction, GeometricAction,
20 ScienceAction, ThermoAction,
21};
22pub use solid::SolidAction;
23pub use solve::{
24 LinalgAction, OdeAction, OptimizeAction, QuantumSolveAction, SolveAction, SymbolicSolveAction,
25};
26pub use webizen::WebizenAction;
27
28use clap::{Parser, Subcommand, ValueEnum};
29use std::path::PathBuf;
30
31use crate::{daemon, mcp, mesh, service, shader};
32
33#[derive(Parser, Debug)]
37#[command(name = "qualia-cli", version = "0.0.12", author = "Qualia-DB")]
38#[command(about = "Manage, query, and evaluate Qualia-DB vaults and models", long_about = None)]
39pub struct Cli {
40 #[arg(short, long, action = clap::ArgAction::Count, global = true)]
41 pub verbose: u8,
42
43 #[arg(long, global = true)]
44 pub enable_qpu: bool,
45
46 #[command(subcommand)]
47 pub command: Commands,
48}
49
50#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, ValueEnum)]
52pub enum ImportProgressFormat {
53 #[default]
54 Text,
55 Json,
56 None,
57}
58
59#[derive(Subcommand, Debug)]
60pub enum Commands {
61 InferencePolicy {
63 #[arg(long)]
64 profile: PathBuf,
65 #[command(subcommand)]
66 action: InferencePolicyAction,
67 },
68 App {
70 #[command(subcommand)]
71 action: AppAction,
72 },
73 Extension {
74 #[command(subcommand)]
75 action: ExtensionAction,
76 },
77 Evaluate {
78 #[command(subcommand)]
79 modality: EvaluateModality,
80 },
81 Governance {
82 #[command(subcommand)]
83 action: GovernanceAction,
84 },
85 Compile {
86 #[command(subcommand)]
87 action: CompileAction,
88 },
89 EntityCompile(EntityCompileArgs),
91 TwinCompile(TwinCompileArgs),
93 EntityVerify(EntityVerifyArgs),
95 TwinVerify(TwinVerifyArgs),
97 Llm {
98 #[command(subcommand)]
99 action: LlmAction,
100 },
101 Shader {
102 #[command(subcommand)]
103 action: shader::ShaderAction,
104 },
105 MeshProbe {
106 #[command(subcommand)]
107 action: mesh::MeshAction,
108 },
109 Capabilities {
110 #[arg(long, help = "List all registered capabilities")]
111 list: bool,
112 },
113 Shacl {
114 #[command(subcommand)]
115 action: ShaclAction,
116 },
117 Vault {
118 #[arg(long, help = "Initialize the memory-mapped storage vault")]
119 init: bool,
120 },
121 Migrate {
122 #[command(subcommand)]
123 action: MigrateAction,
124 },
125 Mem {
126 #[arg(long, help = "Triggers the Block Inspector to read hex layouts")]
127 inspect: bool,
128 },
129 Inspect {
130 file_path: PathBuf,
131 },
132 Q42 {
133 #[command(subcommand)]
134 action: Q42Action,
135 },
136 Hmc {
138 #[command(subcommand)]
139 action: HmcAction,
140 },
141 Dump {
142 out_path: PathBuf,
143 },
144 Daemon {
145 #[command(subcommand)]
146 action: Option<daemon::DaemonAction>,
147 #[command(flatten)]
148 opts: daemon::DaemonOpts,
149 },
150 Mcp {
151 #[command(subcommand)]
152 action: mcp::McpAction,
153 },
154 Service {
155 #[command(subcommand)]
156 action: service::ServiceAction,
157 },
158 Webizen {
159 #[command(subcommand)]
160 action: WebizenAction,
161 },
162 ExportSolid {
163 #[arg(long)]
164 input: PathBuf,
165 #[arg(long)]
166 output: PathBuf,
167 },
168 Solid {
169 #[command(subcommand)]
170 action: SolidAction,
171 },
172 #[command(name = "benchmark-action")]
173 Benchmark {
174 #[command(subcommand)]
175 action: BenchmarkAction,
176 },
177 #[command(name = "benchmark", alias = "bench")]
178 Bench {
179 #[arg(long, default_value = "full")]
180 suite: String,
181 },
182 VerifyIntegrity {
183 #[arg(long)]
184 input: PathBuf,
185 #[arg(long)]
186 dataset: PathBuf,
187 },
188 VerifyGraph {
190 #[arg(long)]
191 input: PathBuf,
192 #[arg(long)]
193 dataset: PathBuf,
194 #[arg(long, default_value_t = 32)]
196 memory_mib: u64,
197 #[arg(long, default_value_t = 24)]
199 temp_gib: u64,
200 #[arg(long, default_value = "import")]
203 encoder: String,
204 #[arg(long)]
206 omit_predicates: Option<String>,
207 #[arg(long)]
209 omit_preset: Option<String>,
210 #[arg(long, alias = "strict-rdfc")]
213 require_isomorphism: bool,
214 },
215 Import {
216 input: Option<PathBuf>,
218 output: Option<PathBuf>,
220 #[arg(long)]
221 strip_literals: bool,
222 #[arg(long)]
224 segment_mib: Option<u64>,
225 #[arg(long, value_enum, default_value_t = ImportProgressFormat::Text)]
227 progress: ImportProgressFormat,
228 #[arg(long)]
230 url: Option<String>,
231 #[arg(long)]
233 job_dir: Option<PathBuf>,
234 #[arg(long)]
236 resume: bool,
237 #[arg(long)]
239 omit_predicates: Option<String>,
240 #[arg(long)]
242 omit_preset: Option<String>,
243 },
244 IngestJob {
246 #[command(subcommand)]
247 action: IngestJobAction,
248 },
249 Ingest {
250 #[command(subcommand)]
251 format: IngestFormat,
252 },
253 Query {
254 #[command(subcommand)]
255 dialect: QueryDialect,
256 },
257 Compress {
258 #[arg(long)]
259 input: PathBuf,
260 #[arg(long)]
261 output: PathBuf,
262 },
263 Resources {
264 subcommand: String,
265 arg: Option<String>,
266 },
267 Profile {
268 #[command(subcommand)]
269 action: ProfileAction,
270 },
271 Qpu {
272 #[command(subcommand)]
273 action: QpuAction,
274 },
275 Solve {
276 #[command(subcommand)]
277 action: SolveAction,
278 },
279 Science {
280 #[command(subcommand)]
281 action: ScienceAction,
282 },
283}