cargo-add
$ cargo 基金会 低风险cargo-add(cargo)已收录于 tldr-pages 命令语料库:Add dependencies to a Rust project's Cargo.toml manifest.。纳入 FCRS-1.0 基础索引,支持通过标准 Shell 管道按需调用与后续本地探针验证。
gh repo clone rust-lang/rustfmt 纯本地命令行工具(cargo);适合在 Shell 工作流中直接组合调用,无需额外的 MCP 封装层。
核心事实概览
- 命令名
- $ cargo
- FCRS-1.0 总分
- 71/100 (可用但有局限)
- 证据置信度
- 低置信度 (仅文档)
- CLI vs MCP 建议
- 仅 CLI 可用
- 评测日期
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
基于权威包注册表核验的命令行工具(cargo);调用前建议先检查 --help 是否提供结构化输出参数。
- Indexed in tldr-pages Corpus
- Command usage documented in tldr-pages
结合 研发、Git 与 DevOps 场景与上游清单信息评估为 low 风险等级。
- Install channel verified via
gh repo clone rust-lang/rustfmt - Package checksum verified by upstream registry
可通过 gh repo clone rust-lang/rustfmt 在 macos, linux 平台便捷安装。
- Primary install:
gh repo clone rust-lang/rustfmt
Add dependencies to a Rust project's Cargo.toml manifest.
- Official homepage/source: https://doc.rust-lang.org/cargo/commands/cargo-add.html
foundation 来源工具,维护者:POSIX / Open Source。
- Upstream repository: rust-lang/rustfmt
已关联上游文档 https://doc.rust-lang.org/cargo/commands/cargo-add.html;在执行本地探针实测前按 FCRS-1.0 规范适用低置信度封顶规则。
- https://doc.rust-lang.org/cargo/commands/cargo-add.html
安全边界、鉴权与放权指南
本地运行工具;除非连接远端服务,否则通常无需外部认证凭证。
本地开源/免费可执行工具;工具自身调用不产生额外 API 或订阅费用。
When invoking `cargo`, verify flags with `cargo --help` first, close stdin to avoid interactive prompts, and require confirmation before remote or destructive mutations.
Agent 高频安全命令配方
只读查询(安全推荐)
cargo --help
在构建自动化调用前,先通过 cargo 确认支持的参数与子命令结构。
cargo --version
零副作用确认 cargo 已正确安装并可在环境变量 PATH 中调用。
核心优势
- + 收录于 tldr-pages 命令语料库,支持通过
gh repo clone rust-lang/rustfmt稳定复现安装 - + 具备
cargo的 tldr-pages 常用命令示例语料,上手门槛低
注意事项与踩坑点
- ! 低置信度基础评测:尚未在本机执行探针实测;编写脚本前请先运行
cargo --help核对实际参数
同分类相关 CLI: 代码托管与研发协同
进入分类页 →cargo-deb — 研发、Git 与 DevOps命令行工具(Make Debian packages (.deb) easily with a Cargo subcommand)
cargo-features-manager — 研发、Git 与 DevOps命令行工具(TUI like cli tool to manage the features of your rust-project dependencies)
cargo-tauri — 研发、Git 与 DevOps命令行工具(Build smaller, faster, and more secure desktop and mobile applications with a web frontend)