openagent-framework 0.2.4__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. openagent_framework-0.2.6/PKG-INFO +597 -0
  2. openagent_framework-0.2.6/docs/README.md +570 -0
  3. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/__init__.py +1 -1
  4. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/agent.py +26 -1
  5. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/bootstrap.py +185 -44
  6. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/cli.py +76 -23
  7. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/server.py +16 -12
  8. openagent_framework-0.2.6/openagent/services/__init__.py +7 -0
  9. openagent_framework-0.2.6/openagent/services/syncthing.py +249 -0
  10. openagent_framework-0.2.6/openagent_framework.egg-info/PKG-INFO +597 -0
  11. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent_framework.egg-info/SOURCES.txt +1 -1
  12. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/pyproject.toml +1 -1
  13. openagent_framework-0.2.4/PKG-INFO +0 -454
  14. openagent_framework-0.2.4/docs/README.md +0 -427
  15. openagent_framework-0.2.4/openagent/services/__init__.py +0 -7
  16. openagent_framework-0.2.4/openagent/services/obsidian.py +0 -157
  17. openagent_framework-0.2.4/openagent_framework.egg-info/PKG-INFO +0 -454
  18. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/__init__.py +0 -0
  19. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/base.py +0 -0
  20. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/discord.py +0 -0
  21. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/senders.py +0 -0
  22. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/telegram.py +0 -0
  23. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/channels/whatsapp.py +0 -0
  24. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/config.py +0 -0
  25. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcp/__init__.py +0 -0
  26. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcp/client.py +0 -0
  27. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcp/oauth.py +0 -0
  28. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/chrome-devtools/.gitignore +0 -0
  29. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/chrome-devtools/package.json +0 -0
  30. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/.gitignore +0 -0
  31. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/package.json +0 -0
  32. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/index.ts +0 -0
  33. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/main.ts +0 -0
  34. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/tools/computer.ts +0 -0
  35. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/tools/index.ts +0 -0
  36. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/utils/response.ts +0 -0
  37. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/src/xdotoolStringToKeys.ts +0 -0
  38. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/computer-control/tsconfig.json +0 -0
  39. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/editor/.gitignore +0 -0
  40. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/editor/package.json +0 -0
  41. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/editor/src/index.ts +0 -0
  42. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/editor/tsconfig.json +0 -0
  43. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/messaging/.gitignore +0 -0
  44. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/messaging/index.ts +0 -0
  45. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/messaging/package.json +0 -0
  46. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/messaging/tsconfig.json +0 -0
  47. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/shell/.gitignore +0 -0
  48. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/shell/package.json +0 -0
  49. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/shell/src/index.ts +0 -0
  50. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/shell/tsconfig.json +0 -0
  51. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/.gitignore +0 -0
  52. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/package.json +0 -0
  53. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/browser-pool.ts +0 -0
  54. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/content-extractor.ts +0 -0
  55. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/enhanced-content-extractor.ts +0 -0
  56. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/index.ts +0 -0
  57. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/rate-limiter.ts +0 -0
  58. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/search-engine.ts +0 -0
  59. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/types.ts +0 -0
  60. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/src/utils.ts +0 -0
  61. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/mcps/web-search/tsconfig.json +0 -0
  62. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/memory/__init__.py +0 -0
  63. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/memory/db.py +0 -0
  64. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/memory/manager.py +0 -0
  65. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/models/__init__.py +0 -0
  66. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/models/base.py +0 -0
  67. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/models/claude_api.py +0 -0
  68. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/models/claude_cli.py +0 -0
  69. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/models/zhipu.py +0 -0
  70. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/scheduler.py +0 -0
  71. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/service.py +0 -0
  72. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/services/base.py +0 -0
  73. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent/services/manager.py +0 -0
  74. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent_framework.egg-info/dependency_links.txt +0 -0
  75. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent_framework.egg-info/entry_points.txt +0 -0
  76. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent_framework.egg-info/requires.txt +0 -0
  77. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/openagent_framework.egg-info/top_level.txt +0 -0
  78. {openagent_framework-0.2.4 → openagent_framework-0.2.6}/setup.cfg +0 -0
