README
🚀 AiDD 使用文档
AiDD(人工智能驱动开发工具)是一款专为开发者打造的强大命令行工具,能有效提升开发效率,简化日常开发任务。它支持多种编程语言和系统操作,还配备了一系列实用工具,为开发人员提供便利。
🚀 快速开始
AiDD 是一个功能强大的命令行工具,支持多种编程语言和系统操作。通过简单的安装和配置,你就可以使用它提供的各种实用工具。
✨ 主要特性
- 支持多种编程语言,如 Python、JavaScript、Ruby、PHP、Go 和 Rust。
- 提供工具列表查看功能,方便了解所有可用工具。
- 可执行代码和 Shell 脚本,并支持设置执行超时时间。
- 具备信息查询工具,可获取系统基本信息。
📦 安装指南
安装
-
通过 npm 安装:
npm install -g @skydeckai/aidd -
通过源代码安装: 克隆仓库后运行以下命令进行安装:
git clone https://github.com/skydeckai/mcp-server-aidd.git cd mcp-server-aidd && npm install
配置
配置文件位于 ~/.aidd/config.json,默认内容如下:
{
"allowed_directory": "/path/to/workspace"
}
- allowed_directory:指定允许操作的目录路径。
💻 使用示例
基础用法
查看工具列表
通过以下命令查看所有可用工具及其简要说明:
aidd-cli --list-tools
执行代码
支持的语言有 Python (python3)、JavaScript (Node.js)、Ruby、PHP、Go 和 Rust。
# Python 示例
aidd-cli --tool execute_code --args '{
"language": "python",
"code": "print(sum(range(10)))"
}'
# JavaScript 示例
aidd-cli --tool execute_code --args '{
"language": "javascript",
"code": "console.log(Array.from({length: 5}, (_, i) => i*2))"
}'
执行 Shell 脚本
# 列出目录内容
aidd-cli --tool execute_shell_script --args '{
"script": "ls -la"
}'
# 查找所有 Python 文件
aidd-cli --tool execute_shell_script --args '{
"script": "find . -name \"*.py\" -type f"
}'
信息查询工具
aidd-cli --tool info_query
高级用法
执行代码时设置超时时间
# Python 示例,设置超时时间为 10 秒
aidd-cli --tool execute_code --args '{
"language": "python",
"code": "print(sum(range(10))); import time; time.sleep(20)",
"timeout": 10
}'
执行 Shell 脚本时设置超时时间
# 列出目录内容,设置超时时间为 100 秒
aidd-cli --tool execute_shell_script --args '{
"script": "ls -la; sleep 150",
"timeout": 100
}'
📚 详细文档
执行代码参数说明
| 参数名 | 类型 | 是否必填 | 描述 | |----------|--------|----------|--------------------------| | language | string | 是 | 要使用的编程语言 | | code | string | 是 | 需要执行的代码 | | timeout | integer| 否 | 最大执行时间(默认:5秒) |
执行 Shell 脚本参数说明
| 参数名 | 类型 | 是否必填 | 描述 | |----------|--------|----------|--------------------------| | script | string | 是 | 需要执行的 Shell 脚本 | | timeout | integer| 否 | 最大执行时间(默认:300秒) |
信息查询工具输出结果
{
"os": "Linux",
"version": "22.04",
"kernel": "5.15.x",
"architecture": "x86_64"
}
🔧 技术细节
目前处于积极开发阶段,功能和 API 可能会发生变化。
📄 许可证
Apache License 2.0 - 请参见 LICENSE
Scan to join WeChat group