use crate::HelpTopic;
#[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::ReadTraces => READ_TRACES_HELP,
HelpTopic::ReadTrace => READ_TRACE_HELP,
HelpTopic::ReadIssue => READ_ISSUE_HELP,
HelpTopic::Watch => WATCH_HELP,
HelpTopic::Explain => EXPLAIN_HELP,
HelpTopic::Investigate => INVESTIGATE_HELP,
HelpTopic::NativeDebugArtifacts => NATIVE_DEBUG_ARTIFACTS_HELP,
HelpTopic::Set => SET_HELP,
HelpTopic::Support => SUPPORT_HELP,
}
}
const ROOT_HELP: &str = "\
LogBrew CLI
Usage:
logbrew login [--provider github|gitlab|bitbucket] [--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 doctor --project <project_id> [--json]
logbrew whoami [--json]
logbrew me [--json]
logbrew version [--json]
logbrew support create --category <category> --title <title> --description <description> [--json]
logbrew support list [--status <status>] [--category <category>] [--json]
logbrew support show <ticket_id> [--json]
logbrew support context <ticket_id> [--json]
logbrew support reply <ticket_id> --context <text> --retry-key <key> [--diagnostics] [--json]
logbrew support close <ticket_id> [--json]
logbrew support reopen <ticket_id> [--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 traces [--service <service_name>] [--status error] [--since 24h] [--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 investigate issue <issue_id> [--json]
logbrew debug-artifacts upload <path> --project <project_id> --release <release> --environment \
<environment> --service <service> [--expect-image-uuid <uuid>]... \
[--dry-run] [--json]
logbrew debug-artifacts lookup --project <project_id> --release <release> --environment \
<environment> --service <service> --image-uuid <uuid> --architecture \
<architecture> [--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, support.
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.";
const LOGIN_HELP: &str = "\
Usage:
logbrew login [--provider github|gitlab|bitbucket] [--no-open] [--json]
Starts browser login for the native CLI and stores a private local access/refresh pair.
Authenticated commands refresh local auth once after an expired-token response.
Use --provider github|gitlab|bitbucket to choose the account provider (default: github).
Use --no-open to print the URL without opening a browser.
--json prints the auth handoff without opening a browser.";
const LOGOUT_HELP: &str = "\
Usage:
logbrew logout [--json]
Attempts to revoke the stored server session, then always removes both local CLI credentials.
If LOGBREW_TOKEN is set, unset it separately to fully log out.";
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. SwiftPM planning uses compatible releases from 0.1.6 for detected SwiftPM \
or XcodeGen projects.
Package: https://github.com/LogBrewCo/sdk.git
Product: LogBrew
Dependency: .package(url: \"https://github.com/LogBrewCo/sdk.git\", from: \"0.1.6\")
Other detected runtimes remain planning-only until their public package is 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.";
const STATUS_HELP: &str = "\
Usage:
logbrew status [--json]
logbrew health [--json]
logbrew ping [--json]
logbrew doctor [--json]
logbrew doctor --project <project_id> [--json]
logbrew whoami [--json]
logbrew me [--json]
logbrew auth status [--json]
Status checks API reachability and authentication.
Whoami/me return the authenticated account identity.";
const VERSION_HELP: &str = "\
Usage:
logbrew version [--json]
logbrew --version [--json]
Prints the installed CLI version.
The CLI is a native Rust binary.";
const AUTH_HELP: &str = "\
Usage:
logbrew login [--provider github|gitlab|bitbucket] [--no-open] [--json]
logbrew auth login [--provider github|gitlab|bitbucket] [--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 to verify API/auth state, whoami/me to inspect the authenticated account,
and logout to revoke the stored server session when possible and always remove local credentials.
Use --json for agent-readable auth checks.";
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.";
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";
const PROJECTS_HELP: &str = "\
Usage:
logbrew projects [--json]
logbrew project [--json]
logbrew projects create <name> --ingest-key-file <path> [--runtime <runtime>] \
[--environment <environment>] [--abandon-retry] [--json]
logbrew setup --create-project [--json]
logbrew projects setup <project_id> [--runtime <runtime>] [--source api|cli|sdk] \
[--environment <environment>] [--json]
Reads the authenticated active project catalog without mutating project state.
Human output is bounded to project identity, setup status, and latest activity. JSON preserves the \
exact validated bare array.
Project creation, setup status, and project-scoped ingest credentials are backend-owned.
Project creation stores the one-time ingest key in a new owner-only file before reporting success;
it never prints the one-time ingest key or its file path. An ambiguous attempt reuses the pending retry key only for the exact same request; --abandon-retry starts a new explicit attempt.
Builds that cannot prove owner-only file permissions fail before sending the create request.
No local install, quota, or usage state is created.
Project setup uses POST /api/projects/{project_id}/setup/seen and preserves backend setup status JSON.
Project-scoped SDK/ingest credentials are shown only when backend returns one-time credentials.
Never use an account bearer token as SDK or ingest configuration.
Next: run logbrew setup for the current non-mutating local plan.";
const USAGE_HELP: &str = "\
Usage:
logbrew usage [--json]
logbrew account usage [--json]
Reads authenticated account usage, configured limits, quota state, and reset dates without mutating \
account or billing state.
Human output is bounded to plan, state, totals, limits, the driving limit, and one next step. JSON \
preserves the exact validated account-usage object for agents.
The CLI does not calculate or persist usage/quota state from local files.
Next: run logbrew usage to inspect current account usage.";
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 traces [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.
Use --service <service_name> with logs, issues, actions, or releases.
Filter aliases: --service-name, --env, --project-id, --trace-id, and --distinct-id.";
const READ_LOGS_HELP: &str = "\
Usage:
logbrew read logs [--severity error] [--search checkout] [--release <release>] [--environment \
production] [--service <service_name>] [--since 24h] [--trace \
<trace_id>] [--project <project_id>] [--pagination cursor] [--limit \
100] [--json]
logbrew read logs [filters] --pagination cursor --cursor-time <RFC3339> --cursor-id <uuid> \
[--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.
--service-name <service_name> is accepted as an alias for --service <service_name>.
Cursor pagination preserves JSON as {logs,next_cursor}; next_cursor is either {time,id} or null.
Use --pagination cursor alone for the first page. Continue with --cursor-time and --cursor-id from \
next_cursor.
Keep the same active filters and pagination limit on every continuation page.
Limit must be a positive whole number.";
const READ_ISSUES_HELP: &str = "\
Usage:
logbrew read issues [--release <release>] [--environment production] [--status unresolved] \
[--service <service_name>] [--since <24h|7d|RFC3339>] [--project \
<project_id>] [--pagination cursor] [--limit 100] [--json]
logbrew read issues [filters] --pagination cursor --cursor-time <RFC3339> --cursor-id <uuid> \
[--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.
--service-name <service_name> is accepted as an alias for --service <service_name>.
Since accepts positive compact durations such as 24h or 7d, or an RFC3339 timestamp such as \
2026-05-01T00:00:00Z.
Cursor pagination preserves JSON as {issues,next_cursor}; next_cursor is either {time,id} or null.
Use --pagination cursor alone for the first page. Continue with --cursor-time and --cursor-id from \
next_cursor.
Keep the same active filters and pagination limit on every continuation page.
Limit must be a positive whole number.";
const READ_ACTIONS_HELP: &str = "\
Usage:
logbrew read actions [--release <release>] [--environment production] [--name checkout_failed] \
[--user <distinct_id>] [--service <service_name>] [--since 24h] \
[--project <project_id>] [--pagination cursor] [--limit 100] \
[--json]
logbrew read actions [filters] --pagination cursor --cursor-time <RFC3339> --cursor-id <uuid> \
[--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.
--service-name <service_name> is accepted as an alias for --service <service_name>.
Cursor pagination preserves JSON as {actions,next_cursor}; next_cursor is either {time,id} or null.
Use --pagination cursor alone for the first page. Continue with --cursor-time and --cursor-id from \
next_cursor.
Keep the same active filters and pagination limit on every continuation page.
Limit must be a positive whole number.";
const READ_RELEASES_HELP: &str = "\
Usage:
logbrew read releases [--release <release>] [--environment production] [--service \
<service_name>] [--since <24h|7d|RFC3339>] [--project \
<project_id>] [--limit 100] [--json]
Reads release summaries with counts for issues, logs, trace spans, and actions.
--service-name <service_name> is accepted as an alias for --service <service_name>.
Since accepts positive compact durations such as 24h or 7d, or an RFC3339 timestamp such as \
2026-05-01T00:00:00Z.
Limit must be a positive whole number.";
const READ_TRACES_HELP: &str = "\
Usage:
logbrew traces [--project <project_id>] [--service <service_name>] [--release <release>] \
[--environment <environment>] [--status <error|ok>] \
[--since <24h|7d|RFC3339>] \
[--min-duration-ms <milliseconds>] [--limit 100] [--json]
logbrew spans [filters] [--json]
logbrew latest traces [--limit 100] [--json]
Lists recent distributed traces for incident investigation. JSON preserves the backend bare array.
Status accepts error or ok, case-insensitively. Minimum duration is a non-negative whole number.
Since accepts positive compact durations such as 24h or 7d, or an RFC3339 timestamp such as \
2026-05-01T00:00:00Z.
The backend defaults limit to 100 and clamps it to 1..500.
CLI aliases --project-id, --service-name, and --env still serialize only canonical API query keys.
Next: run logbrew trace <trace_id> or logbrew explain trace <trace_id>.";
const READ_TRACE_HELP: &str = "\
Usage:
logbrew read trace <trace_id> [--release <release>] [--environment production] [--project \
<project_id>] [--json]
logbrew trace <trace_id> [--release <release>] [--environment production] [--project \
<project_id>] [--json]
Reads spans for one distributed trace.";
const READ_ISSUE_HELP: &str = "\
Usage:
logbrew read issue <issue_id> [--json]
Reads one grouped issue with status, release, environment, and occurrence counts.";
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.";
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.";
const INVESTIGATE_HELP: &str = "\
Usage:
logbrew investigate issue <issue_id> [--json]
Reads the issue first, then follows only its public trace-summary or related-log next action.
The command is read-only and preserves issue scope in the directed request.
JSON preserves the issue and exactly one directed result in a stable four-key envelope.";
const NATIVE_DEBUG_ARTIFACTS_HELP: &str = "\
Usage:
logbrew debug-artifacts upload <path> --project <project_id> --release <release> \
--environment <environment> --service <service> \
[--expect-image-uuid <uuid>]... [--dry-run] [--json]
logbrew debug-artifacts lookup --project <project_id> --release <release> \
--environment <environment> --service <service> --image-uuid <uuid> \
--architecture <arm64|arm64e|x86_64> [--json]
Discovers and validates Apple dSYM, ZIP, or Mach-O debug objects locally, uploads every supported \
exact identity, and verifies each identity with an authenticated lookup. Optional repeated \
--expect-image-uuid values require an exact discovered UUID set for release automation. --dry-run \
performs the same local validation without authentication or network access. Local paths and \
filenames are never included in output or API metadata.";
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.";
const SUPPORT_HELP: &str = "\
Usage:
logbrew support create --category <category> --title <title> --description <description> \
[--project <project_id>] [--environment <environment>] \
[--runtime <runtime>] [--framework <framework>] \
[--sdk-package <package>] [--sdk-version <version>] \
[--release <release>] [--trace-id <trace_id>] [--event-id <event_id>] \
[--diagnostics] [--json]
logbrew support list [--project <project_id>] [--status <status>] [--source <source>] \
[--category <category>] [--release <release>] [--limit 100] \
[--pagination cursor] [--json]
logbrew support list [filters] --pagination cursor --cursor-time <RFC3339> \
--cursor-id <ticket_id> [--json]
logbrew support show <ticket_id> [--json]
logbrew support context <ticket_id> [--json]
logbrew support reply <ticket_id> --context <text> --retry-key <key> [--diagnostics] [--json]
logbrew support close <ticket_id> [--json]
logbrew support reopen <ticket_id> [--json]
Creates, reads, adds requested context to, closes, and reopens authenticated account support \
tickets. Creation source is \
always cli.
Categories: sdk_install_failure, ingest_failure, auth_failure, project_setup, dashboard_issue, \
docs_confusion, cli_issue, mobile_issue, billing_question, other.
--diagnostics adds only binary, CLI version, operating system, and architecture. It never reads \
arbitrary environment variables or files.
Cursor continuations repeat --pagination cursor, all active filters, and the paired cursor from \
next_cursor. JSON preserves the server response exactly.
Context replies require a retry key. Reuse the key only when retrying the exact same context. \
Chat, messages, and internal notes are not part of this command.";