一键导入
shell
VOTX Agent run_command tool usage guide for safe local command execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
VOTX Agent run_command tool usage guide for safe local command execution.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
通用下载编排器。下载公开可访问、开源授权或用户本人授权的数字资源;提供 inspect_download_url、download_direct_file、download_video、list_downloads 四个工具。
本地双层知识库检索与问答。用户要求从知识库、资料目录或本地文档中查信息、总结、核对来源时使用。先按 data_structure.md 分层导航,再渐进检索候选文件;遇到 PDF/Excel 时先读取本 Skill 的 references 处理指南。
双模式记忆管理:保存、读取、搜索、删除、审阅和清理用户记忆。被动模式只处理临时层;主动审阅读取临时+永久并将有价值内容晋升到永久层。用户要求记住、忘记、搜索记忆、审阅记忆、清理记忆时使用。
创建或更新 VOTX Agent Skill 的指导技能。用于设计 SKILL.md、工具型或指令型 Skill、scripts/references/assets 资源、触发描述、渐进式披露结构,以及验证现有 Skill 是否适配框架。
将复杂用户请求自动分解为可执行步骤计划,可视化进度,支持暂停/继续/中止。受用户 config.json 中 task_plan.accept_task 控制。
管理 cron 定时任务 — 创建/查看/修改/删除每日、单次或重复定时任务,由后台调度器自动执行
| name | shell |
| version | 1.2.0 |
| description | VOTX Agent run_command tool usage guide for safe local command execution. |
| author | BytesAgain |
| homepage | https://bytesagain.com |
| source | https://github.com/bytesagain/ai-skills |
| tags | ["run_command","votx","agent","sandbox","automation","devtools"] |
| category | devtools |
本技能说明如何在 VOTX Agent 中安全调用 run_command。优先使用专用工具;只有诊断、构建、测试或没有等价工具时才调用系统命令。
run_command(command: "python --version")
run_command(command: "python start_web.py", working_dir: "E:\\code\\votx-agent")
run_command(command: "python -c \"import sys; print(sys.stdin.read())\"", stdin: "hello")
run_command(command: "python -c \"import os; print(os.environ['FOO'])\"", env: {"FOO": "bar"})
run_command(command: "export FOO=\"bar baz\" && env", session_id: "dev")
run_command(command: "cd E:\\code\\votx-agent && python --version")
run_command(command: "python -c \"import sys; sys.exit(1)\" || python -c \"print(42)\"")
run_command(command: "python -c \"print(1)\" ; python -c \"print(2)\"")
run_command(command: "pwd")
run_command(session_id: "dev", command: "cd E:\\code\\votx-agent && export FOO=bar && pwd")
run_command(session_id: "dev", command: "history")
run_command(session_id: "dev", reset_session: true, command: "pwd")
run_command 每次都是独立子进程,不保留上一次命令的目录、临时环境变量或标准输入。多步任务优先使用 working_dir;如果要临时切目录,可以在同一条命令里用受限的 cd/chdir/pwd 片段,或用 && / || / ; 连接多个步骤。
session_id 会让 cwd、会话环境变量和历史记录在多次调用间保持一致;reset_session 可清空指定会话。export/set/env 现在支持带空格的赋值值,比如 FOO="bar baz"。
working_dir:工作目录,默认使用当前用户目录。timeout:单次命令超时,0 表示使用配置值。stdin:传给子进程的标准输入文本。env:附加环境变量,只接受普通键名,敏感键会被拒绝。session_id:同一会话共享 cwd/env/history。reset_session:重置指定 session_id 的会话状态。cd/chdir:只在当前调用内生效;可以写成 cd 目录 && 命令。&& / || / ;:顶层命令链连接符,按顺序执行。pwd:返回当前调用的工作目录。export/set/env:设置或查看会话环境变量。unset:删除会话环境变量。history:查看会话历史。run_command 使用 subprocess 安全模式(shell=False),不经过系统 shell 解析,因此跨平台行为一致。但需要注意以下差异:
| 平台 | 路径分隔符 | 示例 |
|---|---|---|
| Windows | \ | E:\code\votx-agent |
| Linux/macOS | / | /home/user/votx-agent |
working_dir 参数支持原生路径分隔符,也接受 /(Windows 上 Python 会自动转换)。os.path.join。| 场景 | Windows | Linux/macOS |
|---|---|---|
| 列目录 | dir /b (cmd) | ls |
| 查看文件内容 | type file.txt (cmd) | cat file.txt |
| 查看环境变量 | set (cmd) 或 `env | sort` (PowerShell) |
| 查找进程 | tasklist | ps aux |
| 终止进程 | taskkill /PID xxx | kill xxx |
| 查看端口 | netstat -ano | ss -tlnp 或 netstat -tlnp |
| 查找文件 | where xxx (cmd) | which xxx 或 find / -name xxx |
| 查看磁盘 | wmic logicaldisk get | df -h |
| 系统信息 | systeminfo | uname -a |
run_command(command: "cmd.exe /c \"dir /b\"")
run_command(command: "cmd.exe /c \"build_windows.bat\"")
run_command(command: "powershell -NoProfile -Command \"Get-ChildItem -File\"")
run_command(command: "powershell -NoProfile -Command \"Get-Content .\\version.json\"")
run_command(command: "powershell -NoProfile -Command \"Get-Process | Select-Object -First 10\"")
Windows 下 run_command 自带 UTF-8 编码处理:
chcp 65001(通过 PYTHONUTF8=1 环境变量)cmd /c 和 cmd /k 命令会自动注入 chcp 65001 > nul 前缀run_command(command: "ls -la", working_dir: "/home/user/votx-agent")
run_command(command: "cat /etc/os-release")
run_command(command: "ps aux | grep python")
run_command(command: "df -h")
run_command(command: "uname -a")
run_command(command: "systemctl status votx-agent")
Linux/macOS 下编码默认 UTF-8,无需特殊处理。
优先使用 Python 命令代替平台特定命令:
# 获取文件列表(跨平台)
run_command(command: "python -c \"import os; print('\\n'.join(os.listdir('.')))\"")
# 获取环境变量(跨平台)
run_command(command: "python -c \"import os; print('\\n'.join(f'{k}={v}' for k,v in sorted(os.environ.items())))\"")
# 查找命令路径(跨平台)
run_command(command: "python -c \"import shutil; print(shutil.which('git'))\"")
# 获取系统信息(跨平台)
run_command(command: "python -c \"import platform; print(platform.platform())\"")
.env 内容或用户隐私文件。run_command(command: "python -m py_compile main.py", working_dir: "E:\\code\\votx-agent")
run_command(command: "python -m compileall -q .", working_dir: "E:\\code\\votx-agent")
run_command(command: "python setup.py", working_dir: "E:\\code\\votx-agent")
run_command(command: "git status", working_dir: "E:\\code\\votx-agent")
run_command(command: "git log --oneline -10", working_dir: "E:\\code\\votx-agent")
run_command(command: "git diff --stat", working_dir: "E:\\code\\votx-agent")
run_command(command: "python --version")
run_command(command: "node --version")
run_command(command: "pip list")
run_command(session_id: "dev", command: "cd /home/user/project && export PATH=$PATH:/usr/local/bin && pwd")
run_command(session_id: "dev", command: "python --version")
run_command(session_id: "dev", command: "history")
run_command(session_id: "dev", reset_session: true, command: "pwd")
工具优先返回单一输出流;当标准输出和标准错误同时存在时,会同时返回两者并标注 STDOUT: / STDERR:。非零退出码会附带 (exit=<code>)。需要稳定解析时,让命令输出 JSON、CSV 或固定格式文本。
| 变量 | 说明 |
|---|---|
tool.tool_timeout | 命令超时,读取优先级为用户配置 > 全局配置 > 工具内默认值 |
plugins/shell/
| 工具 | 用途 |
|---|---|
run_command | 以受控 subprocess 模式执行本地命令,支持工作目录、stdin、环境变量、超时和会话状态 |
STDOUT: / STDERR:。(exit=<code>)。ERROR: 前缀的错误信息。working_dir。session_id。.env 内容。cmd.exe /c 或 powershell -NoProfile -Command。timeout 或拆分任务;连续失败时停止重试并分析原因。run_command 默认不经过系统 shell,管道、重定向和平台内建命令可能需要显式 shell 入口。session_id。