统一 AI Agent CLI:整合 Hermes/Codex/OpenClaw 能力
Project description
PRISM Agent
统一 AI Agent CLI + 桌面客户端 — 整合 Hermes + Codex + OpenClaw 能力
一键安装
Windows:
git clone https://github.com/jz616059669/prism-agent.git
cd prism-agent
.\scripts\install.ps1
Windows 额外支持:
# 打包桌面客户端
.\scripts\build-windows.cmd
# 或手动执行 PowerShell 脚本
powershell -ExecutionPolicy Bypass -File .\scripts\build-windows.ps1
# 验证打包结果
ls dist-windows\
# 查看产物大小
du -sh dist-windows\*
# 验证主程序可运行
.\dist-windows\prism-desktop.exe --help
.\dist-windows\prism.exe --help
如打包失败,请检查:
flet是否已安装:pip install flet- 是否在项目根目录执行
- 网络是否可访问(下载 Flet 依赖需要)
后台运行 Gateway(NSSM)
nssm install PrismGateway "C:\path\to\prism.exe" "gateway start --platform " nssm start PrismGateway
查看状态
nssm status PrismGateway
## Gateway 连接测试
### 飞书
```bash
prism gateway start --platform feishu --app-id <APP_ID> --app-secret <APP_SECRET> --encrypt-key <ENCRYPT_KEY> --verification-token <VERIFICATION_TOKEN>
Telegram
prism gateway start --platform telegram --token <BOT_TOKEN>
Discord
prism gateway start --platform discord --token <BOT_TOKEN>
微信(待接入真实协议)
prism gateway start --platform wechat --app-id <APP_ID> --app-secret <APP_SECRET> --token <TOKEN>
常见问题
Q: 会话保存在哪里?
A: 会话保存在本地:
macOS 额外支持:
```bash
# 打包桌面客户端
bash scripts/build-macos.sh
# 安装 launchd 服务(后台运行 Gateway)
cp scripts/com.prism.gateway.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.prism.gateway.plist
launchctl list | grep prism
Linux(Ubuntu/Debian/Fedora/Arch):
git clone https://github.com/jz616059669/prism-agent.git
cd prism-agent
bash scripts/install.sh
Linux 额外支持:
# 打包桌面客户端
bash scripts/build-linux.sh
# 安装 systemd 服务(后台运行 Gateway)
sudo cp scripts/prism-gateway.service /etc/systemd/system/
sudo systemctl enable prism-gateway
sudo systemctl start prism-gateway
sudo systemctl status prism-gateway
安装完成后:
prism --help # CLI
prism-desktop # 桌面客户端
PyPI 安装
pip install prism-agent
prism --help
prism-desktop
PyPI 已发布:
https://pypi.org/project/prism-agent/2.1.0/
外部用户使用说明
1. 环境准备
- Python 3.11+
- Git
- 网络访问(GitHub、模型 API)
2. 安装
# 方式1:PyPI
pip install prism-agent
# 方式2:源码
git clone https://github.com/jz616059669/prism-agent.git
cd prism-agent
pip install -e .
3. 配置模型
# 方式1:CLI
prism config set model.provider stepfun
prism config set model.base_url https://api.stepfun.com/step_plan/v1
prism config set model.api_key YOUR_KEY
# 方式2:编辑配置文件
notepad %USERPROFILE%\.prism\config.yaml # Windows
open ~/.prism/config.yaml # macOS/Linux
4. 安装桌面端(可选)
pip install prism-agent[desktop]
# 或
pip install flet
5. 验证
prism doctor
prism ask "你好"
prism-desktop
6. 常见问题
- 浏览器失败:
playwright install --force chromium - 模型 401/403:检查
model.api_key和model.base_url - 桌面端失败:确认
flet已安装,并重装prism-desktop
会话持久化
PRISM 支持将对话会话保存到本地:
# 查看已保存会话
prism session list
# 保存当前会话
prism session save 会话名称
# 加载会话
prism session load 会话名称
# 删除会话
prism session delete 会话名称
会话文件存储在:
- Windows:
%USERPROFILE%\.prism\sessions\ - macOS/Linux:
~/.prism/sessions/
桌面端侧边栏也提供会话保存/加载按钮。
手动安装
当前能力
| 能力 | 状态 | 说明 |
|---|---|---|
| 统一模型接口 | ✅ | 一个命令切换任意模型,自动降级 |
| 多 Key 轮转 | ✅ | 凭证池自动轮转,不怕单 Key 失效 |
| 文件/终端工具 | ✅ | 读写、补丁、shell、后台任务 |
| 浏览器控制 | ✅ | Playwright 驱动,支持导航、快照、点击、输入、截图 |
| 代码执行沙箱 | ✅ | Python 代码执行,支持超时和输出捕获 |
| MCP 客户端 | ✅ | stdio / HTTP 双模式 |
| Skills 系统 | ✅ | 6 个内置 skill,支持安装/移除 |
| Gateway | ✅ | 飞书 / Telegram / Discord 适配器 |
| CLI 子命令 | ✅ | gateway / skill / browser / config / chat / ask / tools |
快速开始
# 查看版本
prism version
# 健康检查
prism doctor
# 列出工具
prism tools
# 列出 skills
prism skill list
# 搜索 skills
prism skill search 文件
# 打开网页
prism browser open https://example.com
# 单次提问
prism ask "用 Python 写一个快速排序"
# 交互聊天
prism chat
# 保存/加载会话
prism session save 我的会话
prism session list
prism session load 我的会话
# 启动桌面客户端
prism-desktop
Gateway
# 查看状态
prism gateway status
# 前台运行
prism gateway start --platform telegram --token <TOKEN>
prism gateway start --platform feishu --app-id <ID> --app-secret <SECRET>
prism gateway start --platform wechat --app-id <ID> --app-secret <SECRET>
# Linux 后台运行(systemd)
sudo cp scripts/prism-gateway.service /etc/systemd/system/
sudo systemctl enable prism-gateway
sudo systemctl start prism-gateway
sudo systemctl status prism-gateway
# macOS 后台运行(launchd)
cp scripts/com.prism.gateway.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.prism.gateway.plist
launchctl list | grep prism
配置
prism config set model.default step-3.7-flash
prism config get model.default
prism config get
外部用户首次配置
-
获取 API Key
- StepFun:https://platform.stepfun.com
- OpenAI:https://platform.openai.com
- 其他兼容 OpenAI 的提供商
-
配置模型
# 方式1:CLI
prism config set model.provider stepfun
prism config set model.base_url https://api.stepfun.com/step_plan/v1
prism config set model.api_key YOUR_KEY
# 方式2:编辑配置文件
notepad %USERPROFILE%\.prism\config.yaml # Windows
open ~/.prism/config.yaml # macOS/Linux
- 安装桌面端(可选)
# pip 安装时自带桌面依赖
pip install prism-agent[desktop]
# 或单独安装
pip install flet
- 验证
prism doctor
prism ask "你好"
本地发布 / 上传 PyPI
本地构建
# 构建分发包
uv run python -m build
# 校验
uv run twine check dist/*
产物:
dist/prism_agent-2.1.0.tar.gzdist/prism_agent-2.1.0-py3-none-any.whl
上传到 PyPI
pip install twine
twine upload dist/*
需要 PyPI 账号 + token。未配置前可先用
pip install .本地安装。
故障排查
安装问题
uv安装失败:访问 https://docs.astral.sh/uv/ 手动安装- Python 版本过低:需要 Python 3.11+
pip install慢:换国内镜像源
模型问题
- 401/403:检查
model.api_key和model.base_url - 响应慢:检查网络,或切换备用模型
- 无可用提供商:运行
prism config set model.provider <provider>
浏览器问题
# 重新安装 Chromium
playwright install --force chromium
# 验证浏览器
prism browser open https://example.com
桌面端问题
- 启动失败:确认
flet已安装,并重装prism-desktop - 窗口空白:尝试切换主题(侧边栏“切换主题”)
- 配置丢失:检查
~/.prism/desktop_settings.json
Gateway 问题
- 启动失败:检查 token/app_id,查看日志
- 消息收不到:确认事件订阅 URL 可公网访问
- 飞书:检查 Encrypt Key 和 Verification Token
快速诊断
prism doctor
开发
git clone https://github.com/jz616059669/prism-agent.git
cd prism-agent
pip install -e .
pytest
路线图
- 飞书 / Telegram / Discord / 微信 真实连接验证
- MCP 服务器连接测试
- Skills 市场 / 一键安装
- 浏览器测试套件完善
- ACP 协议支持
本地教程
本地保留的教程不上传 GitHub:
INSTALL_FEISHU.mdVIDEO_TUTORIAL.md
贡献
PRISM 仍在快速迭代。欢迎提 issue / PR。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prism_agent-2.1.0.tar.gz.
File metadata
- Download URL: prism_agent-2.1.0.tar.gz
- Upload date:
- Size: 88.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
862113db5ac216c8afaa2cff5a9296b0b0c4cb982c1bc1a75e2e4504c13b0785
|
|
| MD5 |
2975afe02a8ddd5b5c09f93d13e32b14
|
|
| BLAKE2b-256 |
64c982766600120b7235e142dee95c46556a0862810058b29c335721e3dd1072
|
File details
Details for the file prism_agent-2.1.0-py3-none-any.whl.
File metadata
- Download URL: prism_agent-2.1.0-py3-none-any.whl
- Upload date:
- Size: 91.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3959000cc826f0b75c6561c8566e59b9f823e64a5965a4c18801aee2cc02af92
|
|
| MD5 |
77247121b54f4bddae9c59c685d5b057
|
|
| BLAKE2b-256 |
4da33fc3c58b3f57fca7051d1b1842d1ed4dcf3b9a4e8b68fac84c8104844296
|