pare-cargo
v0.24.2Pare Cargo ג€” Structured Rust cargo operations (build, test, clippy, fmt, doc) as typed JSON.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
build Cargo Build
Runs cargo build and returns structured diagnostics (file, line, code, severity, message).
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
compact | boolean | Prefer compact output |
features | array | Space or comma separated list of features to activate (--features) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
keepGoing | boolean | Continue as much as possible after encountering errors (--keep-going). Collects maximum diagnostics in a single run. |
locked | boolean | Require Cargo.lock is up to date (--locked) |
manifestPath | string | Path to Cargo.toml (--manifest-path <PATH>) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to build in a workspace (-p <SPEC>) |
path | string | Project root path |
profile | string | Build with a custom profile (--profile <NAME>) |
release | boolean | Build in release mode |
target | string | Build for the target triple (--target <TRIPLE>). Example: 'x86_64-unknown-linux-gnu' |
timings | Enable cargo timing report generation (--timings[=html|json]) and expose timing metadata in output. |
test Cargo Test
Runs cargo test and returns structured test results (name, status, pass/fail counts).
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
compact | boolean | Prefer compact output |
doc | boolean | Run only documentation tests (--doc) |
features | array | Space or comma separated list of features to activate (--features) |
filter | string | Test name filter pattern |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
noFailFast | boolean | Run all tests regardless of failures (--no-fail-fast) |
noRun | boolean | Compile tests but do not run them (--no-run) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to test in a workspace (-p <SPEC>) |
path | string | Project root path |
release | boolean | Test in release mode with optimizations (--release) |
testArgs | array | Arguments to pass to the test harness (after --). Example: ['--test-threads=1', '--nocapture', '--ignored', '--include-ignored', '--exact'] |
clippy Cargo Clippy
Runs cargo clippy and returns structured lint diagnostics.
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
allTargets | boolean | Check all targets (lib, bins, tests, benches, examples) (--all-targets) |
allow | array | Lint names to allow/suppress (-- -A <lint>). Example: ["clippy::needless_return"] |
compact | boolean | Prefer compact output |
deny | array | Lint names to set to deny level (-- -D <lint>). Example: ["clippy::unwrap_used"] |
features | array | Space or comma separated list of features to activate (--features) |
fix | boolean | Automatically apply clippy suggestions (--fix --allow-dirty). Implies --allow-dirty to work with uncommitted changes. |
forbid | array | Lint names to forbid (-- -F <lint>). Cannot be overridden. Example: ["unsafe_code"] |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
noDeps | boolean | Run clippy only on the specified package, not its dependencies (--no-deps) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to lint in a workspace (-p <SPEC>) |
path | string | Project root path |
release | boolean | Run clippy in release mode with optimizations (--release) |
warn | array | Lint names to set to warn level (-- -W <lint>). Example: ["clippy::unwrap_used", "clippy::expect_used"] |
run Cargo Run
Runs a cargo binary and returns structured output (exit code, stdout, stderr).
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
args | array | Arguments to pass to the binary (after --) |
bin | string | Name of the binary to run (--bin <NAME>) for multi-binary crates |
compact | boolean | Prefer compact output |
example | string | Name of the example to run (--example <NAME>) |
features | array | Space or comma separated list of features to activate (--features) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
maxOutputSize | integer | Maximum size in bytes for stdout/stderr before truncation. Default: 1048576 (1MB). Min: 1024, Max: 10485760 (10MB). |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to run in a workspace |
path | string | Project root path |
profile | string | Build with a custom profile (--profile <NAME>) |
release | boolean | Run in release mode |
target | string | Run for the target triple (--target <TRIPLE>) |
timeout | integer | Execution timeout in milliseconds. Overrides the default 300s. Min: 1000 (1s), Max: 600000 (10m). |
add Cargo Add
Adds dependencies to a Rust project and returns structured output. WARNING: may execute untrusted code.
| Parameter | Type | Description |
|---|---|---|
packages * | array | Packages to add (e.g. ["serde", "tokio@1.0"]) |
branch | string | Git branch to use with --git (--branch <BRANCH>) |
build | boolean | Add as build dependency (--build) |
compact | boolean | Prefer compact output |
dev | boolean | Add as dev dependency (--dev) |
dryRun | boolean | Preview what would be added without modifying Cargo.toml (--dry-run) |
features | array | Features to enable (e.g. ["derive", "full"]) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
git | string | Use a git source URL (--git <URL>) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Disable default features of the dependency (--no-default-features) |
offline | boolean | Run without accessing the network (--offline) |
optional | boolean | Add as optional dependency (--optional) |
package | string | Package to target in a workspace (-p <SPEC>) |
path | string | Project root path |
registry | string | Registry to use (--registry <NAME>) |
rename | string | Rename the dependency (--rename <NAME>) |
rev | string | Git revision to use with --git (--rev <REV>) |
sourcePath | string | Use a local crate path source (--path <PATH>) |
tag | string | Git tag to use with --git (--tag <TAG>) |
remove Cargo Remove
Removes dependencies from a Rust project and returns structured output.
| Parameter | Type | Description |
|---|---|---|
packages * | array | Package names to remove |
build | boolean | Remove from build dependencies (--build) |
compact | boolean | Prefer compact output |
dev | boolean | Remove from dev dependencies (--dev) |
dryRun | boolean | Preview what would be removed without modifying Cargo.toml (--dry-run) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
manifestPath | string | Path to Cargo.toml (--manifest-path <PATH>) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to target in a workspace (-p <SPEC>) |
path | string | Project root path |
fmt Cargo Fmt
Checks or fixes Rust formatting and returns structured output.
| Parameter | Type | Description |
|---|---|---|
all | boolean | Format all packages in the workspace (--all) |
backup | boolean | Create backup files before formatting (--backup) |
check | boolean | Check only without modifying files (--check) |
compact | boolean | Prefer compact output |
config | string | Rustfmt configuration options (-- --config <KEY=VALUE>) |
configPath | string | Path to rustfmt config file (-- --config-path <PATH>) |
edition | string | Rust edition for formatting rules (-- --edition <EDITION>) |
emit | string | Output mode for rustfmt (-- --emit <MODE>) |
includeDiff | boolean | In check mode, preserve rustfmt unified diff output in response |
package | string | Package to format in a workspace (-p <NAME>) |
path | string | Project root path |
doc Cargo Doc
Generates Rust documentation and returns structured output with warning count.
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
compact | boolean | Prefer compact output |
documentPrivateItems | boolean | Include private items in the generated documentation (--document-private-items) |
features | array | Space or comma separated list of features to activate (--features) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
noDeps | boolean | Skip building documentation for dependencies (--no-deps) |
offline | boolean | Run without accessing the network (--offline) |
open | boolean | Open docs in browser after generating |
package | string | Package to document in a workspace (-p <SPEC>) |
path | string | Project root path |
target | string | Generate docs for the target triple (--target <TRIPLE>) |
workspace | boolean | Generate documentation for all packages in the workspace (--workspace) |
check Cargo Check
Runs cargo check (type check without full build) and returns structured diagnostics. Faster than build for error checking.
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
allTargets | boolean | Check all targets (lib, bins, tests, benches, examples) (--all-targets) |
compact | boolean | Prefer compact output |
features | array | Space or comma separated list of features to activate (--features) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
keepGoing | boolean | Continue as much as possible after encountering errors (--keep-going). Collects maximum diagnostics in a single run. |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Package to check in a workspace |
path | string | Project root path |
release | boolean | Check in release mode with optimizations (--release) |
target | string | Check for the target triple (--target <TRIPLE>) |
workspace | boolean | Check all packages in the workspace (--workspace) |
update Cargo Update
Updates dependencies in the lock file. Optionally updates a single package.
| Parameter | Type | Description |
|---|---|---|
aggressive | boolean | Force updating all dependencies of the specified package as well (--aggressive) |
compact | boolean | Prefer compact output |
dryRun | boolean | Preview what would be updated without modifying the lock file (--dry-run) |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
locked | boolean | Require Cargo.lock is up to date (--locked) |
manifestPath | string | Path to Cargo.toml (--manifest-path <PATH>) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Specific package to update (e.g. 'serde'). Omit to update all. |
path | string | Project root path |
precise | string | Update to exactly this version (--precise <VERSION>). Requires a package to be specified. |
workspace | boolean | Update all packages in the workspace (--workspace) |
tree Cargo Tree
Displays the dependency tree for a Rust project.
| Parameter | Type | Description |
|---|---|---|
allFeatures | boolean | Activate all available features (--all-features) |
charset | string | Character set for tree display (--charset). Use 'ascii' for consistent output regardless of terminal. |
compact | boolean | Prefer compact output |
depth | number | Maximum depth of the dependency tree to display |
duplicates | boolean | Show only packages that appear more than once in the tree (--duplicates). Useful for detecting version conflicts. |
edges | string | Filter dependency edges by kind (--edges <KINDS>). Example: 'normal' to exclude dev/build deps. |
features | array | Space or comma separated list of features to activate (--features) |
format | string | Custom format string for each package (--format <FMT>). Example: '{p} {l}' |
frozen | boolean | Require Cargo.lock and cache are up to date (--frozen) |
invert | string | Invert the tree to show reverse dependencies (--invert <SPEC>). Critical for tracing which crates depend on a given package. |
locked | boolean | Require Cargo.lock is up to date (--locked) |
noDefaultFeatures | boolean | Do not activate the default feature (--no-default-features) |
offline | boolean | Run without accessing the network (--offline) |
package | string | Focus on a specific package in the tree |
path | string | Project root path |
prune | string | Prune the given package from the tree display (--prune <SPEC>). Simplifies output by hiding a specific dependency subtree. |
target | string | Filter for platform-specific dependencies (--target <TRIPLE>) |
audit Cargo Audit
Runs cargo audit and returns structured vulnerability data.
| Parameter | Type | Description |
|---|---|---|
binPath | string | Path to compiled binary when mode=bin |
compact | boolean | Prefer compact output |
db | string | Path to advisory database (--db <PATH>) |
deny | string | Minimum severity to treat as an error exit code (--deny <SEVERITY>). Default: any vulnerability triggers a non-zero exit. |
file | string | Path to Cargo.lock file (--file <PATH>). Default: auto-detected. |
fix | boolean | Automatically apply fixes for vulnerable dependencies (cargo audit fix). Updates Cargo.toml to use patched versions where available. |
ignore | array | Advisory IDs to ignore (--ignore <ADVISORY>). Example: ['RUSTSEC-2022-0090'] |
mode | string | Audit dependency tree (deps) or a compiled binary (bin) |
noFetch | boolean | Skip fetching the advisory database, use local cache only (--no-fetch). Useful for offline or air-gapped environments. |
path | string | Project root path |
targetArch | string | Filter for target architecture (--target-arch <ARCH>). Example: 'x86_64' |
targetOs | string | Filter for target OS (--target-os <OS>). Example: 'linux' |
url | string | URL for advisory database (--url <URL>) |