Skip to content

feat: the BugSplat CLI - #21

Merged
bobbyg603 merged 55 commits into
mainfrom
integration/phase-1
Nov 25, 2026
Merged

bobbyg603 merged 55 commits into
mainfrom
integration/phase-1

Conversation

@bobbyg603

@bobbyg603 bobbyg603 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

The first version of the BugSplat CLI: one bugsplat binary, written in Rust, for people, build scripts and coding agents.

Commands

Command What it does How
login, logout, whoami Sign in through the browser, sign out, show who is signed in BugSplat's OAuth server
databases list List the databases you can open MCP tool list-databases
reports list List crash reports, with filters, sorting and paging MCP tool list-reports
reports get <id> Show one crash report with its call stack MCP tool get-report
reports reprocess <id> Ask BugSplat to process a report again, for example after uploading symbols MCP tool reprocess-report
groups list List crash groups, with filters, sorting and paging MCP tool list-groups
groups get <id> Show one crash group and its recent reports MCP tool get-group
groups set-status <id> <status> Mark a crash group open, fixed, regression or ignored MCP tool set-group-status
versions list List application versions MCP tool list-versions
defects create, link, unlink File a crash group in your issue tracker, link it to an existing defect, or remove the link MCP tools create-defect, add-defect-link, remove-defect-link
tool list, tool call <name> List the MCP server's tools, or call any of them by name MCP server
symbols list List the symbol files uploaded to a database MCP tool list-symbols
symbols info <file>... Print each file's debug id, module name and type Reads the file; no network
symbols find Search folders for symbol files that match debug ids or names Reads files; no network
symbols upload Upload a version's symbol files; takes symbol-upload's flags, plus --dry-run The endpoints symbol-upload uses
symbols delete Delete a version's symbol files The endpoint symbol-upload uses
symbols dump <file>... Generate Breakpad .sym files from binaries (symbols upload --dump-syms generates and uploads) Mozilla's dump_syms, built in
completions <shell> Print a shell completion script

How it works

  • Sign-in. bugsplat login runs the same browser sign-in the MCP clients use and keeps the session in the operating system's keychain, or in a file only the user can read where there is no keychain. In CI the CLI signs in with a Client ID and Client Secret from environment variables, including the ones symbol-upload reads.
  • Crash data. These commands call the hosted MCP server's tools, so the CLI returns what an assistant sees and a new tool works through tool call without a CLI release. Output is text by default. With --json the CLI asks the tool for format: "json" and prints the document it returns; a tool or server without that argument answers as before.
  • Symbols. Debug ids are read from PDB, portable PDB, PE, ELF, Mach-O (including .dSYM bundles and universal binaries) and Breakpad .sym files. Uploads send every file that has a debug id, gzipped, straight to storage through a presigned URL.
  • Output and exit codes. Results go to stdout and everything else to stderr. Exit code 0 is success, 1 a failure, 2 a usage error, 3 not signed in.
  • Tests. About 400 tests run on Linux, macOS and Windows against mock servers; none call production.
  • Release. cargo-dist builds six targets (macOS, Windows and static Linux, each for x64 and arm64) and the @bugsplat/cli npm package. Nothing is published until a version tag is pushed.

Merge with a merge commit so each part's history stays readable.

🤖 Generated with Claude Code

bobbyg603 and others added 16 commits November 24, 2026 10:33
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
CI runs fmt, clippy and tests on Linux, tests on macOS and Windows after
Linux passes, and cargo deny for licenses and advisories. Releases are
configured with dist for six targets plus shell and PowerShell installers;
the workflow runs only on v* tags and nothing publishes. `bugsplat --version`
prints the target triple.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`bugsplat symbols find` walks the given folders in parallel and reports
the PE, PDB, ELF, Mach-O and Breakpad .sym files whose debug id or name
was requested, or every symbol file when nothing is requested. .dSYM,
.app and .xcarchive bundles are read as one unit. Files are only handed
to the debug-id reader when their extension doesn't rule them out and
their first bytes are a known signature. The reader is a parameter of
`bugsplat_symbols::find`, so the search is tested with a stand-in until
`bugsplat_debugid::read` lands.

Closes #6

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds a Streamable HTTP MCP client (initialize, notifications/initialized,
tools/list, tools/call, JSON or SSE responses, session and protocol
headers, 401 as NotSignedIn) and the commands built on it: databases,
reports, groups, versions, defects, symbols list and tool. Each verb
sends its flags as the tool's arguments; filter flags take plain text,
a JSON array or a JSON operator object.

