--json for
structured output to scripts and AI agents.
Replace each angle-bracket placeholder before you run a command. Use project,
issue, and trace IDs that LogBrew returned.
Install the CLI
Select one installation method. macOS or Linux:Cargo needs Rust 1.87 or newer. The other methods install a native binary
and do not need Rust.
Update the CLI
The CLI does not update itself. Use the same method that installed it. Homebrew:ok, name, version, binary, os, and arch.
Sign in and verify the session
Read the account for the current terminal:whoami shows the expected account, continue. If not, sign in. A person
completes the provider login in the browser. A coding agent must ask a person
to do this step.
github (default), gitlab, bitbucket, or google.
On a machine that cannot open a browser, such as an SSH session, a container,
or a CI job, use device sign-in:
--no-open does the same as
--device.
With --json, the CLI prints the link and the code as one JSON line, then
the result as a second JSON line. A coding agent can give the link and the
code to a person and wait.
After login, run status and whoami again. Do not put account credentials in
a prompt, report, or source file.
Set up a project
Go to the directory that contains the package or build manifest of the app. In a monorepo, select one app or service. Then run:--yes --json. These options add more steps:
Plan SDK setup
To read the setup plan without changes, run:detected, install_ready, install_plan, and next. The plan gives
the runtime, framework, package manager, and install command. This command
does not install packages or change files. logbrew init, install,
configure, and sdk give the same plan.
See Send SDK telemetry for runtime-specific steps. Run
logbrew examples for a short list of common commands.
Read, create, and configure projects
List the active projects in your account:
The JSON result has
status, project_id, ingest_key, checks, and
next. ingest_key has the key id, label, kind, created_at, and
expires_at. To replace a key, see Rotate an ingest key.
To revoke a key, use its id from that result:
--abandon-retry only to start a new
attempt.
To create a new project, follow the quickstart. It uses
logbrew projects create "<name>" --ingest-key-file "<private_key_file>",
which stores the first key in the same way. Run logbrew setup --create-project
to read the project creation help. That command does not create a project.
After a setup step, you can record it for the project. The --source value is
api, cli, or sdk:
0 does not mean that all checks passed. Read the report status
and each check. See the doctor report
reference.
Read account usage
Read usage and limits. This does not change account or billing state.logbrew account usage --json gives the same result. The response gives the
plan, quota state, reset date, usage totals by project and by telemetry kind,
and a next step. The fields include plan, state, reset_at, by_project,
by_stream, and next.
Common investigations
Filter each read by project. Add release, environment, time, or severity filters when the command supports them. See Filters.Issues in a release
One failed request
Logs for a release
Issues assigned to you
Watch live events
Use watch to see new events while you test a change. Press Ctrl+C to stop.--json, the command stops with an error.
Add logs, issues, or actions to watch one type, such as
logbrew watch logs --json. Watch does not support traces or spans.
Watch has no project, release, or environment filter. For one project, use the
reads above. See Live watch for the supported
resources and filters.
Explain before you change code
Read the context before you propose a fix.1
Read the issue
2
Read the trace
Do this step only if the issue has a trace ID. An issue without a trace is
still valid.
3
Read the explanation
logbrew explain log "<log_id>" --json. For an action, use
logbrew explain action "<action_id>" --json.4
Resolve after verification
JSON output
- Put
--jsonbefore or after the command, such aslogbrew --json statusorlogbrew status --json. - Read the exit code before you use the output.
- JSON errors have
ok,error,message, andnext. A timeout does not prove that a write failed. Before you repeat a write, read its retry rules. - Do not automate with output that has no
--json. It can change.
