Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Cargo

$ cargo Official Low Risk
The Rust Project · Code & DevOps · MIT · macos / linux / windows

The standard build system, dependency resolver, test runner, and publisher for Rust crates. Exposes rich JSON workspace graphs via cargo metadata --format-version 1, machine-readable compiler diagnostics via --message-format=json, and --dry-run on publish.

FCRS-1.0 Score
93 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install rust
CLI vs MCP Decision CLI Only

Invokes rustc, workspace manifests, and local unit tests directly; MCP cannot replace local compilation.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 23 / 25

First-class cargo metadata --format-version 1, --message-format=json, --color=never, --locked, and --offline flags.

  • cargo check --message-format=json emits line-by-line JSON diagnostics
  • cargo metadata returns canonical workspace JSON
Trust & Safety 22 / 25

--locked prevents unintended lockfile changes, --dry-run guards publish, and build artifacts stay isolated in target/.

  • cargo publish --dry-run and cargo test --locked protect against accidental mutations
Setup & Portability 14 / 15

Installed cleanly via rustup or system packages across macOS, Linux, and Windows, though full toolchain download is moderately large.

  • Universal rustup toolchain installer across major OSes
Utility & Efficiency 15 / 15

Unifies dependency resolution, compilation, testing, benchmarking, and publishing in one deterministic CLI.

  • cargo check validates code far faster than full release linking
Maintenance & Lineage 10 / 10

Official Rust Project CLI maintained under MIT/Apache-2.0.

  • First-party rust-lang/cargo repository
Docs & Verifiability 9 / 10

Comprehensive Cargo Book at doc.rust-lang.org/cargo/ and detailed --help.

  • Official Cargo Book documentation

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Builds and tests need no auth; cargo publish uses ~/.cargo/credentials.toml or CARGO_REGISTRY_TOKEN.

Side Effects
Read-Only Local Write Remote Write
Cost & Quotas

Dual MIT / Apache-2.0 open-source toolchain; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Cargo (cargo) Agent Rules
- Use `cargo check --message-format=json` for fast structured error feedback before full builds.
- Pass `--locked` (or `--offline` in sandboxed environments) when running `cargo test`.
- Never run `cargo publish` without explicit user confirmation (preview with `cargo publish --dry-run` first).

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect workspace crates and dependencies as JSON
cargo metadata --format-version 1 --no-deps

Outputs complete workspace package manifests, targets, and paths in JSON.

Type-check with JSON compiler diagnostics
cargo check --message-format=json --color=never

Streams structured JSON compiler errors, spans, and fix suggestions without linking binaries.

Controlled Writes & Previews

Run tests cleanly with locked dependencies
cargo test --locked --color=never

Runs the test suite while refusing to mutate Cargo.lock.

Strengths for Agents

  • + cargo check --message-format=json gives agents exact file/line/span diagnostics and suggested fixes.
  • + cargo metadata --format-version 1 exposes full workspace structure cleanly.
  • + --locked, --offline, and cargo publish --dry-run enforce strict reproducibility.

Caveats & Pitfalls

  • ! Compile times and target/ disk usage can be heavy on large workspaces.
  • ! Crate build.rs scripts execute arbitrary Rust code at compile time.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI