用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/voidzero-dev/vite-plus --skill spawn-process命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | spawn-process |
| description | Guide for writing subprocess execution code using the vp_command crate |
| allowed-tools | Read, Grep, Glob, Edit, Write, Bash |
When writing Rust code that needs to spawn subprocesses (resolve binaries, build commands, execute programs), always use the vp_command crate. Never use which, tokio::process::Command::new, or std::process::Command::new directly.
vp_command::resolve_bin(name, path_env, cwd) — Resolve a binary name to an absolute pathHandles PATHEXT (.cmd/.bat) on Windows. Pass None for path_env to search the current process PATH.
// Resolve using current PATH
let bin = vp_command::resolve_bin("node", None, &cwd)?;
// Resolve using a custom PATH
let custom_path = std::ffi::OsString::from(&path_env_str);
let bin = vp_command::resolve_bin("eslint", Some(&custom_path), &cwd)?;
vp_command::build_command(bin_path, cwd) — Build a command for a pre-resolved binaryReturns tokio::process::Command with cwd, inherited stdio, and fix_stdio_streams on Unix already configured. Add args, envs, or override stdio as needed.
let bin = vp_command::resolve_bin("eslint", None, &cwd)?;
let mut cmd = vp_command::build_command(&bin, &cwd);
cmd.args(&[".", "--fix"]);
cmd.env("NODE_ENV", "production");
let mut child = cmd.spawn()?;
let status = child.wait().await?;
vp_command::build_shell_command(shell_cmd, cwd) — Build a shell commandUses /bin/sh -c on Unix, cmd.exe /C on Windows. Same stdio and fix_stdio_streams setup as build_command.
let mut cmd = vp_command::build_shell_command("echo hello && ls", &cwd);
let mut child = cmd.spawn()?;
let status = child.wait().await?;
vp_command::run_command(bin_name, args, envs, cwd) — Resolve + build + run in one callCombines resolve_bin, build_command, and status().await. The envs HashMap must include "PATH" if you want custom PATH resolution.
let envs = HashMap::from([("PATH".to_string(), path_value)]);
let status = vp_command::run_command("node", &["--version"], &envs, &cwd).await?;
Add vp_command to the crate's Cargo.toml:
[dependencies]
vp_command = { workspace = true }
Do NOT add which as a direct dependency — binary resolution goes through vp_command::resolve_bin.
crates/vp_global_cli/src/shim/exec.rs uses synchronous std::process::Command with Unix exec() for process replacement. This is the only place that bypasses vp_command.