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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
use std::path::PathBuf;
use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(name = "lobe", version, about = "Lobe — local HTTP performance observer")]
pub struct Cli {
#[arg(long, global = true)]
pub db: Option<PathBuf>,
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
Probe {
url: String,
/// Hold N requests in flight to measure latency under contention.
/// Pass a list for a sweep, e.g. `--concurrency 1,5,10,25,50`.
/// Without this flag, probe fires a single request as before.
#[arg(long, value_delimiter = ',', value_name = "N[,N...]")]
concurrency: Vec<usize>,
/// Total requests per concurrency level (raised to the level itself
/// if smaller, so the target concurrency is actually reached).
#[arg(long, default_value_t = 200, value_name = "N")]
requests: usize,
/// HTTP method for the burst. Only GET/HEAD are allowed unless
/// --allow-unsafe is set. Requires --concurrency.
#[arg(long, default_value = "GET")]
method: String,
/// Allow flooding a mutating endpoint (POST/PUT/PATCH/DELETE).
/// A burst of concurrent calls executes real mutations N times.
#[arg(long)]
allow_unsafe: bool,
},
History {
target: Option<String>,
#[arg(short, long, default_value_t = 10)]
limit: usize,
},
Compare {
url: String,
#[arg(long, default_value_t = 40.0)]
threshold: f64,
},
Watch {
url: String,
#[arg(short, long, default_value_t = 5)]
interval: u64,
#[arg(long, default_value_t = 40.0)]
threshold: f64,
#[arg(long)]
count: Option<usize>,
#[arg(long)]
tui: bool,
},
Capture {
upstream: String,
#[arg(long, default_value = "127.0.0.1:7878")]
listen: String,
/// Auto-upload the session to your Lobe cloud on export.
/// Requires `lobe login` first.
#[arg(long)]
upload: bool,
/// GitHub PR number this capture belongs to. When set, the PR bot
/// picks up the session and grades it against the baseline.
#[arg(long, value_name = "N")]
pr: Option<u32>,
/// Full repo identifier ("owner/repo"). Auto-detected from
/// `GITHUB_REPOSITORY` when running in GitHub Actions.
#[arg(long, value_name = "OWNER/REPO", env = "GITHUB_REPOSITORY")]
repo: Option<String>,
/// Branch under test. Auto-detected from `GITHUB_HEAD_REF` (PR) or
/// `GITHUB_REF_NAME` (push).
#[arg(long, value_name = "NAME", env = "GITHUB_HEAD_REF")]
branch: Option<String>,
/// Full git SHA of the commit under test. Auto-detected from
/// `GITHUB_SHA`.
#[arg(long, value_name = "SHA", env = "GITHUB_SHA")]
commit: Option<String>,
/// GitHub Actions run ID for linking back from PR comments.
#[arg(long, value_name = "ID", env = "GITHUB_RUN_ID")]
ci_run_id: Option<String>,
},
/// Authorize this machine to sync sessions to your Lobe cloud.
Login {
/// Provide the token non-interactively (e.g. from CI).
#[arg(long)]
token: Option<String>,
/// Override the web URL used in the auth prompt.
/// Defaults to https://getlobe.dev.
#[arg(long)]
web_url: Option<String>,
/// Override the Convex API URL used for token verification and
/// uploads. Defaults to the shipped production URL.
#[arg(long)]
api_url: Option<String>,
},
Explain {
/// Path to a session JSON file produced by `lobe capture` (press `e`).
session: PathBuf,
/// Model to use. Defaults to Haiku 4.5 for cost. Use `--model sonnet` for a deeper pass.
#[arg(long, default_value = "haiku")]
model: String,
/// Write the markdown report to a file instead of stdout.
#[arg(short, long)]
output: Option<PathBuf>,
},
/// Install the lobe-diagnose skill into your AI editor of choice.
InstallSkill {
/// Target editor: `claude-code` or `cursor`.
target: String,
/// Install to your home dir (~/.claude or ~/.cursor) instead of the current project.
#[arg(long)]
global: bool,
/// Overwrite an existing skill file if present.
#[arg(long)]
force: bool,
},
}