Repository navigation
feat: the BugSplat CLI - #21
Conversation
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
…ion/phase-1 # Conflicts: # Cargo.lock
…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>
There was a problem hiding this comment.
🟡 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
Redact client secrets from GlobalArgs debug output · New Avoid truncating source files during symbol uploads · New Reject Windows drive-qualified symbol names · New Validate loopback URLs before requests and redirects · New Serialize token refreshes per cache key · New Lock session deletion against in-flight refreshes · New
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
…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) |
There was a problem hiding this comment.
does bugsplat return a retry after?
There was a problem hiding this comment.
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>
…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>
There was a problem hiding this comment.
🟡 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
…nput out of the error Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Copilot's review of 5864bb0 reports no open issues and names two findings it did not publish. Both checked, no change needed:
|


The first version of the BugSplat CLI: one
bugsplatbinary, written in Rust, for people, build scripts and coding agents.Commands
login,logout,whoamidatabases listlist-databasesreports listlist-reportsreports get <id>get-reportreports reprocess <id>reprocess-reportgroups listlist-groupsgroups get <id>get-groupgroups set-status <id> <status>set-group-statusversions listlist-versionsdefects create,link,unlinkcreate-defect,add-defect-link,remove-defect-linktool list,tool call <name>symbols listlist-symbolssymbols info <file>...symbols findsymbols uploadsymbol-upload's flags, plus--dry-runsymbol-uploadusessymbols deletesymbol-uploadusessymbols dump <file>....symfiles from binaries (symbols upload --dump-symsgenerates and uploads)dump_syms, built incompletions <shell>How it works
bugsplat loginruns 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 onessymbol-uploadreads.tool callwithout a CLI release. Output is text by default. With--jsonthe CLI asks the tool forformat: "json"and prints the document it returns; a tool or server without that argument answers as before..dSYMbundles and universal binaries) and Breakpad.symfiles. Uploads send every file that has a debug id, gzipped, straight to storage through a presigned URL.@bugsplat/clinpm 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