Closes #4

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`bugsplat login` runs the OAuth flow MCP clients use: discovery, dynamic
client registration (cached per API URL), PKCE S256 and a loopback
callback. `access_token` returns BUGSPLAT_ACCESS_TOKEN, then a token from
a Client ID and Client Secret, then the stored session, which it refreshes
under a file lock and re-reads first because the server rotates refresh
tokens.

Sessions live in the OS keychain, one item per API URL, with a 0600 file
under the config directory when there is no keychain. BUGSPLAT_TOKEN_STORE
(auto, keychain, file) picks the store; debug builds default to the file
so tests and rebuilt binaries never touch the developer's keychain.

Closes #3

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`bugsplat symbols upload` does what `@bugsplat/symbol-upload` does: files
with a debug id are gzipped and sent through /symsrv/uploadUrl, a presigned
PUT and /symsrv/uploadComplete; source maps, .sym files without an id, Unity
LineNumberMappings*.json and .zip files are zipped and sent through
/api/v2/versions; anything else is skipped with a warning. Each slice of a
fat Mach-O file uploads under its own id. Retries use exponential backoff
with jitter, stop on 4xx other than 408 and 429, and a 429 pauses every
worker. New: --dry-run, per-file progress, and a summary (--json).

`bugsplat symbols delete` calls DELETE /api/v2/versions after confirming.

The pipeline takes the debug id reader as a parameter; the command passes
`bugsplat_debugid::read`.

Closes #7

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s, and symbols info

bugsplat_debugid::read returns one DebugInfo per object in a file or bundle,
with the id pdb-guid, macho-uuid, elfy and symbol-upload produce for it. The
kind comes from the file's contents. PDB and portable PDB readers are ported
from pdb-guid; PE, ELF and Mach-O go through the object crate with the
packages' id rules applied on top.

`bugsplat symbols info <file>...` prints each object as text or JSON.

Closes #5

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ion/phase-1

# Conflicts:
#	Cargo.lock
#	crates/bugsplat-cli/Cargo.toml
…ation/phase-1

# Conflicts:
#	Cargo.lock
#	crates/bugsplat-cli/Cargo.toml
…al session, correct the README

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:06
@bobbyg603 bobbyg603 mentioned this pull request Nov 24, 2026
3 of 11 tasks

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical issues can expose credentials, allow writes outside the selected symbol store, and silently truncate valid symbol files during local uploads.

6 open issues
What changed in this PR

Combines the scaffold and six phase 1 work streams into one Rust CLI for reading BugSplat crash data, inspecting and finding local symbols, and uploading them. This brings the initial implementation together under the plan in issue #1.

Changes:

  • Adds the command tree, shared configuration, OAuth sign-in, and hosted MCP command integration.
  • Implements debug-ID readers, symbol discovery, uploads, deletion, and local symbol-store copying.
  • Adds tests, reference fixtures, cross-platform CI, release configuration, and usage documentation.
