2026-07-15 14:00:36 +08:00

56 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# PicoBot 常用命令
```bash
# 编译
cargo build
# 启动网关 (默认 127.0.0.1:19876)
cargo run -- gateway
# WebUI 随 Gateway 提供,浏览器打开
# http://127.0.0.1:19876/
# 修改 WebUI 后独立检查Node.js 20+
cd webui
npm ci
npm run check
npm run build
# cargo build 会增量生成并嵌入正式 WebUI 资源
cd ..
cargo build
# 启动 CLI 客户端 (连接 ws://127.0.0.1:19876/ws)
cargo run -- chat
# 安装并启动 Linux systemd 用户服务
picobot service install
picobot service start
# 查看、重启或停止服务
picobot service status
picobot service restart
picobot service stop
# 停止、禁用并删除服务
picobot service uninstall
# 运行单元测试
cargo test --lib
# 运行离线集成/协议测试
cargo test --test test_scheduler
cargo test --test test_request_format
# 运行代码检查Rust 修改必跑)
cargo clippy --all-targets --all-features -- -D warnings
# 运行模型 API 集成测试(需配置 tests/test.env
cargo test --test test_integration -- --ignored
cargo test --test test_tool_calling -- --ignored
```
`test_scheduler``test_request_format` 不需要 API Key也没有标记 `#[ignore]`。只有会真实调用 Provider 的测试需要从 `tests/test.env.example` 创建 `tests/test.env` 后使用 `-- --ignored`
最终用户使用 WebUI 不需要单独构建;开发源码采用 Svelte 5、Vite 和 Bits UI`cargo build` 会增量生成前端到 Cargo `OUT_DIR` 并嵌入二进制生成产物不提交。WebUI 支持在线聊天、动态斜杠命令补全、日志、任务、记忆以及 `config.json``USER.md``AGENTS.md` 编辑。它与 Gateway 属于同一信任边界;非回环部署需要在外层配置 TLS 和认证。