logbrew-cli 0.1.15

Public command-line interface for LogBrew.
Documentation
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
//! CLI help text kept separate from command parsing.

use crate::HelpTopic;

/// Returns user-facing help for a topic.
#[must_use]
pub const fn help_text(topic: HelpTopic) -> &'static str {
    match topic {
        HelpTopic::Root => ROOT_HELP,
        HelpTopic::Login => LOGIN_HELP,
        HelpTopic::Logout => LOGOUT_HELP,
        HelpTopic::Setup => SETUP_HELP,
        HelpTopic::Status => STATUS_HELP,
        HelpTopic::Version => VERSION_HELP,
        HelpTopic::Auth => AUTH_HELP,
        HelpTopic::Json => JSON_HELP,
        HelpTopic::Examples => EXAMPLES_HELP,
        HelpTopic::Projects => PROJECTS_HELP,
        HelpTopic::Usage => USAGE_HELP,
        HelpTopic::Read => READ_HELP,
        HelpTopic::ReadLogs => READ_LOGS_HELP,
        HelpTopic::ReadIssues => READ_ISSUES_HELP,
        HelpTopic::ReadActions => READ_ACTIONS_HELP,
        HelpTopic::ReadReleases => READ_RELEASES_HELP,
        HelpTopic::ReadTrace => READ_TRACE_HELP,
        HelpTopic::ReadIssue => READ_ISSUE_HELP,
        HelpTopic::Watch => WATCH_HELP,
        HelpTopic::Explain => EXPLAIN_HELP,
        HelpTopic::Set => SET_HELP,
    }
}

/// Root command help text.
const ROOT_HELP: &str = "\
LogBrew CLI

Usage:
  logbrew login [--no-open] [--json]
  logbrew logout [--json]
  logbrew setup [--auto] [--yes] [--json]
  logbrew projects [--json]
  logbrew usage [--json]
  logbrew status [--json]
  logbrew health [--json]
  logbrew doctor [--json]
  logbrew whoami [--json]
  logbrew me [--json]
  logbrew version [--json]
  logbrew read logs [--severity error] [--search checkout] [--release <release>] [--environment \
                         production] [--since 24h] [--json]
  logbrew logs checkout failed [--severity error] [--release <release>] [--environment \
                         production] [--json]
  logbrew logs error checkout failed [--release <release>] [--environment production] [--json]
  logbrew search checkout [--release <release>] [--environment production] [--json]
  logbrew find checkout [--release <release>] [--environment production] [--json]
  logbrew grep checkout [--release <release>] [--environment production] [--json]
  logbrew show logs [--release <release>] [--environment production] [--json]
  logbrew latest logs [--limit 20] [--json]
  logbrew last 10 logs [--json]
  logbrew last 5 open issues [--json]
  logbrew list issues [--status unresolved] [--json]
  logbrew issues open [--release <release>] [--environment production] [--json]
  logbrew issue open [--release <release>] [--environment production] [--json]
  logbrew open issues [--release <release>] [--environment production] [--json]
  logbrew open issue [--release <release>] [--environment production] [--json]
  logbrew errors closed [--release <release>] [--environment production] [--json]
  logbrew get issue <issue_id> [--json]
  logbrew read issues [--release <release>] [--environment production] [--status unresolved] \
                         [--json]
  logbrew read actions [--release <release>] [--environment production] [--name checkout_failed] \
                         [--json]
  logbrew events checkout_failed [--release <release>] [--environment production] [--json]
  logbrew read releases [--environment production] [--json]
  logbrew read trace <trace_id> [--release <release>] [--environment production] [--json]
  logbrew trace <trace_id> [--release <release>] [--environment production] [--json]
  logbrew issue <issue_id> [--json]
  logbrew issue <issue_id> explain [--json]
  logbrew trace <trace_id> explain [--json]
  logbrew explain issue <issue_id> [--json]
  logbrew explain trace <trace_id> [--json]
  logbrew explain <issue_id_or_trace_id> [--json]
  logbrew <issue_id_or_trace_id> explain [--json]
  logbrew set issue <issue_id> resolved [--json]
  logbrew resolve <issue_id> [--json]
  logbrew close <issue_id> [--json]
  logbrew ignore <issue_id> [--json]
  logbrew reopen <issue_id> [--json]

Popular terms: auth, status, health, setup, projects, usage, logs, issues, errors, traces, spans, \
                         actions, events, releases, environments.
Health aliases: logbrew status, logbrew health, logbrew ping, logbrew doctor.
Setup aliases (non-mutating plan): logbrew init, logbrew install, logbrew configure, logbrew sdk.
Shortcuts: logbrew auth, logbrew whoami, logbrew me, logbrew log, logbrew logs, logbrew issues, \
                         logbrew logs checkout failed, logbrew logs error checkout, logbrew \
                         search checkout, logbrew find checkout, logbrew grep checkout, logbrew \
                         errors, logbrew actions, logbrew events, logbrew events checkout_failed, \
                         logbrew release, logbrew releases, logbrew trace <id>, logbrew issue \
                         <id>, logbrew resolve <id>, logbrew close <id>, logbrew ignore <id>, \
                         logbrew reopen <id>.
Read verbs: logbrew show logs, logbrew latest logs, logbrew last 10 logs, logbrew recent issues, \
                         logbrew list issues, logbrew get issue <id>.
Singular read aliases: logbrew read log, read release, show log, list issue, get release.
Pasted IDs: logbrew issue_123 or logbrew <trace_id>.
Examples: logbrew examples.
Topic help: logbrew logs --help, logbrew help logs, logbrew help read logs, or logbrew help json.
JSON mode: logbrew --json status and logbrew status --json both work.
Use --json for stable machine-readable output.";

/// Login command help text.
const LOGIN_HELP: &str = "\
Usage:
  logbrew login [--no-open] [--json]

Starts browser login for the native CLI. Use --no-open to print the URL without opening a browser.
--json prints the auth handoff without opening a browser.";

/// Logout command help text.
const LOGOUT_HELP: &str = "\
Usage:
  logbrew logout [--json]

Removes the local CLI token. If LOGBREW_TOKEN is set, unset it to fully log out.";

/// Setup command help text.
const SETUP_HELP: &str = "\
Usage:
  logbrew setup [--auto] [--yes] [--json]

Detects supported project manifests and prints a non-mutating SDK setup plan.
No files are changed. Install: not ready.
Aliases (same non-mutating plan): logbrew init, logbrew install, logbrew configure, logbrew sdk.
Options: --auto records automatic detection preference; --yes records confirmation preference; \
                          --json prints stable setup JSON.
Supported manifests: package.json, pyproject.toml, Pipfile, Cargo.toml, Package.swift, \
                          project.yml, project.yaml, .xcodeproj, .xcworkspace, go.mod, \
                          composer.json.
Package managers: npm, pnpm, yarn, bun, pip, uv, poetry, pipenv, cargo, SwiftPM, XcodeGen, Go, \
                          Composer.";

/// Status command help text.
const STATUS_HELP: &str = "\
Usage:
  logbrew status [--json]
  logbrew health [--json]
  logbrew ping [--json]
  logbrew doctor [--json]
  logbrew whoami [--json]
  logbrew me [--json]
  logbrew auth status [--json]

Checks local auth and API reachability.
Identity aliases: logbrew whoami, logbrew me, logbrew auth status.";

/// Version command help text.
const VERSION_HELP: &str = "\
Usage:
  logbrew version [--json]
  logbrew --version [--json]

Prints the installed CLI version.
The CLI is a native Rust binary.";

/// Auth workflow help text.
const AUTH_HELP: &str = "\
Usage:
  logbrew login [--no-open] [--json]
  logbrew auth login [--no-open] [--json]
  logbrew status [--json]
  logbrew auth status [--json]
  logbrew auth whoami [--json]
  logbrew auth me [--json]
  logbrew whoami [--json]
  logbrew me [--json]
  logbrew logout [--json]
  logbrew auth logout [--json]

Use login once, status/whoami/me to verify API/auth state, and logout to remove the local token.
Use --json for agent-readable auth checks.";

/// JSON output help text.
const JSON_HELP: &str = "\
Usage:
  logbrew --json status
  logbrew status --json
  logbrew logs --json
  logbrew help json --json

Use --json before or after commands for stable machine-readable output.
Stable JSON keeps server response shapes for reads and mutations.
Errors include ok, error, message, and next.";