@@ -0,0 +1,597 @@
1
+ Metadata-Version: 2.4
2
+ Name: openagent-framework
3
+ Version: 0.2.6
4
+ Summary: Simplified LLM agent framework with MCP, memory, and multi-channel support
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: anthropic>=0.40.0
9
+ Requires-Dist: openai>=1.50.0
10
+ Requires-Dist: mcp>=1.0.0
11
+ Requires-Dist: click>=8.1.0
12
+ Requires-Dist: rich>=13.0.0
13
+ Requires-Dist: pyyaml>=6.0
14
+ Requires-Dist: aiosqlite>=0.20.0
15
+ Requires-Dist: croniter>=2.0.0
16
+ Requires-Dist: claude-agent-sdk>=0.1.50
17
+ Provides-Extra: telegram
18
+ Requires-Dist: python-telegram-bot>=21.0; extra == "telegram"
19
+ Provides-Extra: discord
20
+ Requires-Dist: discord.py>=2.3.0; extra == "discord"
21
+ Provides-Extra: whatsapp
22
+ Requires-Dist: whatsapp-api-client-python>=0.0.46; extra == "whatsapp"
23
+ Provides-Extra: all
24
+ Requires-Dist: python-telegram-bot>=21.0; extra == "all"
25
+ Requires-Dist: discord.py>=2.3.0; extra == "all"
26
+ Requires-Dist: whatsapp-api-client-python>=0.0.46; extra == "all"
27
+
28
+ # OpenAgent
29
+
30
+ Simplified LLM agent framework with MCP tools, persistent memory, and multi-channel support. Model-agnostic — all models get the same tools and capabilities.
31
+
32
+ ## Quick Start
33
+
34
+ ```bash
35
+ pip install openagent-framework[all]
36
+ ```
37
+
38
+ Create `openagent.yaml`:
39
+
40
+ ```yaml
41
+ name: my-agent
42
+
43
+ model:
44
+ provider: claude-cli # uses Claude Pro/Max membership (not API)
45
+
46
+ channels:
47
+ telegram:
48
+ token: ${TELEGRAM_BOT_TOKEN}
49
+ ```
50
+
51
+ Start:
52
+
53
+ ```bash
54
+ openagent serve
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Models
60
+
61
+ OpenAgent supports multiple LLM providers. Every model gets the same MCP tools — no provider-specific behavior.
62
+
63
+ ### Claude CLI (Claude Code SDK) — uses membership, not API
64
+
65
+ ```yaml
66
+ model:
67
+ provider: claude-cli
68
+ model_id: claude-sonnet-4-6
69
+ permission_mode: bypass # auto-approve all tool calls (for agent use)
70
+ ```
71
+
72
+ Requires `claude` CLI installed and authenticated (`claude login`). Uses your Claude Pro/Max membership — flat rate, not pay-per-token.
73
+
74
+ ### Claude API (Anthropic SDK)
75
+
76
+ ```yaml
77
+ model:
78
+ provider: claude-api
79
+ model_id: claude-sonnet-4-6
80
+ api_key: ${ANTHROPIC_API_KEY}
81
+ ```
82
+
83
+ ### Z.ai GLM / Any OpenAI-compatible
84
+
85
+ ```yaml
86
+ model:
87
+ provider: zhipu
88
+ model_id: glm-5 # or glm-4-plus, glm-4-flash, glm-4
89
+ api_key: ${ZAI_API_KEY} # also accepts ZHIPU_API_KEY
90
+ base_url: https://api.z.ai/api/paas/v4 # new Z.ai endpoint (replaces open.bigmodel.cn)
91
+ ```
92
+
93
+ Works with Ollama, vLLM, LM Studio — just change `base_url`:
94
+
95
+ ```yaml
96
+ model:
97
+ provider: zhipu
98
+ model_id: llama3
99
+ base_url: http://localhost:11434/v1
100
+ api_key: ollama
101
+ ```
102
+
103
+ ---
104
+
105
+ ## MCP (Model Context Protocol)
106
+
107
+ All MCP tools are available to every model — model-agnostic by design. OpenAgent includes **7 default MCPs** that load automatically.
108
+
109
+ ### Default MCPs (always loaded)
110
+
111
+ | Name | Source | What it does | Requires |
112
+ |---|---|---|---|
113
+ | `filesystem` | Official [@modelcontextprotocol/server-filesystem](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem) | Read, write, list, search files | Node.js |
114
+ | `editor` | Bundled | `edit` (find-replace), `grep` (regex search), `glob` (pattern match) | Node.js |
115
+ | `web-search` | Bundled [web-search-mcp](https://github.com/mrkrsl/web-search-mcp) | Web search + page fetch, no API key | Node.js + Playwright |
116
+ | `shell` | Bundled | `shell_exec`, `shell_which` — cross-platform shell | Node.js |
117
+ | `computer-control` | Bundled | Screenshot, mouse, keyboard (macOS/Linux/Windows) | Node.js |
118
+ | `chrome-devtools` | Bundled [chrome-devtools-mcp](https://www.npmjs.com/package/chrome-devtools-mcp) | Browser automation, DOM, performance (29+ tools) | Node.js + Chrome |
119
+ | `messaging` | Bundled | `telegram_send_message/file`, `discord_send_message/file`, `whatsapp_send_message/file` | Channel tokens in config |
120
+
121
+ The messaging MCP auto-detects which channel tokens are configured and only registers tools for active channels.
122
+
123
+ ### Disabling Defaults
124
+
125
+ ```yaml
126
+ mcp_defaults: false # disable all
127
+ mcp_disable: ["computer-control"] # disable specific ones
128
+ ```
129
+
130
+ ### Adding Your Own MCPs
131
+
132
+ User MCPs are merged on top of defaults. Same name = override.
133
+
134
+ ```yaml
135
+ mcp:
136
+ # Any stdio MCP (Node, Python, Go, Rust — anything)
137
+ - name: github
138
+ command: ["github-mcp-server", "stdio"]
139
+ env:
140
+ GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_TOKEN}
141
+
142
+ # npx-based MCPs
143
+ - name: sentry
144
+ command: ["npx", "-y", "@sentry/mcp-server@latest"]
145
+ env:
146
+ SENTRY_ACCESS_TOKEN: ${SENTRY_TOKEN}
147
+
148
+ # Remote MCP (SSE or Streamable HTTP, with automatic fallback)
149
+ - name: remote-tool
150
+ url: "http://localhost:8080/sse"
151
+
152
+ # Remote MCP with OAuth (opens browser for first-time login)
153
+ - name: service
154
+ url: "https://mcp.example.com/sse"
155
+ oauth: true
156
+ ```
157
+
158
+ ### Important: Claude CLI and `--mcp-config`
159
+
160
+ When using `claude-cli` as the model provider, OpenAgent passes all MCPs to Claude CLI via `--mcp-config`. Known constraints:
161
+
162
+ - **Requires Claude CLI 2.1.96+** (older versions ignore `--mcp-config`)
163
+ - **Do NOT use `cwd` field** in MCP config — Claude CLI silently drops servers with `cwd`
164
+ - **`type: stdio` is required** in the JSON config for each server
165
+ - Use **absolute paths** in commands/args (no relative paths)
166
+
167
+ These are handled automatically by OpenAgent — you just write `openagent.yaml` normally.
168
+
169
+ ---
170
+
171
+ ## Memory
172
+
173
+ OpenAgent's long-term memory is a plain **Obsidian-compatible markdown vault**. The agent reads and writes `.md` files directly via the [`mcpvault`](https://www.npmjs.com/package/@bitbonsai/mcpvault) MCP — no custom index, no full-text engine, no proprietary format. The files on disk *are* the database.
174
+
175
+ Session history (the per-conversation message log) is handled separately by the Claude Agent SDK's `resume=session_id`; OpenAgent no longer keeps it in SQLite. The SQLite file is only used for scheduled tasks.
176
+
177
+ ### Configuration
178
+
179
+ ```yaml
180
+ memory:
181
+ db_path: "./openagent.db" # SQLite — scheduled tasks only
182
+ vault_path: "./memories" # Obsidian markdown vault
183
+ ```
184
+
185
+ ### How it works
186
+
187
+ - The agent writes notes as `.md` files inside `vault_path/`
188
+ - MCPVault exposes `list_notes`, `read_note`, `write_note`, `search_notes`, `get_backlinks`, etc.
189
+ - Open the same `memories/` folder in Obsidian desktop and you get graph view, backlinks and plugin support for free
190
+ - Or enable the built-in **Obsidian web** service (see [Services](#services)) to run Obsidian desktop *inside a browser*, directly on the VPS
191
+
192
+ ### Memory file format
193
+
194
+ ```markdown
195
+ ---
196
+ title: Deploy Wardrobe Service
197
+ type: reference
198
+ tags: [k8s, wardrobe, ovh]
199
+ created: 2026-04-07
200
+ ---
201
+
202
+ # Deploy Wardrobe Service
203
+
204
+ rsync + docker build + k3s import...
205
+ See also: [[server-architecture]]
206
+ ```
207
+
208
+ `[[wikilinks]]`, tags and YAML frontmatter are standard Obsidian conventions. Nothing is OpenAgent-specific.
209
+
210
+ ---
211
+
212
+ ## Services
213
+
214
+ Auxiliary services run alongside the agent and are managed by the same lifecycle (`openagent serve` starts/verifies them, shutdown tears them down). Each service is a plug-in — currently there's one built-in, `syncthing`, and the same pattern can host a reverse proxy, a metrics exporter, or anything else that needs to live next to the agent.
215
+
216
+ ### Syncthing (built-in)
217
+
218
+ Keeps the memory vault in sync with your laptop (or any other machine) at the filesystem level, so you can open the same vault with the native Obsidian desktop client — no plugins, no CouchDB, no cloud. The agent writes `.md` files on the VPS, Syncthing detects the changes and pushes them to your Mac within seconds, and Obsidian on the Mac picks them up from disk.
219
+
220
+ ```yaml
221
+ services:
222
+ syncthing:
223
+ enabled: true
224
+ vault_path: /home/ubuntu/OpenAgent/memories
225
+ folder_id: openagent-memories
226
+ folder_label: OpenAgent Memories
227
+ gui_bind: 127.0.0.1:8384 # keep on localhost; reach via SSH tunnel
228
+ ```
229
+
230
+ Install with:
231
+
232
+ ```bash
233
+ openagent setup --with-syncthing
234
+ # or the one-shot:
235
+ openagent setup --full
236
+ ```
237
+
238
+ On Linux this runs `apt install syncthing` (or the dnf/pacman/zypper/apk equivalent) and enables the `syncthing.service` systemd **user** unit shipped with the package. On macOS it's `brew install syncthing` + `brew services start syncthing`. On Windows it's `winget install Syncthing.Syncthing`.
239
+
240
+ After install, `openagent setup --with-syncthing` waits for the daemon to come up, reads its device ID from the local config, registers the vault as a shared folder via Syncthing's REST API, and prints the device ID in a panel you can copy/paste. At runtime, the built-in aux service verifies the daemon is still reachable and that the folder is still registered — nothing is spawned inside the agent process.
241
+
242
+ ### Pairing a second machine
243
+
244
+ The vault only becomes useful after you pair another device (your Mac, a second VPS, a phone running Syncthing, etc.).
245
+
246
+ 1. Install Syncthing on the other machine. On macOS there's a companion script: `docs/examples/setup-syncthing-mac.sh [VAULT_DIR]` which installs Syncthing via Homebrew, starts it via `brew services`, prints the Mac's device ID, and walks you through the rest.
247
+ 2. On the VPS, forward the Syncthing GUI over SSH: `ssh -L 8385:127.0.0.1:8384 ubuntu@YOUR_VPS_HOST`. You can now open `http://127.0.0.1:8385` in your Mac browser and see the VPS Syncthing UI.
248
+ 3. In the VPS GUI, click **Add Remote Device** and paste the Mac's device ID. Save.
249
+ 4. In the Mac GUI (`http://127.0.0.1:8384`), accept the incoming device prompt.
250
+ 5. In the VPS GUI, edit the `openagent-memories` folder → **Sharing** tab → tick the Mac device. Save.
251
+ 6. In the Mac GUI, accept the incoming folder share prompt and choose a local path (e.g. `~/Documents/OpenAgent-Vault`).
252
+ 7. Open that local folder in Obsidian → *Open folder as vault*. You're done — graph view, backlinks, plugins all work against the same notes the agent writes.
253
+
254
+ The handshake is deliberately bilateral: Syncthing refuses to sync from an unknown device until both sides have approved the pairing. OpenAgent automates everything it can on the VPS side; the two or three clicks on the Mac side are your explicit consent to the pairing.
255
+
256
+ Manual control:
257
+
258
+ ```bash
259
+ openagent services status # check every configured aux service
260
+ openagent services start
261
+ openagent services stop
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Channels
267
+
268
+ All channels support text, images, files, voice, and video. Live status updates show what the agent is doing ("⏳ Thinking..." → "🔧 Using shell_exec..." → response).
269
+
270
+ ### Telegram
271
+
272
+ ```yaml
273
+ channels:
274
+ telegram:
275
+ token: ${TELEGRAM_BOT_TOKEN}
276
+ allowed_users: ["123456789", "987654321"] # optional whitelist
277
+ ```
278
+
279
+ ### Discord
280
+
281
+ ```yaml
282
+ channels:
283
+ discord:
284
+ token: ${DISCORD_BOT_TOKEN}
285
+ ```
286
+
287
+ Responds to DMs and @mentions.
288
+
289
+ ### WhatsApp (Green API)
290
+
291
+ No WhatsApp Business account needed.
292
+
293
+ ```yaml
294
+ channels:
295
+ whatsapp:
296
+ green_api_id: ${GREEN_API_ID}
297
+ green_api_token: ${GREEN_API_TOKEN}
298
+ ```
299
+
300
+ ### Running Multiple Channels
301
+
302
+ ```bash
303
+ openagent serve # all configured channels
304
+ openagent serve -ch telegram # specific channel
305
+ ```
306
+
307
+ ### Media Support
308
+
309
+ The agent can send files by including markers in responses:
310
+ ```
311
+ [IMAGE:/path/to/chart.png]
312
+ [FILE:/path/to/report.pdf]
313
+ [VOICE:/path/to/memo.ogg]
314
+ ```
315
+
316
+ ---
317
+
318
+ ## Scheduler
319
+
320
+ Cron tasks stored in SQLite — survive reboots. The scheduler runs as part of `openagent serve`.
321
+
322
+ ```yaml
323
+ scheduler:
324
+ enabled: true
325
+ tasks:
326
+ - name: health-check
327
+ cron: "*/30 * * * *"
328
+ prompt: "Check services. If any is down, use telegram_send_message to alert."
329
+ - name: daily-report
330
+ cron: "0 9 * * *"
331
+ prompt: "Generate and send the daily report."
332
+ ```
333
+
334
+ ### CLI Management
335
+
336
+ ```bash
337
+ openagent task add --name "test" --cron "* * * * *" --prompt "say hello"
338
+ openagent task list
339
+ openagent task remove <id>
340
+ openagent task enable <id>
341
+ openagent task disable <id>
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Doctor & Setup
347
+
348
+ `openagent doctor` checks the environment and reports missing pieces. `openagent setup` installs them — Syncthing, OS service, optional Docker — as far as each platform allows.
349
+
350
+ ```bash
351
+ openagent doctor # environment report, non-destructive
352
+ openagent setup # register OpenAgent as an OS service (default)
353
+ openagent setup --with-syncthing # also install Syncthing + configure the vault folder
354
+ openagent setup --with-docker # also install Docker (no aux service uses it today)
355
+ openagent setup --full # everything: Syncthing + OS service + doctor
356
+ openagent install # alias for `setup --full`
357
+ ```
358
+
359
+ Platform support for automatic installs:
360
+
361
+ | Platform | Syncthing | Docker (optional) |
362
+ |---|---|---|
363
+ | Linux (apt / dnf / pacman / zypper / apk) | **Fully automated** — package install + `systemctl --user enable --now syncthing` | Fully automated; enables systemd unit, adds user to `docker` group |
364
+ | macOS | `brew install syncthing` + `brew services start syncthing` | `brew install --cask docker` (GUI, launch once manually) |
365
+ | Windows | `winget install Syncthing.Syncthing` | `winget install Docker.DockerDesktop` (reboot required) |
366
+
367
+ `openagent setup --full` is idempotent: running it on an already-configured machine just verifies and moves on. When Syncthing is freshly installed, the setup command waits for the daemon to come up, registers the vault folder via Syncthing's REST API, and prints the device ID you need to paste on the second machine to pair them.
368
+
369
+ ### OS service
370
+
371
+ `openagent setup` registers OpenAgent as a platform-native service so it auto-starts on boot and auto-restarts on crash:
372
+
373
+ - **Linux** — systemd user unit at `~/.config/systemd/user/openagent.service`, with `Restart=always` and `SuccessExitStatus=75` so the auto-updater's exit code 75 triggers a clean restart. You also want `loginctl enable-linger <user>` so the service survives logout on a headless VPS.
374
+ - **macOS** — launchd plist at `~/Library/LaunchAgents/com.openagent.serve.plist`, with `KeepAlive` / `SuccessfulExit=false`.
375
+ - **Windows** — `.bat` wrapper + Task Scheduler entry (`ONLOGON`, with an internal restart loop).
376
+
377
+ ```bash
378
+ # Linux
379
+ systemctl --user status openagent
380
+ journalctl --user -u openagent -f
381
+
382
+ # macOS
383
+ launchctl list com.openagent.serve
384
+
385
+ # uninstall (any platform)
386
+ openagent uninstall
387
+ ```
388
+
389
+ ---
390
+
391
+ ## Auto-update
392
+
393
+ OpenAgent can check PyPI on a schedule and upgrade itself in place.
394
+
395
+ ```yaml
396
+ auto_update:
397
+ enabled: true
398
+ mode: auto # auto | notify | manual
399
+ check_interval: "17 */6 * * *" # every 6h at minute :17
400
+ ```
401
+
402
+ Modes:
403
+ - `auto` — pip upgrade + notify (if messaging MCP is configured) + exit with code 75. The OS service manager (systemd / launchd / Task Scheduler) catches the exit and restarts the process with the new code already installed.
404
+ - `notify` — pip upgrade + notify, but don't restart. New code takes effect on the next manual restart.
405
+ - `manual` — pip upgrade only. No notification, no restart.
406
+
407
+ Requires `auto_update.enabled: true` **and** an OS service supervising the process — otherwise exit 75 just kills it.
408
+
409
+ Manual update at any time:
410
+
411
+ ```bash
412
+ openagent update # check PyPI, upgrade if newer
413
+ ```
414
+
415
+ ---
416
+
417
+ ## Dream mode
418
+
419
+ Dream mode is a built-in nightly maintenance task. When enabled, it runs a prompt that cleans `/tmp`, consolidates duplicate memory files, runs a system health check, and writes an audit log into the vault.
420
+
421
+ ```yaml
422
+ dream_mode:
423
+ enabled: true
424
+ time: "3:00" # local time, converted to cron
425
+ # or:
426
+ # cron: "0 3 * * *"
427
+ ```
428
+
429
+ ---
430
+
431
+ ## VPS Deployment
432
+
433
+ For a fresh Linux VPS, the whole setup is three commands:
434
+
435
+ ```bash
436
+ # 1. Install
437
+ pip install 'openagent-framework[all]'
438
+
439
+ # 2. Create openagent.yaml (see the YAML reference below)
440
+ # 3. One-shot setup: Docker + systemd service + image pulls
441
+ openagent setup --full
442
+ ```
443
+
444
+ `openagent setup --full` leaves you with a running systemd user service, the Obsidian web UI (if enabled) on its configured port, and auto-update ready to pick up future releases from PyPI. After that you only interact with systemd:
445
+
446
+ ```bash
447
+ systemctl --user restart openagent
448
+ systemctl --user stop openagent
449
+ systemctl --user start openagent
450
+ journalctl --user -u openagent -f # live logs
451
+ tail -f ~/.openagent/logs/openagent.out.log # stdout log
452
+ ```
453
+
454
+ Upgrading manually (rarely needed if `auto_update.enabled: true`):
455
+
456
+ ```bash
457
+ pip install --upgrade 'openagent-framework[all]'
458
+ systemctl --user restart openagent
459
+ ```
460
+
461
+ The agent cannot modify its own code — only `openagent.yaml` and `memories/` are writable.
462
+
463
+ ---
464
+
465
+ ## Full YAML Config Reference
466
+
467
+ ```yaml
468
+ name: my-agent
469
+
470
+ system_prompt: |
471
+ You are a helpful assistant.
472
+
473
+ model:
474
+ provider: claude-cli # claude-cli | claude-api | zhipu
475
+ model_id: claude-sonnet-4-6
476
+ permission_mode: bypass # bypass | auto | default (Claude CLI only)
477
+ # api_key: ${API_KEY} # for claude-api or zhipu
478
+ # base_url: https://... # for zhipu/OpenAI-compatible
479
+
480
+ mcp_defaults: true # load default MCPs (filesystem, editor, shell, etc.)
481
+ # mcp_disable: ["computer-control"] # disable specific defaults
482
+
483
+ mcp: # user MCPs (merged on top of defaults)
484
+ - name: github
485
+ command: ["github-mcp-server", "stdio"]
486
+ env:
487
+ GITHUB_PERSONAL_ACCESS_TOKEN: ${GITHUB_TOKEN}
488
+
489
+ - name: sentry
490
+ command: ["npx", "-y", "@sentry/mcp-server@latest"]
491
+ env:
492
+ SENTRY_ACCESS_TOKEN: ${SENTRY_TOKEN}
493
+
494
+ - name: remote
495
+ url: "https://mcp.example.com/sse"
496
+ oauth: true # enables OAuth flow for first-time auth
497
+
498
+ memory:
499
+ db_path: "./openagent.db" # SQLite: scheduled tasks only
500
+ vault_path: "./memories" # Obsidian markdown vault
501
+
502
+ channels:
503
+ telegram:
504
+ token: ${TELEGRAM_BOT_TOKEN}
505
+ allowed_users: ["123456789"]
506
+ discord:
507
+ token: ${DISCORD_BOT_TOKEN}
508
+ whatsapp:
509
+ green_api_id: ${GREEN_API_ID}
510
+ green_api_token: ${GREEN_API_TOKEN}
511
+
512
+ services:
513
+ syncthing:
514
+ enabled: true
515
+ vault_path: ./memories
516
+ folder_id: openagent-memories
517
+ folder_label: OpenAgent Memories
518
+ gui_bind: 127.0.0.1:8384
519
+
520
+ scheduler:
521
+ enabled: true
522
+ tasks:
523
+ - name: health-check
524
+ cron: "*/30 * * * *"
525
+ prompt: "Check services and alert if down."
526
+
527
+ dream_mode:
528
+ enabled: true
529
+ time: "3:00" # local time (converted to cron)
530
+
531
+ auto_update:
532
+ enabled: true
533
+ mode: auto # auto | notify | manual
534
+ check_interval: "17 */6 * * *"
535
+ ```
536
+
537
+ Environment variables are substituted using `${VAR_NAME}` syntax.
538
+
539
+ ---
540
+
541
+ ## CLI Reference
542
+
543
+ ```bash
544
+ # Chat / serve
545
+ openagent chat # interactive chat
546
+ openagent chat -m zhipu # use a specific provider
547
+ openagent chat --model-id glm-4-flash # override model ID
548
+ openagent chat -s session-123 # resume session
549
+ openagent serve # start agent + channels + scheduler + aux services
550
+ openagent serve -ch telegram # only a specific channel
551
+
552
+ # Doctor & setup
553
+ openagent doctor # environment report
554
+ openagent setup # install as OS service only
555
+ openagent setup --with-syncthing # + install Syncthing + register vault folder
556
+ openagent setup --with-docker # + install Docker (optional)
557
+ openagent setup --full # everything (same as `install`)
558
+ openagent install # alias of `setup --full`
559
+ openagent uninstall # remove the OS service
560
+ openagent status # OS service status
561
+
562
+ # Auxiliary services
563
+ openagent services status # report each aux service (Obsidian web, ...)
564
+ openagent services start
565
+ openagent services stop
566
+
567
+ # Scheduled tasks
568
+ openagent task add -n "name" -c "cron" -p "prompt"
569
+ openagent task list
570
+ openagent task remove <id>
571
+ openagent task enable <id>
572
+ openagent task disable <id>
573
+
574
+ # Updates
575
+ openagent update # manual pip upgrade from PyPI
576
+
577
+ # MCP
578
+ openagent mcp list # list connected MCP tools
579
+
580
+ # Globals
581
+ openagent -c custom.yaml serve # custom config file
582
+ openagent -v serve # verbose/debug logging
583
+ ```
584
+
585
+ ---
586
+
587
+ ## PyPI
588
+
589
+ ```bash
590
+ pip install openagent-framework # core + CLI
591
+ pip install openagent-framework[telegram] # + Telegram
592
+ pip install openagent-framework[discord] # + Discord
593
+ pip install openagent-framework[whatsapp] # + WhatsApp
594
+ pip install openagent-framework[all] # everything
595
+ ```
596
+
597
+ Release: `./release.sh patch|minor|major` → GitHub Actions builds + publishes to PyPI automatically.