File Description
scripts/​localstack-token.py Provides LocalStack OAuth tokens for development.
rust-toolchain.toml Pins Rust and required checking components.
README.md Documents installation, commands, authentication, and migration.
dist-workspace.toml Configures release targets and installers.
deny.toml Defines dependency license and advisory checks.
crates/​bugsplat-upload/​tests/​localstack.rs Exercises LocalStack upload and deletion.
crates/​bugsplat-upload/​src/​time.rs Formats upload modification timestamps.
crates/​bugsplat-upload/​src/​retry.rs Implements backoff and shared rate-limit pauses.
crates/​bugsplat-upload/​src/​local.rs Copies symbols into a local store.
crates/​bugsplat-upload/​src/​lib.rs Exposes upload and local-copy APIs.
crates/​bugsplat-upload/​src/​find.rs Selects upload inputs using globs.
crates/​bugsplat-upload/​src/​compress.rs Compresses files and extracts architecture slices.
crates/​bugsplat-upload/​Cargo.toml Declares upload crate dependencies.
crates/​bugsplat-symbols/​Cargo.toml Declares symbol-search crate dependencies.
crates/​bugsplat-mcp-client/​src/​sse.rs Parses streamed MCP response events.
crates/​bugsplat-mcp-client/​Cargo.toml Declares MCP client dependencies.
crates/​bugsplat-debugid/​tests/​reference.rs Checks compatibility against external reference fixtures.
crates/​bugsplat-debugid/​tests/​fixtures/​symbol-upload/​windows.sym Adds a Windows Breakpad fixture.
crates/​bugsplat-debugid/​tests/​fixtures/​symbol-upload/​spaces.sym Covers module names containing spaces.
crates/​bugsplat-debugid/​tests/​fixtures/​symbol-upload/​liba.dylib.sym Adds a macOS Breakpad fixture.
crates/​bugsplat-debugid/​tests/​fixtures/​symbol-upload/​corrupt.exe Adds an invalid executable fixture.
crates/​bugsplat-debugid/​tests/​fixtures/​symbol-upload/​android.sym Adds an Android Breakpad fixture.
crates/​bugsplat-debugid/​tests/​fixtures/​macho-uuid/​corrupt.app/​Contents/​Resources/​DWARF/​corrupt Adds invalid bundle content for rejection tests.
crates/​bugsplat-debugid/​tests/​fixtures/​macho-uuid/​bugsplat.app.dSYM/​Contents/​Info.plist Supplies dSYM fixture metadata.
crates/​bugsplat-debugid/​tests/​fixtures/​.gitattributes Preserves fixture bytes across platforms.
crates/​bugsplat-debugid/​src/​sym.rs Reads Breakpad IDs and normalizes module names.
crates/​bugsplat-debugid/​src/​sniff.rs Detects supported formats from signatures.
crates/​bugsplat-debugid/​src/​pe.rs Extracts PE IDs and architectures.
crates/​bugsplat-debugid/​src/​pdb.rs Reads native and portable PDB IDs.
crates/​bugsplat-debugid/​src/​macho.rs Reads Mach-O slices and bundle symbols.
crates/​bugsplat-debugid/​src/​lib.rs Exposes debug-ID types and format dispatch.
crates/​bugsplat-debugid/​src/​elf.rs Extracts ELF IDs and architectures.
crates/​bugsplat-debugid/​src/​data.rs Provides offset-based binary reads.
crates/​bugsplat-debugid/​Cargo.toml Declares binary-reader dependencies.
crates/​bugsplat-core/​src/​lib.rs Exposes shared configuration, errors, and HTTP client.
crates/​bugsplat-core/​src/​http.rs Configures the shared HTTP client.
crates/​bugsplat-core/​src/​error.rs Defines common errors and exit codes.
crates/​bugsplat-core/​src/​config.rs Resolves API settings and configuration paths.
crates/​bugsplat-core/​Cargo.toml Declares core dependencies.
crates/​bugsplat-cli/​tests/​symbols_info.rs Tests symbol inspection output and failures.
crates/​bugsplat-cli/​tests/​symbols_find.rs Tests search arguments, output, and exit codes.
crates/​bugsplat-cli/​tests/​cli.rs Tests command discovery and global behavior.
crates/​bugsplat-cli/​src/​output.rs Provides JSON output and confirmation helpers.
crates/​bugsplat-cli/​src/​main.rs Runs commands and maps failures to exit codes.
crates/​bugsplat-cli/​src/​context.rs Resolves global flags and environment settings.
crates/​bugsplat-cli/​src/​commands/​versions.rs Maps version-listing arguments to MCP.
crates/​bugsplat-cli/​src/​commands/​symbols/​mod.rs Wires symbol subcommands.
crates/​bugsplat-cli/​src/​commands/​symbols/​list.rs Maps remote symbol-listing arguments.
crates/​bugsplat-cli/​src/​commands/​symbols/​info.rs Prints local symbol metadata.
crates/​bugsplat-cli/​src/​commands/​symbols/​delete.rs Confirms and deletes version symbols.
crates/​bugsplat-cli/​src/​commands/​reports.rs Adds report listing and retrieval.
crates/​bugsplat-cli/​src/​commands/​mod.rs Dispatches top-level commands.
crates/​bugsplat-cli/​src/​commands/​mcp.rs Adds a placeholder for the future local server.
crates/​bugsplat-cli/​src/​commands/​groups.rs Adds group queries and status updates.
crates/​bugsplat-cli/​src/​commands/​defects.rs Adds defect creation and link management.
crates/​bugsplat-cli/​src/​commands/​databases.rs Adds database listing.
crates/​bugsplat-cli/​src/​commands/​completions.rs Generates shell completions.
crates/​bugsplat-cli/​src/​commands/​auth.rs Implements login, logout, and identity output.
crates/​bugsplat-cli/​src/​cli.rs Defines the command tree and global options.
crates/​bugsplat-cli/​Cargo.toml Defines the binary and its dependencies.
crates/​bugsplat-cli/​build.rs Embeds the build target in version output.
crates/​bugsplat-auth/​src/​session.rs Manages stored sessions and locked refreshes.
crates/​bugsplat-auth/​src/​oauth.rs Implements OAuth discovery and token exchanges.
crates/​bugsplat-auth/​src/​loopback.rs Receives and validates browser callbacks.
crates/​bugsplat-auth/​src/​login.rs Coordinates browser sign-in.
crates/​bugsplat-auth/​src/​lib.rs Exposes authentication and token-resolution APIs.
crates/​bugsplat-auth/​src/​jwt.rs Reads display-only identity claims.
crates/​bugsplat-auth/​src/​clients.rs Caches registered client IDs per API URL.
crates/​bugsplat-auth/​src/​client_credentials.rs Exchanges and caches CI access tokens.
crates/​bugsplat-auth/​Cargo.toml Declares authentication dependencies.
CLAUDE.md Documents contributor conventions and checks.
Cargo.toml Defines workspace crates and shared dependencies.
.gitignore Excludes build output and macOS metadata.
.github/​workflows/​ci.yml Adds cross-platform tests and quality checks.
.github/​dependabot.yml Configures scheduled dependency updates.