/// First-run examples and common workflows.
const EXAMPLES_HELP: &str = "\
Usage:
  logbrew examples
  logbrew help examples

First run:
  logbrew status
  logbrew login
  logbrew setup

Troubleshoot:
  logbrew logs error checkout failed --release checkout@1 --environment production
  logbrew issues open --release checkout@1 --environment production
  logbrew issue issue_123
  logbrew explain issue issue_123
  logbrew trace <trace_id>

Live:
  logbrew watch --json
  logbrew watch --severity error,critical --json

Agent JSON:
  logbrew --json status
  logbrew logs checkout failed --json
  logbrew explain trace <trace_id> --json

More help:
  logbrew help logs
  logbrew help issues
  logbrew help watch
  logbrew help json";

/// Backend-owned project setup help text.
const PROJECTS_HELP: &str = "\
Usage:
  logbrew projects [--json]
  logbrew project [--json]
  logbrew projects create <name> [--json]
  logbrew setup --create-project [--json]
  logbrew projects setup <project_id> [--json]

Project creation, setup status, and project-scoped ingest credentials are backend-owned.
Current mode: help only. No local project, install, quota, or usage state is created.
When backend project setup is available, the CLI will call the backend contract and print \
backend-generated project-scoped SDK/ingest credentials.
Never use an account bearer token as SDK or ingest configuration.
Next: run logbrew setup for the current non-mutating local plan.";

/// Backend-owned usage and quota help text.
const USAGE_HELP: &str = "\
Usage:
  logbrew usage [--json]
  logbrew account usage [--json]

Account usage, plan limits, quota state, reset dates, and per-project or per-stream breakdowns are \
backend-owned.
Current mode: help only. The CLI does not calculate or persist usage/quota state from local files.
When backend usage is available, the CLI will read the backend account usage contract and preserve \
stable JSON for agents.
Next: run logbrew status to verify API and auth state.";

/// Read command help text.
const READ_HELP: &str = "\
Usage:
  logbrew read logs [filters] [--json]
  logbrew read log [filters] [--json]
  logbrew show logs [filters] [--json]
  logbrew list issues [filters] [--json]
  logbrew get issue <issue_id> [--json]
  logbrew read issues [filters] [--json]
  logbrew read actions [filters] [--json]
  logbrew read releases [filters] [--json]
  logbrew read release [filters] [--json]
  logbrew read trace <trace_id> [--json]
  logbrew read issue <issue_id> [--json]

Reads historical observability data for agents and developers.
Singular read aliases: logbrew read log, read release, show log, list issue, get release.
Recency counts are limit shortcuts: logbrew last 10 logs or logbrew recent 5 issues.
Use --environment <environment> with logs, issues, actions, releases, or traces.
Filter aliases: --env, --project-id, --trace-id, and --distinct-id.";

/// Read logs help text.
const READ_LOGS_HELP: &str = "\
Usage:
  logbrew read logs [--severity error] [--search checkout] [--release <release>] [--environment \
                              production] [--since 24h] [--trace <trace_id>] [--project \
                              <project_id>] [--limit 100] [--json]
  logbrew logs checkout failed [--severity error] [--release <release>] [--environment \
                              production] [--json]
  logbrew logs error checkout failed [--release <release>] [--environment production] [--json]

Reads structured logs. Severity values are info, warning, error, and critical.
Legacy severity aliases are accepted on input and normalized.
Severity matching is case-insensitive. --level is accepted as a compatibility alias for \
                              --severity.
The logs shortcut accepts obvious multi-word search text, such as logbrew logs checkout failed.
Shortcut levels can include search text, such as logbrew logs error checkout failed.
Recency counts are limit shortcuts, such as logbrew last 10 logs.
Explicit filters accept unquoted search text too, such as logbrew logs --severity warning checkout \
                              failed or logbrew logs --search checkout failed.
Use -- before literal flag-looking search text, such as logbrew logs -- --timeout --json.
Filter by severity, message search, release, or trace_id to correlate logs with spans.
Limit must be a positive whole number.";

