human-panic: readable crash reports for Rust command-line tools
Panic messages for humans.
At a glance
- What is it?
- human-panic changes the release-build panic experience in Rust CLIs into a support-oriented message and a TOML crash report. It fits CLI authors seeking user-submitted diagnostics, but it does not prevent panics or upload reports automatically.
- Who is it for?
- Adopt human-panic when a released Rust CLI should explain crashes and collect user-submitted TOML reports. Do not adopt it for expected errors, automatic recovery, or development-only debugging.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 18 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Why human-panic changes a Rust CLI crash
human-panic addresses a presentation problem in Rust command-line applications. The standard output shown in the README identifies a panicked thread, the panic expression, a source location, and a note about `RUST_BACKTRACE`. That information is useful to a developer, but an ordinary user may not know what to do with it beyond reading an implementation-level failure message.
The crate targets CLI authors who want a released program to give users a clear support action after an unexpected crash. It does not prevent the panic, repair faulty logic, or turn the failure into a recoverable operation. Instead, it changes the crash experience: the user receives a short apology, instructions for preparing a report, and a path to an attached TOML file.
This approach is most appropriate for distributed binaries whose users cannot inspect local build logs or attach debugging tools. The README states that human-panic performs no automated error collection. Nothing in the documented flow silently sends the report to maintainers. The user must submit the generated file through a channel established by the application.
That distinction is central to the design. human-panic is not a telemetry service, issue tracker, or crash-recovery layer. It is a panic hook plus a report-generation step. A project still needs a suitable bug-report destination and a process for reading the reports it receives.
The human-panic hook and crash-report flow
The documented mechanism is a panic hook installed through `std::panic::set_hook`. The README calls `setup_panic!()` at the start of `main`, before normal program output. When the application later panics, human-panic takes responsibility for presenting the failure and preparing diagnostic information.
The terminal message says that human-panic crashed and directs the user to a generated report. The README's example shows a file under a system temporary directory, using the suffix `.toml` and a UUID-style file name. It asks the user to submit the file with the subject `human-panic Crash Report`.
The report connects that message to the panic itself. Its documented fields include the application name, operating system, crate version, an explanation containing the panic cause and source location, the panic method, and a backtrace. This gives a maintainer context beyond the short terminal statement.
The hook's user-facing behavior is limited to release builds in the README's usage. The example explicitly runs with `cargo run --release`. A normal debug build therefore remains associated with Rust's conventional panic diagnostics unless the application installs separate debugging behavior. This separation lets developers keep familiar local diagnostics while presenting a report-oriented message to users of the release binary.
Installing human-panic and triggering the first report
The README gives a direct Cargo command for adding the dependency:
$ cargo add human-panicAfter that command, an application can import the `setup_panic!` macro and install it before executing its main logic. The README's complete example deliberately panics so that the output is easy to observe:
use human_panic::setup_panic;
fn main() {
setup_panic!();
println!("A normal log message");
panic!("OMG EVERYTHING IS ON FIRE!!!")
}The ordinary log line demonstrates that setup occurs before normal application output. The following `panic!` then reaches the installed hook instead of leaving only the standard terminal message.
Because the friendly behavior is documented as release-only, the first real run must select that build mode:
$ cargo run --releaseThe expected terminal result is the human-panic message and the location of a generated `.toml` report. No automatic upload occurs. The README asks the user to inspect the file, attach it to an issue or email, and use `human-panic Crash Report` as the subject.
This example is appropriate for confirming integration, not for handling expected CLI failures. A production program should continue returning clear errors for invalid input or unavailable services, then reserve panic reporting for failures that should not normally occur.
What human-panic writes into its TOML report
The README supplies a concrete example of the report contents. Its top-level fields are `name`, `operating_system`, `crate_version`, `explanation`, `method`, and `backtrace`. The example sets `method` to `Panic` and records the panic location in the explanation.
A backtrace is more detailed than the terminal message. The sample includes frame addresses, function symbols, source files, and dependency locations. Some entries refer to a Cargo registry, while others refer to a local checkout. That makes the report useful for tracing a failure, but it also means a user should review the file before posting it publicly.
human-panic performs no automated error collection according to the README. That statement describes transmission behavior, not an automatic redaction guarantee. The README does not document a built-in server, retention policy, report-format version, or file-deletion policy. Those omissions matter if reports contain local paths or other environment-specific details.
The generated file is also not a complete support system. The crate does not automatically open an issue, send an email, retry a request, or receive a confirmation. Application maintainers still need a monitored destination and a policy for handling reports that users choose to send.
Where human-panic is the wrong failure-handling tool
human-panic is the wrong choice for an expected error condition. A missing configuration value, invalid command-line argument, or unavailable remote service can be represented through ordinary application error handling. Installing a panic hook does not remove any of those conditions and cannot restore normal execution after the program has panicked.
It is also a poor substitute for a development debugging setup. The documented friendly message appears only in release builds, while developers normally need fast local diagnostics while developing. The standard Rust panic output remains relevant for that workflow, including the documented `RUST_BACKTRACE` route.
The hook can also create false expectations. Its message invites users to submit a report, but the crate cannot determine whether a project has somewhere to receive that report. Without an active issue tracker or monitored support inbox, a generated file becomes an artifact that users may not know how to deliver.
For small internal tools where developers are also the only users, the extra report workflow may add little. Direct panic output can be easier to inspect and requires no separate attachment. human-panic is more relevant when polished release behavior and user-submitted diagnostics matter more than minimal crash handling.
human-panic versus Rust defaults and application errors
The closest built-in alternative is to leave Rust's default panic output unchanged. That path displays the panic expression and source location, and it can provide a backtrace when requested through `RUST_BACKTRACE`. It needs no report file or submission process. For local debugging or an internal utility, this direct output can be the clearer choice.
The difference is the audience. Rust's standard output speaks in diagnostics familiar to developers. human-panic replaces that experience in release mode with a plain explanation and instructions for submitting a report. It does not make the underlying crash less severe; it changes how the failure is communicated.
Expected failures require another approach entirely. Application-level error handling can return a precise message and a controlled exit without generating a panic report. Adding human-panic to that path would hide the intended distinction between a rejected input and an internal defect.
Adoption therefore creates a tradeoff. The project gains a support-oriented release experience, but it must accept report-file handling and establish a place for users to send those files. Standard panic handling has less support overhead, while ordinary error handling is better for failures that are part of normal operation.
Maintenance, Rust compatibility, and license choices
The repository is not archived, and the last push was on 2026-10-04. The repository has no GitHub releases, so the absence of GitHub release entries is the only release signal available here. The repository includes `CHANGELOG.md`, `Cargo.lock`, `release.toml`, and related files, but the README does not describe a stable release cadence.
The repository's `Cargo.toml` declares `edition = "2024"` and `rust-version = "1.88"`. An integrating project should therefore check its toolchain before dependency resolution, particularly if it supports an older Rust version than human-panic requires. These are concrete build constraints rather than general maintenance warnings.
The `Cargo.toml` at the repository root sets `license = "MIT OR Apache-2.0"`. The README likewise lists the Apache License, Version 2.0 and the MIT License as alternatives, with `LICENSE-APACHE` and `LICENSE-MIT` included in the project. It also says contributions are dual-licensed under those options unless contributors explicitly state otherwise. Distribution policies and contribution workflows should account for that documented choice, but this article does not provide legal interpretation.
The repository's development dependencies also matter when maintainers assess upgrade cost. Its workspace includes dedicated panic test projects and a large lint configuration. Consumers normally bear dependency-resolution and toolchain costs rather than running this repository's entire test workspace.
Editorial conclusion
Adopt human-panic when a released Rust CLI should explain crashes and collect user-submitted TOML reports. Do not adopt it for expected errors, automatic recovery, or development-only debugging. Before integration, verify that your toolchain satisfies Rust 1.88, that your application has a monitored destination for reports, and that users can safely share the generated diagnostics.
Frequently asked questions
How do I install human-panic in a Rust project?
Run `cargo add human-panic`. Then import `human_panic::setup_panic` and call `setup_panic!()` before the application executes its main logic.
When does human-panic show its friendly panic message?
The README says the human-friendly message is displayed only in release mode. Its example runs the program with `cargo run --release`.
Does human-panic automatically send crash reports?
No. The README states that human-panic performs no automated error collection. It writes a report file and asks the user to submit it through the project's chosen channel.
What information is included in a human-panic crash report?
The README example contains the application name, operating system, crate version, panic explanation, method, and backtrace. The file may include local paths, so users should review it before sharing.
What Rust version does human-panic require?
The repository's `Cargo.toml` declares `rust-version = "1.88"`. It also sets the package edition to `2024`.
What license does human-panic use?
The README identifies the license files `LICENSE-APACHE` and `LICENSE-MIT`.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/rust-cli-human-panic)Was this useful?