pare-cargo

v0.24.2
io.github.Dave-London/pare-cargo Checked 1 hour ago Published 3 days ago

Pare 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).

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
compactbooleanPrefer compact output
featuresarraySpace or comma separated list of features to activate (--features)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
keepGoingbooleanContinue as much as possible after encountering errors (--keep-going). Collects maximum diagnostics in a single run.
lockedbooleanRequire Cargo.lock is up to date (--locked)
manifestPathstringPath to Cargo.toml (--manifest-path <PATH>)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to build in a workspace (-p <SPEC>)
pathstringProject root path
profilestringBuild with a custom profile (--profile <NAME>)
releasebooleanBuild in release mode
targetstringBuild for the target triple (--target <TRIPLE>). Example: 'x86_64-unknown-linux-gnu'
timingsEnable 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).

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
compactbooleanPrefer compact output
docbooleanRun only documentation tests (--doc)
featuresarraySpace or comma separated list of features to activate (--features)
filterstringTest name filter pattern
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
noFailFastbooleanRun all tests regardless of failures (--no-fail-fast)
noRunbooleanCompile tests but do not run them (--no-run)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to test in a workspace (-p <SPEC>)
pathstringProject root path
releasebooleanTest in release mode with optimizations (--release)
testArgsarrayArguments 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.

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
allTargetsbooleanCheck all targets (lib, bins, tests, benches, examples) (--all-targets)
allowarrayLint names to allow/suppress (-- -A <lint>). Example: ["clippy::needless_return"]
compactbooleanPrefer compact output
denyarrayLint names to set to deny level (-- -D <lint>). Example: ["clippy::unwrap_used"]
featuresarraySpace or comma separated list of features to activate (--features)
fixbooleanAutomatically apply clippy suggestions (--fix --allow-dirty). Implies --allow-dirty to work with uncommitted changes.
forbidarrayLint names to forbid (-- -F <lint>). Cannot be overridden. Example: ["unsafe_code"]
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
noDepsbooleanRun clippy only on the specified package, not its dependencies (--no-deps)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to lint in a workspace (-p <SPEC>)
pathstringProject root path
releasebooleanRun clippy in release mode with optimizations (--release)
warnarrayLint 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).

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
argsarrayArguments to pass to the binary (after --)
binstringName of the binary to run (--bin <NAME>) for multi-binary crates
compactbooleanPrefer compact output
examplestringName of the example to run (--example <NAME>)
featuresarraySpace or comma separated list of features to activate (--features)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
maxOutputSizeintegerMaximum size in bytes for stdout/stderr before truncation. Default: 1048576 (1MB). Min: 1024, Max: 10485760 (10MB).
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to run in a workspace
pathstringProject root path
profilestringBuild with a custom profile (--profile <NAME>)
releasebooleanRun in release mode
targetstringRun for the target triple (--target <TRIPLE>)
timeoutintegerExecution 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.

ParameterTypeDescription
packages *arrayPackages to add (e.g. ["serde", "tokio@1.0"])
branchstringGit branch to use with --git (--branch <BRANCH>)
buildbooleanAdd as build dependency (--build)
compactbooleanPrefer compact output
devbooleanAdd as dev dependency (--dev)
dryRunbooleanPreview what would be added without modifying Cargo.toml (--dry-run)
featuresarrayFeatures to enable (e.g. ["derive", "full"])
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
gitstringUse a git source URL (--git <URL>)
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDisable default features of the dependency (--no-default-features)
offlinebooleanRun without accessing the network (--offline)
optionalbooleanAdd as optional dependency (--optional)
packagestringPackage to target in a workspace (-p <SPEC>)
pathstringProject root path
registrystringRegistry to use (--registry <NAME>)
renamestringRename the dependency (--rename <NAME>)
revstringGit revision to use with --git (--rev <REV>)
sourcePathstringUse a local crate path source (--path <PATH>)
tagstringGit tag to use with --git (--tag <TAG>)

remove Cargo Remove

Removes dependencies from a Rust project and returns structured output.

ParameterTypeDescription
packages *arrayPackage names to remove
buildbooleanRemove from build dependencies (--build)
compactbooleanPrefer compact output
devbooleanRemove from dev dependencies (--dev)
dryRunbooleanPreview what would be removed without modifying Cargo.toml (--dry-run)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
manifestPathstringPath to Cargo.toml (--manifest-path <PATH>)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to target in a workspace (-p <SPEC>)
pathstringProject root path

fmt Cargo Fmt

Checks or fixes Rust formatting and returns structured output.

ParameterTypeDescription
allbooleanFormat all packages in the workspace (--all)
backupbooleanCreate backup files before formatting (--backup)
checkbooleanCheck only without modifying files (--check)
compactbooleanPrefer compact output
configstringRustfmt configuration options (-- --config <KEY=VALUE>)
configPathstringPath to rustfmt config file (-- --config-path <PATH>)
editionstringRust edition for formatting rules (-- --edition <EDITION>)
emitstringOutput mode for rustfmt (-- --emit <MODE>)
includeDiffbooleanIn check mode, preserve rustfmt unified diff output in response
packagestringPackage to format in a workspace (-p <NAME>)
pathstringProject root path

doc Cargo Doc

Generates Rust documentation and returns structured output with warning count.

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
compactbooleanPrefer compact output
documentPrivateItemsbooleanInclude private items in the generated documentation (--document-private-items)
featuresarraySpace or comma separated list of features to activate (--features)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
noDepsbooleanSkip building documentation for dependencies (--no-deps)
offlinebooleanRun without accessing the network (--offline)
openbooleanOpen docs in browser after generating
packagestringPackage to document in a workspace (-p <SPEC>)
pathstringProject root path
targetstringGenerate docs for the target triple (--target <TRIPLE>)
workspacebooleanGenerate 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.

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
allTargetsbooleanCheck all targets (lib, bins, tests, benches, examples) (--all-targets)
compactbooleanPrefer compact output
featuresarraySpace or comma separated list of features to activate (--features)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
keepGoingbooleanContinue as much as possible after encountering errors (--keep-going). Collects maximum diagnostics in a single run.
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
offlinebooleanRun without accessing the network (--offline)
packagestringPackage to check in a workspace
pathstringProject root path
releasebooleanCheck in release mode with optimizations (--release)
targetstringCheck for the target triple (--target <TRIPLE>)
workspacebooleanCheck all packages in the workspace (--workspace)

update Cargo Update

Updates dependencies in the lock file. Optionally updates a single package.

ParameterTypeDescription
aggressivebooleanForce updating all dependencies of the specified package as well (--aggressive)
compactbooleanPrefer compact output
dryRunbooleanPreview what would be updated without modifying the lock file (--dry-run)
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
lockedbooleanRequire Cargo.lock is up to date (--locked)
manifestPathstringPath to Cargo.toml (--manifest-path <PATH>)
offlinebooleanRun without accessing the network (--offline)
packagestringSpecific package to update (e.g. 'serde'). Omit to update all.
pathstringProject root path
precisestringUpdate to exactly this version (--precise <VERSION>). Requires a package to be specified.
workspacebooleanUpdate all packages in the workspace (--workspace)

tree Cargo Tree

Displays the dependency tree for a Rust project.

ParameterTypeDescription
allFeaturesbooleanActivate all available features (--all-features)
charsetstringCharacter set for tree display (--charset). Use 'ascii' for consistent output regardless of terminal.
compactbooleanPrefer compact output
depthnumberMaximum depth of the dependency tree to display
duplicatesbooleanShow only packages that appear more than once in the tree (--duplicates). Useful for detecting version conflicts.
edgesstringFilter dependency edges by kind (--edges <KINDS>). Example: 'normal' to exclude dev/build deps.
featuresarraySpace or comma separated list of features to activate (--features)
formatstringCustom format string for each package (--format <FMT>). Example: '{p} {l}'
frozenbooleanRequire Cargo.lock and cache are up to date (--frozen)
invertstringInvert the tree to show reverse dependencies (--invert <SPEC>). Critical for tracing which crates depend on a given package.
lockedbooleanRequire Cargo.lock is up to date (--locked)
noDefaultFeaturesbooleanDo not activate the default feature (--no-default-features)
offlinebooleanRun without accessing the network (--offline)
packagestringFocus on a specific package in the tree
pathstringProject root path
prunestringPrune the given package from the tree display (--prune <SPEC>). Simplifies output by hiding a specific dependency subtree.
targetstringFilter for platform-specific dependencies (--target <TRIPLE>)

audit Cargo Audit

Runs cargo audit and returns structured vulnerability data.

ParameterTypeDescription
binPathstringPath to compiled binary when mode=bin
compactbooleanPrefer compact output
dbstringPath to advisory database (--db <PATH>)
denystringMinimum severity to treat as an error exit code (--deny <SEVERITY>). Default: any vulnerability triggers a non-zero exit.
filestringPath to Cargo.lock file (--file <PATH>). Default: auto-detected.
fixbooleanAutomatically apply fixes for vulnerable dependencies (cargo audit fix). Updates Cargo.toml to use patched versions where available.
ignorearrayAdvisory IDs to ignore (--ignore <ADVISORY>). Example: ['RUSTSEC-2022-0090']
modestringAudit dependency tree (deps) or a compiled binary (bin)
noFetchbooleanSkip fetching the advisory database, use local cache only (--no-fetch). Useful for offline or air-gapped environments.
pathstringProject root path
targetArchstringFilter for target architecture (--target-arch <ARCH>). Example: 'x86_64'
targetOsstringFilter for target OS (--target-os <OS>). Example: 'linux'
urlstringURL for advisory database (--url <URL>)