/// Read issues help text.
const READ_ISSUES_HELP: &str = "\
Usage:
  logbrew read issues [--release <release>] [--environment production] [--status unresolved] \
                                [--project <project_id>] [--limit 100] [--json]
  logbrew issues open [--release <release>] [--environment production] [--json]
  logbrew issue open [--release <release>] [--environment production] [--json]
  logbrew open issues [--release <release>] [--environment production] [--json]
  logbrew open issue [--release <release>] [--environment production] [--json]
  logbrew last 5 open issues [--json]
  logbrew errors closed [--release <release>] [--environment production] [--json]

Reads grouped issues across releases and environments.
Status accepts unresolved/open, resolved/closed, or ignored, case-insensitively.
Issue shortcuts accept status words, such as logbrew issues open, logbrew issue open, logbrew open \
                                issues, logbrew open issue, or logbrew errors closed.
Recency issue shortcuts can include status and count, such as logbrew last 5 open issues.
Limit must be a positive whole number.";

/// Read actions help text.
const READ_ACTIONS_HELP: &str = "\
Usage:
  logbrew read actions [--release <release>] [--environment production] [--name checkout_failed] \
                                 [--user <distinct_id>] [--since 24h] [--project <project_id>] \
                                 [--limit 100] [--json]
  logbrew events checkout_failed [--release <release>] [--environment production] [--json]

Reads product actions. Use distinct_id to follow one actor or session.
Action/event aliases accept one positional name as the same filter as --name.
Limit must be a positive whole number.";

/// Read releases help text.
const READ_RELEASES_HELP: &str = "\
Usage:
  logbrew read releases [--release <release>] [--environment production] [--project <project_id>] \
                                  [--limit 100] [--json]

Reads release summaries with counts for issues, logs, trace spans, and actions.
Limit must be a positive whole number.";

/// Read trace help text.
const READ_TRACE_HELP: &str = "\
Usage:
  logbrew read trace <trace_id> [--release <release>] [--environment production] [--project \
                               <project_id>] [--json]

Reads spans for one distributed trace.";

/// Read issue help text.
const READ_ISSUE_HELP: &str = "\
Usage:
  logbrew read issue <issue_id> [--json]

Reads one grouped issue with status, release, environment, and occurrence counts.";

/// Watch command help text.
const WATCH_HELP: &str = "\
Usage:
  logbrew watch --json
  logbrew watch logs [--json]
  logbrew watch issues [--json]
  logbrew watch actions [--json]
  logbrew watch --severity error,critical --json

Aliases: tail, follow, and stream use the same live watch flow.
Live watch uses a short-lived feed ticket and WebSocket stream.
Transient disconnects reconnect with a fresh ticket and backoff.
Server-side live filters are not sent yet; severity filtering is applied client-side.";

/// Explain command help text.
const EXPLAIN_HELP: &str = "\
Usage:
  logbrew explain issue <issue_id> [--json]
  logbrew explain trace <trace_id> [--json]
  logbrew explain <issue_id_or_trace_id> [--json]
  logbrew issue <issue_id> explain [--json]
  logbrew trace <trace_id> explain [--json]
  logbrew <issue_id_or_trace_id> explain [--json]

Fetches enough context for an AI agent to explain what happened.
Pasted UUID/issue_* values are treated as issues; 32-hex/trace_* values are treated as traces.";

/// Set command help text.
const SET_HELP: &str = "\
Usage:
  logbrew set issue <issue_id> unresolved [--json]
  logbrew set issue <issue_id> resolved [--json]
  logbrew set issue <issue_id> ignored [--json]
  logbrew resolve <issue_id> [--json]
  logbrew close <issue_id> [--json]
  logbrew ignore <issue_id> [--json]
  logbrew reopen <issue_id> [--json]
  logbrew issue <issue_id> resolve [--json]
  logbrew issue <issue_id> close [--json]
  logbrew issue <issue_id> ignore [--json]
  logbrew issue <issue_id> reopen [--json]
  logbrew <issue_id> resolve [--json]
  logbrew resolved <issue_id> [--json]
  logbrew closed <issue_id> [--json]
  logbrew ignored <issue_id> [--json]
  logbrew open <issue_id> [--json]
  logbrew unresolved <issue_id> [--json]

Updates grouped issue status. Resolve/close map to resolved; ignore maps to ignored; reopen maps \
                        to unresolved.
Close is an alias for resolved.
Issue-first, pasted-ID, and status-first aliases are useful after reading issue detail.
Status values are case-insensitive.";