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 <platform>"
nssm start PrismGateway
# 查看状态
nssm status PrismGateway
Gateway 连接测试
飞书
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: 会话保存在本地:
# Windows
# 默认路径:%USERPROFILE%\.prism\sessions\
# macOS / Linux
# 默认路径:~/.prism/sessions/
桌面端侧边栏也提供会话保存/加载按钮。
PyPI 安装
pip install prism-agent
prism --help
prism-desktop
PyPI 已发布:
https://pypi.org/project/prism-agent/2.1.2/
外部用户使用说明
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.2.tar.gzdist/prism_agent-2.1.2-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
飞书对接
一键配置
prism setup feishu --app-id cli_xxxx --app-secret xxxx
该命令会自动:
- 把配置写入
~/.prism/config.yaml - 启动飞书 WebSocket Gateway
手动启动
prism gateway start --platform feishu
前置条件
- 飞书开放平台已创建应用
- 已开启“机器人”能力
- 事件订阅选择“使用长连接接收事件”
- 已添加事件
im.message.receive_v1 - 应用已发布/上线
开发
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。
Metadata
Release files for prism-agent 2.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prism_agent-2.1.7.tar.gz | 310.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prism_agent-2.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 715.1 kB
Release files / prism_agent-2.1.7.tar.gz
| Download URL | prism_agent-2.1.7.tar.gz |
|---|---|
| Size | 310.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24818751a926ed682de6dc3e2954bc87c3df8a644402389f42b8dbae3392bc19
|
|
BLAKE2b-256 checksum How to use checksums |
3fcee0cc66fb228e74c0d531d11316783cf2319bd86cf05b20f4a2fec52a9657
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / prism_agent-2.1.7-py3-none-any.whl
| Download URL | prism_agent-2.1.7-py3-none-any.whl |
|---|---|
| Size | 404.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7eb76081d59cf4fe3b93f9b10be89bc46f996b0d8cddc75c8846d9a689b5af3
|
|
BLAKE2b-256 checksum How to use checksums |
7416b049abb59566e5ebb20829441dca4c87ef72cae521bb17dd803af0483a54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|