| Crates.io | cargo-chec |
| lib.rs | cargo-chec |
| version | 0.1.8 |
| created_at | 2026-01-16 05:16:15.111892+00 |
| updated_at | 2026-01-22 04:56:22.683437+00 |
| description | A cargo subcommand to run cargo check and output filtered error messages as a JSON array |
| homepage | |
| repository | https://github.com/permissionlessweb/cargo-chec |
| max_upload_size | |
| id | 2047931 |
| size | 86,925 |

A cargo subcommand that wraps cargo check, filters Rust errors/warnings, and outputs them as a JSON array of strings. Perfect minimizing character/token count during agentic LLM sessions.
Companion Tool: Check out Cargo Tes for test failure filtering!
cargo check errors/warningscargo test failurescargo install cargo-checcargo checOutputs a JSON array like ["Error (severity 5)...", "Related..."]. No errors? [].
cargo install cargo-chec
Requires Rust and Cargo.
cd your-rust-project
cargo chec
# Output: ["Error (severity 5) from rustc in src/main.rs at line 1:1-10: Message"]
All cargo check flags are supported:
# Check in release mode
cargo chec --release
# Check a specific package
cargo chec -p my-package
# Check all targets
cargo chec --all-targets
# Combine flags
cargo chec --release --all-targets -p my-package
Parse existing cargo check output instead of running cargo check:
# From file
cargo chec --input logs.json
# From stdin
cargo check --message-format=json | cargo chec --input -
JSON array of strings:
[
"Error (severity 5) from rustc in src/main.rs at line 10:5-15: cannot find value `x` in this scope",
"Error (severity 4) from rustc in src/lib.rs at line 5:1-10: unused variable: `y` Related: In src/lib.rs at line 5:1-5: remove this line"
]
Empty on no issues: [].
cargo install cargo-chec.============================================
Benchmark: cargo check vs cargo chec
============================================
Building cargo-chec...
Build complete.
Running cargo check --message-format=json...
Output: 80233 characters, 37 lines
Running cargo chec (errors only)...
Output: 5130 characters, 1 lines
Running cargo chec --include-warnings...
Output: 12397 characters, 1 lines
============================================
Results Summary
============================================
cargo check --message-format=json:
Characters: 80233
Lines: 37
cargo chec (errors only):
Characters: 5130
Savings: 93.6%
cargo chec --include-warnings:
Characters: 12397
Savings: 84.5%
Open issues/PRs on GitHub. Built for the Rust ecosystem.
Use the provided Justfile for release tasks:
# Run all checks
just check
# Dry-run publish
just dry-run
# Full release
just release
Requires just (install via cargo install just).
This section provides structured details for AI tools to understand and interact with the codebase.
src/main.rs (single-file binary)Cargo.toml (dependencies and metadata)scripts/ (sh scripts for release tasks)Justfile (command runner for release)target/ (generated by Cargo)clap: CLI argument parsing with cargo subcommand supportserde_json: JSON parsing and serializationcargo build --release → target/release/cargo-checcargo clippycargo fmtcargo testcargo publishmain() in src/main.rs--input, runs cargo check --message-format=json with any additional args passed through? operator and iterator chains