1#![warn(clippy::all, clippy::pedantic)]
2#![allow(
3 clippy::assigning_clones,
4 clippy::bool_to_int_with_if,
5 clippy::case_sensitive_file_extension_comparisons,
6 clippy::cast_possible_wrap,
7 clippy::doc_markdown,
8 clippy::field_reassign_with_default,
9 clippy::float_cmp,
10 clippy::implicit_clone,
11 clippy::items_after_statements,
12 clippy::map_unwrap_or,
13 clippy::manual_let_else,
14 clippy::large_stack_arrays,
15 clippy::missing_errors_doc,
16 clippy::missing_panics_doc,
17 clippy::module_name_repetitions,
18 clippy::must_use_candidate,
19 clippy::new_without_default,
20 clippy::needless_pass_by_value,
21 clippy::needless_raw_string_hashes,
22 clippy::redundant_closure_for_method_calls,
23 clippy::return_self_not_must_use,
24 clippy::similar_names,
25 clippy::single_match_else,
26 clippy::struct_field_names,
27 clippy::too_many_lines,
28 clippy::uninlined_format_args,
29 clippy::unnecessary_cast,
30 clippy::unnecessary_lazy_evaluations,
31 clippy::unnecessary_literal_bound,
32 clippy::unnecessary_map_or,
33 clippy::unused_self,
34 clippy::cast_precision_loss,
35 clippy::unnecessary_wraps,
36 dead_code
37)]
38
39use clap::{Subcommand, ValueEnum};
40use serde::{Deserialize, Serialize};
41
42pub mod agent;
43pub mod approval;
44pub mod auth;
45pub mod bootstrap;
46pub mod channels;
47pub mod config;
48pub mod cost;
49pub mod cron;
50pub mod daemon;
51pub mod doctor;
52pub mod gateway;
53pub mod hardware;
54pub mod health;
55pub mod heartbeat;
56pub mod identity;
57pub mod integrations;
58pub mod memory;
59pub mod migration;
60pub mod observability;
61pub mod onboard;
62pub mod peripherals;
63pub mod pre_execution;
64pub mod providers;
65pub mod rag;
66pub mod runtime;
67pub mod security;
68pub mod service;
69pub mod skills;
70#[cfg(test)]
71pub mod test_support;
72pub mod tools;
73pub mod tunnel;
74pub mod update;
75pub mod util;
76
77pub use config::Config;
78
79#[derive(Debug, Clone, Copy, ValueEnum, Serialize, Deserialize, PartialEq, Eq)]
80pub enum ServiceLingerMode {
81 Keep,
82 On,
83 Off,
84}
85
86#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
88pub enum ServiceCommands {
89 Install {
91 #[arg(long, value_enum, default_value_t = ServiceLingerMode::Keep)]
93 linger: ServiceLingerMode,
94 },
95 Start,
97 Restart,
99 Stop,
101 Status,
103 Uninstall,
105}
106
107#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
109pub enum ChannelCommands {
110 List,
112 Start,
114 Doctor,
116 Add {
118 channel_type: String,
120 config: String,
122 },
123 Remove {
125 name: String,
127 },
128 BindTelegram {
130 identity: String,
132 },
133}
134
135#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
137pub enum SkillCommands {
138 List,
140 Install {
142 source: String,
144 },
145 Remove {
147 name: String,
149 },
150}
151
152#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
154pub enum MigrateCommands {
155 Openclaw {
157 #[arg(long)]
159 source: Option<std::path::PathBuf>,
160
161 #[arg(long)]
163 dry_run: bool,
164 },
165}
166
167#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
169pub enum CronCommands {
170 List,
172 Add {
174 expression: String,
176 #[arg(long)]
178 tz: Option<String>,
179 command: String,
181 },
182 AddAt {
184 at: String,
186 command: String,
188 },
189 AddEvery {
191 every_ms: u64,
193 command: String,
195 },
196 Once {
198 delay: String,
200 command: String,
202 },
203 Remove {
205 id: String,
207 },
208 Pause {
210 id: String,
212 },
213 Resume {
215 id: String,
217 },
218}
219
220#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
222pub enum IntegrationCommands {
223 Info {
225 name: String,
227 },
228}
229
230#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
232pub enum HardwareCommands {
233 Discover,
235 Introspect {
237 path: String,
239 },
240 Info {
242 #[arg(long, default_value = "STM32F401RETx")]
244 chip: String,
245 },
246}
247
248#[derive(Subcommand, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
250pub enum PeripheralCommands {
251 List,
253 Add {
255 board: String,
257 path: String,
259 },
260 Flash {
262 #[arg(short, long)]
264 port: Option<String>,
265 },
266 SetupUnoQ {
268 #[arg(long)]
270 host: Option<String>,
271 },
272 FlashNucleo,
274}