Review effort: Balanced

Comment thread crates/bugsplat-cli/src/cli.rs Resolved
Comment thread crates/bugsplat-upload/src/local.rs Resolved
Comment thread crates/bugsplat-upload/src/local.rs Resolved
Comment thread scripts/localstack-token.py Resolved
Comment thread crates/bugsplat-auth/src/lib.rs Resolved
bobbyg603 and others added 3 commits November 24, 2026 11:20
…w every CI test failure

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
if status == reqwest::StatusCode::TOO_MANY_REQUESTS {
let retry = response
.headers()
.get(reqwest::header::RETRY_AFTER)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does bugsplat return a retry after?

@bobbyg603 bobbyg603 Nov 25, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not from this endpoint, as far as I can tell: the server doesn't answer 429 there and doesn't set Retry-After. A 429 here would come from whatever sits in front of the API in production (a WAF or load balancer rule), and I can't see whether that adds the header.

The code handles both cases: it adds ", retry after N seconds" to the error when the header is there and parses as seconds, and prints the plain "too many requests" message when it isn't. symbol-upload treats a 429 on this request the same way. If you'd rather not carry handling for a header the server may never send, this branch can drop to the plain message; say so and I'll simplify it.

symbolic-demangle compiles C++, and musl-tools on the Ubuntu runners has
only musl-gcc. Both musl targets now build in a rust-musl-cross container
pinned by digest, set through dist's custom runners. The artifact workflow
smoke-tests the container builds, checks the Linux binaries are static and
runs symbols dump in Alpine and Debian slim containers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The LocalStack helper can send email/password credentials through an environment-configured proxy despite its local-only check, creating a critical security issue.

3 open issues

Review effort: Balanced

Comment thread scripts/localstack-token.py Resolved
Comment thread crates/bugsplat-core/src/config.rs Resolved
Comment thread crates/bugsplat-debugid/src/macho.rs Resolved
bobbyg603 and others added 3 commits November 24, 2026 19:42
…d -q

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- the LocalStack token helper never uses a proxy from the environment
- an API URL with a query or fragment is a usage error
- a bundle's objects are deduplicated with a map instead of a scan

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

API URLs containing passwords can expose secrets through validation errors, identity output, and Config debug output, so embedded credentials must be rejected and raw URL inputs omitted from validation errors.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread crates/bugsplat-core/src/config.rs Resolved
…nput out of the error

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate critical credential-exposure risks in proxy-routed LocalStack requests and raw API-URL debug output.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because findings omitted from the published review identify critical risks of writes escaping the local store and bearer tokens leaking through environment proxies.

No open issues 🎉

Review effort: Balanced

@bobbyg603

Copy link
Copy Markdown
Member Author

Copilot's review of 5864bb0 reports no open issues and names two findings it did not publish. Both checked, no change needed:

  • Writes escaping the local store (symbols upload --local-path). The module name, the debug id and the file name are each required to be a single plain path component before anything is written, so .., separators, absolute paths and Windows drive prefixes are refused; local.rs has tests for each, including a Breakpad .sym file with a hostile MODULE line.
  • Bearer tokens through a proxy from the environment. The CLI honours HTTPS_PROXY and HTTP_PROXY as curl, npm and gh do, which people behind a corporate proxy need. Over HTTPS, the default, a proxy only tunnels the connection and never sees the token. It would see it only with a plain http:// API URL, which is LocalStack development. The LocalStack token helper is the exception and never uses a proxy, because it sends a password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants