Minimal single-agent gateway with ACP backends, skills, and messaging adapters
Project description
onebot
onebot 是一個以 Python + uv 打造的精簡 single-agent 框架,支援:
- CLI 與 Web(FastAPI + Uvicorn)
- Telegram / LINE 作為訊息 I/O
- Skills(相容 OpenClaw / SKILLS 的
SKILL.md規範) - ClawHub skill 搜尋 / 安裝(透過官方
clawhubCLI) - ACP backend 切換:
gemini --acp、copilot --acp、claude-code-acp - MCP servers(透過 ACP backend 傳入)
PyPI distribution 名稱:
onebot-agent(CLI 指令:onebot)
1) 需求
- Python 3.11+
- uv
依你選的 backend,還需要:
- Claude:
claude-code-acp(由 Python 套件安裝),以及 Claude CLI 已完成登入 - Gemini:
geminiCLI(ACP 模式) - Copilot:
copilotCLI(ACP 模式)
若要使用 ClawHub skills:
clawhubCLI(例如:npm i -g clawhub)
2) 安裝與開發
# 進入專案
cd onebot
# 安裝(含 dev)
uv sync --dev
# 看指令
uv run onebot --help
3) 快速開始
3.1 本地單次對話(ACP backend)
export ONEBOT_ACP_BACKEND=claude
uv run onebot chat "請幫我建立一個 hello.py"
切換 backend:
# Gemini
export ONEBOT_ACP_BACKEND=gemini
export ONEBOT_ACP_COMMAND=gemini
export ONEBOT_ACP_ARGS="--experimental-acp"
# Copilot
export ONEBOT_ACP_BACKEND=copilot
export ONEBOT_ACP_COMMAND=copilot
export ONEBOT_ACP_ARGS="--acp"
3.2 啟動 Web API
uv run onebot web --host 127.0.0.1 --port 18790
可用端點:
GET /healthGET /skillsGET /adaptersGET /configPOST /line/webhook
3.3 啟動 Telegram polling
export ONEBOT_TELEGRAM_TOKEN=<your-bot-token>
uv run onebot telegram
3.4 LINE webhook
- 設定:
export ONEBOT_LINE_CHANNEL_SECRET=<secret>
export ONEBOT_LINE_CHANNEL_ACCESS_TOKEN=<token>
- 啟動 Web:
uv run onebot web --host 0.0.0.0 --port 18790
- 在 LINE Developers 把 webhook URL 設為:
https://<your-domain>/line/webhook
4) Skills / ClawHub
列本地 skills:
uv run onebot skill list
uv run onebot skill list --all
搜尋 / 安裝 / 更新(透過 clawhub CLI):
uv run onebot skill search "postgres backups"
uv run onebot skill install my-skill
uv run onebot skill update my-skill
uv run onebot skill update --all
進階 passthrough:
uv run onebot skill clawhub list
5) MCP 設定
透過 ONEBOT_MCP_SERVERS 以 JSON 陣列提供(會傳入 ACP backend):
export ONEBOT_MCP_SERVERS='[
{
"name": "my-mcp",
"command": "uvx",
"args": ["my-mcp-server"]
}
]'
注意:不同 backend 對 MCP 的支援程度不同(例如 Gemini 通常需要先在 CLI 內預先配置)。
6) 主要環境變數
ONEBOT_WORKSPACE(預設~/.onebot)ONEBOT_ACP_BACKEND:claude|gemini|copilotONEBOT_ACP_COMMAND:覆寫 backend commandONEBOT_ACP_ARGS:覆寫 backend args(shell 字串)ONEBOT_MCP_SERVERS:MCP servers JSON 陣列ONEBOT_TELEGRAM_TOKENONEBOT_LINE_CHANNEL_SECRETONEBOT_LINE_CHANNEL_ACCESS_TOKEN
7) 測試與品質
uv run ruff check .
uv run pytest -q
8) 發佈流程(GitHub Release -> PyPI)
本專案已提供:
.github/workflows/ci.yml:push / PR 執行 lint + test.github/workflows/publish.yml:Release published 時 build + publish
建議使用 PyPI Trusted Publisher(OIDC):
- 在 PyPI 專案設定 Trusted Publisher 指向本 GitHub repo/workflow
- GitHub 建立 Release(Published)
- workflow 自動
uv build並上傳dist/*到 PyPI
9) 安全說明(目前)
- ACP 的檔案讀寫與終端執行有 workspace 限制與危險指令 deny patterns。
- 目前屬 MVP 安全層;高隔離場景建議後續加 Docker sandbox。
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 onebot_agent-0.1.0.tar.gz.
File metadata
- Download URL: onebot_agent-0.1.0.tar.gz
- Upload date:
- Size: 63.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d653d36fa4e7a99e03957d62d841bda405173786c82cb5d58d3c5d8369af06b8
|
|
| MD5 |
de70db7a97d42e2b6f3089e9ab12995d
|
|
| BLAKE2b-256 |
8321a7494142ae0ef66183fd47884d819b08ab99c6c788a86e528920cf41e503
|
Provenance
The following attestation bundles were made for onebot_agent-0.1.0.tar.gz:
Publisher:
publish.yml on yazelin/onebot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onebot_agent-0.1.0.tar.gz -
Subject digest:
d653d36fa4e7a99e03957d62d841bda405173786c82cb5d58d3c5d8369af06b8 - Sigstore transparency entry: 943427004
- Sigstore integration time:
-
Permalink:
yazelin/onebot@38f6d7b33d56a8a8a893a321b7f6e7daafb0ea05 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yazelin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38f6d7b33d56a8a8a893a321b7f6e7daafb0ea05 -
Trigger Event:
release
-
Statement type:
File details
Details for the file onebot_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: onebot_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55df018af7c74a54b49e089d68212ba938d52d5e9d57301f16eda355e7bbe238
|
|
| MD5 |
a366dfd0147f994cb7e655a999482124
|
|
| BLAKE2b-256 |
a007805f2e1bf53df9ffd1a20a557f05611685bcbb2fdadff3b1038f96a6d694
|
Provenance
The following attestation bundles were made for onebot_agent-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yazelin/onebot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
onebot_agent-0.1.0-py3-none-any.whl -
Subject digest:
55df018af7c74a54b49e089d68212ba938d52d5e9d57301f16eda355e7bbe238 - Sigstore transparency entry: 943427045
- Sigstore integration time:
-
Permalink:
yazelin/onebot@38f6d7b33d56a8a8a893a321b7f6e7daafb0ea05 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yazelin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38f6d7b33d56a8a8a893a321b7f6e7daafb0ea05 -
Trigger Event:
release
-
Statement type: