1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "agent-device-rec",
version,
about = "Health device recommendation engine for longevity monitoring"
)]
pub struct Cli {
/// Force JSON output (default when piped)
#[arg(long, global = true)]
pub json: bool,
/// Custom database path (default: ~/.labstore/labstore.db)
#[arg(long, global = true)]
pub db: Option<String>,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Recommend monitoring devices based on patient assessment
Recommend {
/// Patient slug (reads latest biomarkers from labstore DB)
slug: Option<String>,
/// Read labassess JSON from stdin
#[arg(long)]
stdin: bool,
/// Patient sex
#[arg(long)]
sex: Option<String>,
/// Patient age
#[arg(long)]
age: Option<u8>,
/// Filter by device category
#[arg(long)]
category: Option<String>,
/// Maximum price (e.g., 200)
#[arg(long)]
max_price: Option<u32>,
/// Limit results
#[arg(long, short = 'n', default_value = "10")]
limit: usize,
},
/// List all devices in catalog
List {
/// Filter by category (cgm, wearable, blood_pressure, pulse_oximeter, scale)
#[arg(long)]
category: Option<String>,
/// Filter by brand
#[arg(long)]
brand: Option<String>,
/// Filter by tracked metric
#[arg(long)]
tracks: Option<String>,
/// Filter by price range (budget, mid, premium)
#[arg(long)]
price_range: Option<String>,
/// Limit results
#[arg(long, short = 'n', default_value = "50")]
limit: usize,
},
/// Show detailed device information
Show {
/// Device ID (from catalog)
device_id: String,
},
/// Search devices by text query
Search {
/// Search query
query: String,
/// Limit results
#[arg(long, short = 'n', default_value = "20")]
limit: usize,
},
/// List verified device brands
Brands,
/// Compare two or more devices side-by-side
Compare {
/// Device IDs to compare (2 or more)
device_ids: Vec<String>,
},
/// Show agent-info for AI consumption
AgentInfo,
}