Skip to main content
The LogBrew command line interface (CLI) reads logs, issues, traces, and actions from a terminal. It can also update issue status. Use --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:
Windows (PowerShell):
Homebrew:
npm:
Cargo:
On Windows, you can also install the MSI from the latest release.
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:
npm:
Cargo:
For the shell or PowerShell installer, run the installer again. Then read the version. Compare it with the latest release:
The JSON gives ok, name, version, binary, os, and arch.

Sign in and verify the session

Read the account for the current terminal:
If 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.
The provider is 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:
The CLI prints a link and a short code. Open the link on any device, such as your phone or laptop. Make sure that the page shows the same code, then approve. The CLI waits up to 10 minutes. Login uses device sign-in automatically when it cannot open a browser. --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:
Setup selects or creates a project, installs the SDK, writes the ingest key to the env file, and adds the init code. It shows each file change and asks you to confirm. Then it sends a test event that LogBrew reads back. See Set up with one command. Agents and scripts add --yes --json. These options add more steps:

Plan SDK setup

To read the setup plan without changes, run:
Read 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.
Put a project ingest key in the SDK configuration. Never use an account credential as an SDK key. Keep ingest keys out of source control.
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:
Select a project ID from the result. Use it for keys and reads. To create an ingest key for an existing project, select a new file outside source control. The CLI writes the key to that owner-only file. It does not print the key or the file path.
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:
The key stops working at its next request. This command creates a credential. Before you run it, make sure that the project is correct. If the result is uncertain, run the same command again. The CLI then reuses the pending attempt. Use --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:
Then read project readiness:
Exit code 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.
Watch streams JSON only. Without --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

For a log, use logbrew explain log "<log_id>" --json. For an action, use logbrew explain action "<action_id>" --json.
4

Resolve after verification

To change status, priority, or assignee for many issues, see Change issue status and priority and the issue workflow.

JSON output

  • Put --json before or after the command, such as logbrew --json status or logbrew status --json.
  • Read the exit code before you use the output.
  • JSON errors have ok, error, message, and next. 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.
See Read results and errors for exit codes and error examples.