clawless 0.2.0 → 0.2.1
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.
- package/README.md +79 -37
- package/SCHEDULER.md +21 -21
- package/bin/cli.ts +2 -2
- package/index.ts +2 -2
- package/package.json +1 -1
- package/QUICKSTART-SCHEDULER.md +0 -226
- package/QUICKSTART.md +0 -98
- /package/{agent-bridge.config.example.json → clawless.config.example.json} +0 -0
package/README.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Clawless — Bring Your Own Agent (Interface + ACP)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Clawless is an interface bridge built around one core idea: **Bring Your Own Agent**.
|
|
4
|
+
|
|
5
|
+
Instead of forcing a built-in runtime, Clawless lets you keep your preferred local ACP-capable CLI (Gemini CLI by default) and adds a reliable interface layer, callbacks, and scheduling on top.
|
|
6
|
+
|
|
7
|
+
Today, Telegram is the first interface adapter; more interfaces are planned.
|
|
8
|
+
|
|
9
|
+
## Bring Your Own Agent (Main Value)
|
|
10
|
+
|
|
11
|
+
Clawless is designed so your messaging layer and automation layer stay stable while your agent runtime can change.
|
|
12
|
+
|
|
13
|
+
- Keep your preferred local agent CLI workflow
|
|
14
|
+
- Keep your existing MCP tools and local files
|
|
15
|
+
- Swap runtimes without rebuilding your bot integration
|
|
16
|
+
- Avoid lock-in to a single all-in-one framework
|
|
17
|
+
|
|
18
|
+
## Why Clawless
|
|
19
|
+
|
|
20
|
+
If you have tried heavier all-in-one agent frameworks, Clawless is the minimal alternative:
|
|
21
|
+
|
|
22
|
+
- **BYO-agent first**: use your preferred local ACP-capable CLI runtime
|
|
23
|
+
- **Lightweight setup**: minimal glue instead of a full platform migration
|
|
24
|
+
- **Local-first control**: your machine, your tools, your data flow
|
|
25
|
+
- **Transport only**: interface layer is separate from the agent runtime
|
|
26
|
+
|
|
27
|
+
## Interface Adapters
|
|
28
|
+
|
|
29
|
+
- **Current adapter**: Telegram
|
|
30
|
+
- **Planned direction**: add more interfaces without changing core agent orchestration
|
|
31
|
+
- **Design goal**: keep one message context contract so new interfaces reuse queueing, callbacks, scheduler, and ACP flow
|
|
4
32
|
|
|
5
33
|
## Features
|
|
6
34
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
35
|
+
- 🔀 **Bring Your Own Agent Runtime**: Keep Telegram/callback/scheduler UX while choosing your preferred local ACP-capable CLI
|
|
36
|
+
- 🔌 **Adapter-Friendly Interface Layer**: Telegram today, additional interfaces planned
|
|
37
|
+
- 🤖 **Telegram (Current Adapter)**: Interact with your local agent runtime through Telegram
|
|
38
|
+
- ⌨️ **Typing Status UX**: Shows Telegram typing indicator while the agent is processing
|
|
39
|
+
- 🛠️ **Rich Tool Support**: Leverages MCP (Model Context Protocol) servers connected to your local CLI runtime
|
|
10
40
|
- 🔒 **Privacy**: Runs on your hardware, you control data flow
|
|
11
41
|
- 💾 **Persistent Context**: Maintains local session unlike standard API calls
|
|
12
42
|
- 📬 **Sequential Queueing**: Processes one message at a time to avoid overlap and races
|
|
@@ -16,22 +46,22 @@ A bridge that connects a Telegram bot to the Gemini CLI using the Agent Communic
|
|
|
16
46
|
## Architecture
|
|
17
47
|
|
|
18
48
|
```
|
|
19
|
-
|
|
20
|
-
│
|
|
21
|
-
│
|
|
22
|
-
|
|
49
|
+
┌──────────────────────┐ ┌────────────────┐ ┌──────────────────────────┐
|
|
50
|
+
│ Interface Adapter │◄───►│ Clawless │◄───►│ Local Agent. │
|
|
51
|
+
│ (Telegram now) │ │ (Node.js) │ ACP │ e.g. Gemini CLI (default)│
|
|
52
|
+
└──────────────────────┘ └────────────────┘ └──────────────────────────┘
|
|
23
53
|
```
|
|
24
54
|
|
|
25
55
|
The bridge:
|
|
26
|
-
1. Receives messages from Telegram
|
|
27
|
-
2. Forwards them to
|
|
28
|
-
3.
|
|
56
|
+
1. Receives messages from the active interface adapter (Telegram today)
|
|
57
|
+
2. Forwards them to **your configured local agent CLI** via ACP (Agent Communication Protocol)
|
|
58
|
+
3. Sends interface-appropriate progress/status updates, then returns a single final response
|
|
29
59
|
|
|
30
60
|
## Prerequisites
|
|
31
61
|
|
|
32
62
|
- **Node.js** 18.0.0 or higher
|
|
33
|
-
- **
|
|
34
|
-
- **Telegram Bot Token** from [@BotFather](https://t.me/BotFather)
|
|
63
|
+
- **A local ACP-capable agent CLI** installed and configured (Gemini CLI is the default setup)
|
|
64
|
+
- **Telegram Bot Token** from [@BotFather](https://t.me/BotFather) for the current Telegram adapter
|
|
35
65
|
|
|
36
66
|
## Installation
|
|
37
67
|
|
|
@@ -73,6 +103,8 @@ After install, the package exposes a CLI command:
|
|
|
73
103
|
clawless
|
|
74
104
|
```
|
|
75
105
|
|
|
106
|
+
> Note: the binary name is currently `clawless` for compatibility, while the project name is Clawless.
|
|
107
|
+
|
|
76
108
|
Local development alternatives:
|
|
77
109
|
|
|
78
110
|
```bash
|
|
@@ -193,7 +225,7 @@ pm2 save
|
|
|
193
225
|
| `CALLBACK_PORT` | No | 8788 | Bind port for callback server |
|
|
194
226
|
| `CALLBACK_AUTH_TOKEN` | No | - | Optional bearer/token guard for callback endpoint |
|
|
195
227
|
| `CALLBACK_MAX_BODY_BYTES` | No | 65536 | Maximum accepted callback request body size |
|
|
196
|
-
| `AGENT_BRIDGE_HOME` | No | ~/.clawless | Home directory for
|
|
228
|
+
| `AGENT_BRIDGE_HOME` | No | ~/.clawless | Home directory for Clawless runtime files |
|
|
197
229
|
| `MEMORY_FILE_PATH` | No | ~/.clawless/MEMORY.md | Persistent memory file path injected into Gemini prompt context |
|
|
198
230
|
| `MEMORY_MAX_CHARS` | No | 12000 | Max memory-file characters injected into prompt context |
|
|
199
231
|
| `SCHEDULES_FILE_PATH` | No | ~/.clawless/schedules.json | Persistent scheduler storage file |
|
|
@@ -229,7 +261,7 @@ curl -sS -X POST "http://127.0.0.1:8788/callback/telegram" \
|
|
|
229
261
|
|
|
230
262
|
### Scheduler API
|
|
231
263
|
|
|
232
|
-
The bridge includes a built-in cron scheduler that allows you to schedule tasks to be executed through
|
|
264
|
+
The bridge includes a built-in cron scheduler that allows you to schedule tasks to be executed through your configured local agent CLI:
|
|
233
265
|
|
|
234
266
|
- Schedules are persisted to disk and automatically reloaded on restart.
|
|
235
267
|
- Default storage path: `~/.clawless/schedules.json` (override with `SCHEDULES_FILE_PATH`).
|
|
@@ -256,7 +288,7 @@ curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
|
256
288
|
}'
|
|
257
289
|
```
|
|
258
290
|
|
|
259
|
-
When a scheduled job runs, it executes the message through
|
|
291
|
+
When a scheduled job runs, it executes the message through your configured local agent runtime and sends the response to your Telegram chat.
|
|
260
292
|
|
|
261
293
|
**Ask Gemini to create schedules naturally:**
|
|
262
294
|
- "Remind me to take a break in 30 minutes"
|
|
@@ -268,10 +300,10 @@ See [SCHEDULER.md](SCHEDULER.md) for complete API documentation.
|
|
|
268
300
|
### Persistent Memory File
|
|
269
301
|
|
|
270
302
|
- The bridge ensures a memory file exists at `~/.clawless/MEMORY.md` on startup.
|
|
271
|
-
-
|
|
303
|
+
- The configured local agent CLI is started with include access to both `~/.clawless` and your full home directory (`~/`).
|
|
272
304
|
- ACP session setup uses the required `mcpServers` field with an empty array and relies on Gemini CLI runtime defaults for MCP/skills loading.
|
|
273
305
|
- Each prompt includes memory instructions and current `MEMORY.md` content.
|
|
274
|
-
- When asked to memorize/remember something,
|
|
306
|
+
- When asked to memorize/remember something, the agent is instructed to append new notes under `## Notes`.
|
|
275
307
|
|
|
276
308
|
### Timeout Tuning
|
|
277
309
|
|
|
@@ -296,28 +328,31 @@ The `MAX_RESPONSE_LENGTH` prevents memory issues with very long responses:
|
|
|
296
328
|
1. **User sends a message** via Telegram
|
|
297
329
|
2. **Bridge queues** the message if another request is in progress
|
|
298
330
|
3. **Worker dequeues** the next message when prior processing completes
|
|
299
|
-
4. **
|
|
300
|
-
5. **Single final reply** is sent when
|
|
331
|
+
4. **Agent run starts** and typing status is shown in Telegram
|
|
332
|
+
5. **Single final reply** is sent when the run finishes
|
|
301
333
|
|
|
302
334
|
### Queueing Behavior
|
|
303
335
|
|
|
304
336
|
The bridge uses a single-worker in-memory queue:
|
|
305
|
-
- Prevents overlapping
|
|
337
|
+
- Prevents overlapping agent runs
|
|
306
338
|
- Preserves message order
|
|
307
339
|
- Avoids duplicate-edit/fallback races from message updates
|
|
308
340
|
|
|
309
341
|
## Advantages Over Standard API Bots
|
|
310
342
|
|
|
311
|
-
1. **
|
|
312
|
-
2. **
|
|
313
|
-
3. **
|
|
314
|
-
4. **
|
|
315
|
-
5. **
|
|
343
|
+
1. **BYO-Agent Flexibility**: Keep the same bridge while choosing or changing your local CLI runtime
|
|
344
|
+
2. **Persistent Context**: The local agent CLI maintains a local session, unlike stateless API calls
|
|
345
|
+
3. **Local File Access**: Can access files on your server if configured
|
|
346
|
+
4. **MCP Tool Integration**: Uses tools from connected MCP servers (Calendar, Database, etc.)
|
|
347
|
+
5. **Privacy Control**: Runs on your hardware, you control data processing
|
|
348
|
+
6. **Custom Configuration**: Use your specific local CLI setup and preferences
|
|
316
349
|
|
|
317
350
|
## Troubleshooting
|
|
318
351
|
|
|
319
352
|
### Bot doesn't respond
|
|
320
353
|
|
|
354
|
+
For the default Gemini CLI setup:
|
|
355
|
+
|
|
321
356
|
1. Check if Gemini CLI is installed:
|
|
322
357
|
```bash
|
|
323
358
|
which gemini
|
|
@@ -347,22 +382,29 @@ If you see "429 Too Many Requests" errors:
|
|
|
347
382
|
### Project Structure
|
|
348
383
|
|
|
349
384
|
```
|
|
350
|
-
|
|
351
|
-
├── index.ts
|
|
385
|
+
Clawless/
|
|
386
|
+
├── index.ts # Main bridge application
|
|
387
|
+
├── bin/
|
|
388
|
+
│ └── cli.ts # CLI entrypoint
|
|
352
389
|
├── messaging/
|
|
353
|
-
│ └── telegramClient.ts
|
|
354
|
-
├──
|
|
355
|
-
├──
|
|
356
|
-
|
|
357
|
-
├──
|
|
358
|
-
|
|
390
|
+
│ └── telegramClient.ts # Telegram adapter
|
|
391
|
+
├── scheduler/
|
|
392
|
+
│ ├── cronScheduler.ts # Schedule persistence + cron orchestration
|
|
393
|
+
│ └── scheduledJobHandler.ts # Scheduled run execution logic
|
|
394
|
+
├── acp/
|
|
395
|
+
│ ├── tempAcpRunner.ts # Isolated ACP run helper
|
|
396
|
+
│ └── clientHelpers.ts # ACP helper utilities
|
|
397
|
+
├── package.json # Node.js dependencies
|
|
398
|
+
├── ecosystem.config.json # PM2 configuration
|
|
399
|
+
├── clawless.config.example.json # CLI config template
|
|
400
|
+
└── README.md # This file
|
|
359
401
|
```
|
|
360
402
|
|
|
361
403
|
### Adding Features
|
|
362
404
|
|
|
363
405
|
The codebase is designed to be simple and extensible:
|
|
364
406
|
- Core queue + ACP logic is in `index.ts`
|
|
365
|
-
-
|
|
407
|
+
- Interface-specific messaging logic lives in `messaging/telegramClient.ts`
|
|
366
408
|
- New bot platforms can implement the same message context shape (`text`, `startTyping()`, `sendText()`)
|
|
367
409
|
- Error handling is centralized
|
|
368
410
|
- Rate limiting logic is configurable
|
|
@@ -401,4 +443,4 @@ For issues and questions:
|
|
|
401
443
|
|
|
402
444
|
---
|
|
403
445
|
|
|
404
|
-
**Note**: This bridge requires a working Gemini CLI
|
|
446
|
+
**Note**: This bridge requires a working local ACP-capable CLI (Gemini CLI is the default setup). Ensure your CLI is properly configured before running the bridge.
|
package/SCHEDULER.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Scheduler API Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Clawless includes a cron scheduler API that allows you to schedule tasks to be executed through your local agent CLI at specific times or on a recurring basis (Gemini CLI by default).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
When a scheduled job runs:
|
|
8
|
-
1. The scheduled message is sent to a standalone
|
|
9
|
-
2.
|
|
10
|
-
3. The response is sent back
|
|
11
|
-
4.
|
|
8
|
+
1. The scheduled message is sent to a standalone local agent CLI session
|
|
9
|
+
2. The agent processes the message and generates a response
|
|
10
|
+
3. The response is sent back through the active interface adapter
|
|
11
|
+
4. With the current Telegram adapter, the result appears in your Telegram chat
|
|
12
12
|
|
|
13
13
|
Schedules are persisted to disk and reloaded on startup. By default the file is `~/.clawless/schedules.json` and can be overridden via `SCHEDULES_FILE_PATH`.
|
|
14
14
|
|
|
@@ -43,7 +43,7 @@ curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
|
43
43
|
**Request Body:**
|
|
44
44
|
```json
|
|
45
45
|
{
|
|
46
|
-
"message": "The prompt to send to
|
|
46
|
+
"message": "The prompt to send to your local agent CLI",
|
|
47
47
|
"description": "Optional description of the schedule",
|
|
48
48
|
"cronExpression": "0 9 * * *"
|
|
49
49
|
}
|
|
@@ -83,7 +83,7 @@ curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
|
83
83
|
**Request Body:**
|
|
84
84
|
```json
|
|
85
85
|
{
|
|
86
|
-
"message": "The prompt to send to
|
|
86
|
+
"message": "The prompt to send to your local agent CLI",
|
|
87
87
|
"description": "Optional description",
|
|
88
88
|
"oneTime": true,
|
|
89
89
|
"runAt": "2026-02-13T15:30:00Z"
|
|
@@ -180,39 +180,39 @@ curl -X DELETE http://127.0.0.1:8788/api/schedule/schedule_1707835800000_abc123
|
|
|
180
180
|
}
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
## Using with
|
|
183
|
+
## Using with Your Local CLI (Default: Gemini)
|
|
184
184
|
|
|
185
|
-
The
|
|
185
|
+
The configured local CLI is aware of the scheduler API through the system prompt. With the default setup, you can ask Gemini to create schedules naturally:
|
|
186
186
|
|
|
187
187
|
**Examples:**
|
|
188
188
|
|
|
189
189
|
1. **"Remind me to take a break in 30 minutes"**
|
|
190
|
-
|
|
190
|
+
- The agent will create a one-time schedule
|
|
191
191
|
|
|
192
192
|
2. **"Check my calendar every morning at 9am and send me a summary"**
|
|
193
|
-
|
|
193
|
+
- The agent will create a recurring schedule with cron expression `0 9 * * *`
|
|
194
194
|
|
|
195
195
|
3. **"Every Friday at 5pm, remind me to review my weekly goals"**
|
|
196
|
-
|
|
196
|
+
- The agent will create a recurring schedule with cron expression `0 17 * * 5`
|
|
197
197
|
|
|
198
198
|
4. **"List my scheduled tasks"**
|
|
199
|
-
|
|
199
|
+
- The agent will query the schedule API and show you all active schedules
|
|
200
200
|
|
|
201
201
|
5. **"Cancel the calendar summary schedule"**
|
|
202
|
-
|
|
202
|
+
- The agent will find and delete the matching schedule
|
|
203
203
|
|
|
204
204
|
## How It Works
|
|
205
205
|
|
|
206
|
-
1. When you ask
|
|
206
|
+
1. When you ask the agent to create a schedule, it will:
|
|
207
207
|
- Parse your request to determine timing (cron expression or specific date/time)
|
|
208
208
|
- Call the scheduler API with appropriate parameters
|
|
209
209
|
- Confirm the schedule was created
|
|
210
210
|
|
|
211
211
|
2. When the scheduled time arrives:
|
|
212
212
|
- The scheduler executes the job
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
- The message is sent to a new local CLI session
|
|
214
|
+
- The agent processes the message (can use tools, access files, etc.)
|
|
215
|
+
- The response is sent to the active interface destination (Telegram with current adapter)
|
|
216
216
|
|
|
217
217
|
3. For recurring schedules:
|
|
218
218
|
- The job runs according to the cron expression
|
|
@@ -226,9 +226,9 @@ The Gemini CLI is aware of the scheduler API through the system prompt. You can
|
|
|
226
226
|
## Notes
|
|
227
227
|
|
|
228
228
|
- Schedules are stored in memory and will be lost if the bridge restarts
|
|
229
|
-
-
|
|
229
|
+
- For the current Telegram adapter, make sure your bot has received at least one message so it knows where to send results
|
|
230
230
|
- The timezone used for cron schedules is determined by the `TZ` environment variable (defaults to UTC)
|
|
231
|
-
- Scheduled jobs run in separate
|
|
231
|
+
- Scheduled jobs run in separate local CLI sessions, so they have access to all configured tools and MCP servers
|
|
232
232
|
|
|
233
233
|
## Troubleshooting
|
|
234
234
|
|
|
@@ -237,7 +237,7 @@ The Gemini CLI is aware of the scheduler API through the system prompt. You can
|
|
|
237
237
|
- Verify the cron expression is valid using a cron expression tester
|
|
238
238
|
- Ensure the bridge is running continuously
|
|
239
239
|
|
|
240
|
-
### Results not appearing in Telegram
|
|
240
|
+
### Results not appearing in Telegram (current adapter)
|
|
241
241
|
- Send at least one message to your bot first to establish the chat binding
|
|
242
242
|
- Check if `lastIncomingChatId` is set in the logs
|
|
243
243
|
|
package/bin/cli.ts
CHANGED
|
@@ -23,7 +23,7 @@ const ENV_KEY_MAP: Record<string, string> = {
|
|
|
23
23
|
callbackPort: 'CALLBACK_PORT',
|
|
24
24
|
callbackAuthToken: 'CALLBACK_AUTH_TOKEN',
|
|
25
25
|
callbackMaxBodyBytes: 'CALLBACK_MAX_BODY_BYTES',
|
|
26
|
-
|
|
26
|
+
ClawlessHome: 'AGENT_BRIDGE_HOME',
|
|
27
27
|
memoryFilePath: 'MEMORY_FILE_PATH',
|
|
28
28
|
memoryMaxChars: 'MEMORY_MAX_CHARS',
|
|
29
29
|
schedulesFilePath: 'SCHEDULES_FILE_PATH',
|
|
@@ -50,7 +50,7 @@ const DEFAULT_CONFIG_TEMPLATE = {
|
|
|
50
50
|
callbackPort: 8788,
|
|
51
51
|
callbackAuthToken: '',
|
|
52
52
|
callbackMaxBodyBytes: 65536,
|
|
53
|
-
|
|
53
|
+
ClawlessHome: '~/.clawless',
|
|
54
54
|
memoryFilePath: '~/.clawless/MEMORY.md',
|
|
55
55
|
memoryMaxChars: 12000,
|
|
56
56
|
schedulesFilePath: '~/.clawless/schedules.json',
|
package/index.ts
CHANGED
|
@@ -576,9 +576,9 @@ function ensureMemoryFile() {
|
|
|
576
576
|
|
|
577
577
|
if (!fs.existsSync(MEMORY_FILE_PATH)) {
|
|
578
578
|
const template = [
|
|
579
|
-
'#
|
|
579
|
+
'# Clawless Memory',
|
|
580
580
|
'',
|
|
581
|
-
'This file stores durable memory notes for
|
|
581
|
+
'This file stores durable memory notes for Clawless.',
|
|
582
582
|
'',
|
|
583
583
|
'## Notes',
|
|
584
584
|
'',
|
package/package.json
CHANGED
package/QUICKSTART-SCHEDULER.md
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
# Quick Start Guide: Scheduler Feature
|
|
2
|
-
|
|
3
|
-
This guide will help you start using the scheduler feature in under 5 minutes.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
1. Clawless is installed and configured
|
|
8
|
-
2. You have sent at least one message to your bot (to establish chat binding)
|
|
9
|
-
3. The bridge is running (`npm run dev` or `npm start`)
|
|
10
|
-
|
|
11
|
-
## Basic Usage
|
|
12
|
-
|
|
13
|
-
### Talk to Gemini Naturally
|
|
14
|
-
|
|
15
|
-
The easiest way to use the scheduler is to just ask Gemini:
|
|
16
|
-
|
|
17
|
-
**Examples:**
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
You: "Remind me to take a break in 30 minutes"
|
|
21
|
-
|
|
22
|
-
You: "Check my calendar every morning at 9am and send me a summary"
|
|
23
|
-
|
|
24
|
-
You: "Every Friday at 5pm, remind me to review my weekly goals"
|
|
25
|
-
|
|
26
|
-
You: "What schedules do I have?"
|
|
27
|
-
|
|
28
|
-
You: "Cancel the daily calendar check"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Gemini will handle all the API calls automatically!
|
|
32
|
-
|
|
33
|
-
## Direct API Usage
|
|
34
|
-
|
|
35
|
-
### 1. Create a Recurring Schedule
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
39
|
-
-H "Content-Type: application/json" \
|
|
40
|
-
-d '{
|
|
41
|
-
"message": "What time is it?",
|
|
42
|
-
"description": "Time check",
|
|
43
|
-
"cronExpression": "0 9 * * *"
|
|
44
|
-
}'
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Response:**
|
|
48
|
-
```json
|
|
49
|
-
{
|
|
50
|
-
"ok": true,
|
|
51
|
-
"schedule": {
|
|
52
|
-
"id": "schedule_1707835800000_abc123",
|
|
53
|
-
"message": "What time is it?",
|
|
54
|
-
"description": "Time check",
|
|
55
|
-
"cronExpression": "0 9 * * *",
|
|
56
|
-
"oneTime": false,
|
|
57
|
-
"active": true,
|
|
58
|
-
"createdAt": "2026-02-13T10:00:00.000Z"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 2. Create a One-Time Schedule
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# Schedule for 30 seconds from now
|
|
67
|
-
if ! RUN_AT=$(date -u -d "+30 seconds" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null); then
|
|
68
|
-
# Fallback for macOS/BSD date
|
|
69
|
-
RUN_AT=$(date -u -v+30S +"%Y-%m-%dT%H:%M:%SZ")
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
73
|
-
-H "Content-Type: application/json" \
|
|
74
|
-
-d "{
|
|
75
|
-
\"message\": \"Test reminder\",
|
|
76
|
-
\"oneTime\": true,
|
|
77
|
-
\"runAt\": \"${RUN_AT}\"
|
|
78
|
-
}"
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### 3. List All Schedules
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
curl http://127.0.0.1:8788/api/schedule | jq .
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 4. Delete a Schedule
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
curl -X DELETE http://127.0.0.1:8788/api/schedule/SCHEDULE_ID
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Common Cron Expressions
|
|
94
|
-
|
|
95
|
-
| Expression | Meaning |
|
|
96
|
-
|------------|---------|
|
|
97
|
-
| `0 9 * * *` | Every day at 9:00 AM |
|
|
98
|
-
| `0 */6 * * *` | Every 6 hours |
|
|
99
|
-
| `*/30 * * * *` | Every 30 minutes |
|
|
100
|
-
| `0 9 * * 1-5` | Weekdays at 9:00 AM |
|
|
101
|
-
| `0 17 * * 5` | Every Friday at 5:00 PM |
|
|
102
|
-
| `0 0 1 * *` | First day of month at midnight |
|
|
103
|
-
|
|
104
|
-
**Cron format:** `minute hour day month weekday`
|
|
105
|
-
|
|
106
|
-
## What Happens When a Job Runs?
|
|
107
|
-
|
|
108
|
-
1. **Scheduler triggers** at the scheduled time
|
|
109
|
-
2. **Message is sent** to a new Gemini CLI session
|
|
110
|
-
3. **Gemini processes** the message (can use tools, files, etc.)
|
|
111
|
-
4. **Response is sent** to your Telegram chat automatically
|
|
112
|
-
|
|
113
|
-
Example Telegram message you'll receive:
|
|
114
|
-
```
|
|
115
|
-
🔔 Scheduled task completed:
|
|
116
|
-
|
|
117
|
-
Daily calendar summary
|
|
118
|
-
|
|
119
|
-
Today's events:
|
|
120
|
-
- 9:00 AM: Team standup
|
|
121
|
-
- 2:00 PM: Project review
|
|
122
|
-
- 4:30 PM: 1-on-1 with manager
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Testing Your First Schedule
|
|
126
|
-
|
|
127
|
-
1. **Start the bridge:**
|
|
128
|
-
```bash
|
|
129
|
-
npm run dev
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
2. **Create a test schedule (runs in 30 seconds):**
|
|
133
|
-
```bash
|
|
134
|
-
if ! RUN_AT=$(date -u -d "+30 seconds" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null); then
|
|
135
|
-
# Fallback for macOS/BSD date
|
|
136
|
-
RUN_AT=$(date -u -v+30S +"%Y-%m-%dT%H:%M:%SZ")
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
140
|
-
-H "Content-Type: application/json" \
|
|
141
|
-
-d "{
|
|
142
|
-
\"message\": \"Hello! This is a test scheduled message.\",
|
|
143
|
-
\"description\": \"Test\",
|
|
144
|
-
\"oneTime\": true,
|
|
145
|
-
\"runAt\": \"${RUN_AT}\"
|
|
146
|
-
}"
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
3. **Wait 30 seconds** - You should receive a message in Telegram!
|
|
150
|
-
|
|
151
|
-
4. **Or ask Gemini directly:**
|
|
152
|
-
```
|
|
153
|
-
Send me a test message in 30 seconds
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## With Authentication
|
|
157
|
-
|
|
158
|
-
If you have `CALLBACK_AUTH_TOKEN` set in your config:
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
curl -X POST http://127.0.0.1:8788/api/schedule \
|
|
162
|
-
-H "Content-Type: application/json" \
|
|
163
|
-
-H "x-callback-token: YOUR_TOKEN_HERE" \
|
|
164
|
-
-d '{
|
|
165
|
-
"message": "Test",
|
|
166
|
-
"cronExpression": "0 9 * * *"
|
|
167
|
-
}'
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Troubleshooting
|
|
171
|
-
|
|
172
|
-
### "No target chat available"
|
|
173
|
-
**Solution:** Send at least one message to your bot first.
|
|
174
|
-
|
|
175
|
-
### Schedule not executing
|
|
176
|
-
**Solution:**
|
|
177
|
-
- Check bridge logs for errors
|
|
178
|
-
- Verify cron expression is valid
|
|
179
|
-
- Ensure bridge is still running
|
|
180
|
-
|
|
181
|
-
### Can't reach API
|
|
182
|
-
**Solution:**
|
|
183
|
-
- Verify bridge is running: `curl http://127.0.0.1:8788/healthz`
|
|
184
|
-
- Check if port 8788 is available
|
|
185
|
-
- Look for errors in bridge logs
|
|
186
|
-
|
|
187
|
-
## Next Steps
|
|
188
|
-
|
|
189
|
-
- Read [SCHEDULER.md](SCHEDULER.md) for complete API documentation
|
|
190
|
-
- Read [TESTING.md](TESTING.md) for comprehensive testing guide
|
|
191
|
-
- Run `./scripts/test-scheduler.sh` for automated tests
|
|
192
|
-
- View `./scripts/gemini-scheduler-examples.sh` for more examples
|
|
193
|
-
|
|
194
|
-
## Pro Tips
|
|
195
|
-
|
|
196
|
-
1. **Descriptions matter**: Add clear descriptions to help you remember what each schedule does
|
|
197
|
-
2. **Test with one-time first**: Before setting up recurring jobs, test with a one-time schedule
|
|
198
|
-
3. **Use natural language**: Just ask Gemini - it's easier than curl commands!
|
|
199
|
-
4. **Check regularly**: Use "What schedules do I have?" to review active schedules
|
|
200
|
-
5. **Timezone aware**: Set `TZ` environment variable if needed (default is UTC)
|
|
201
|
-
|
|
202
|
-
## Example Workflows
|
|
203
|
-
|
|
204
|
-
### Daily Morning Routine
|
|
205
|
-
```
|
|
206
|
-
You: "Every morning at 7am, check my calendar and the weather, then send me a summary"
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### Work Break Reminders
|
|
210
|
-
```
|
|
211
|
-
You: "Remind me to take a break every 2 hours during work days"
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### Weekly Review
|
|
215
|
-
```
|
|
216
|
-
You: "Every Sunday at 6pm, remind me to plan my goals for next week"
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Custom Notifications
|
|
220
|
-
```
|
|
221
|
-
You: "Check if there are any urgent emails every 30 minutes and notify me if found"
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
That's it! You're ready to start scheduling with Clawless. 🎉
|
package/QUICKSTART.md
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# Quick Start Guide
|
|
2
|
-
|
|
3
|
-
Get your Telegram-Gemini bridge running in 5 minutes!
|
|
4
|
-
|
|
5
|
-
## Prerequisites Checklist
|
|
6
|
-
|
|
7
|
-
- [ ] Node.js 18+ installed (`node --version`)
|
|
8
|
-
- [ ] Gemini CLI installed (`gemini --version`)
|
|
9
|
-
- [ ] Telegram bot token from [@BotFather](https://t.me/BotFather)
|
|
10
|
-
|
|
11
|
-
## Setup Steps
|
|
12
|
-
|
|
13
|
-
### 1. Install Dependencies
|
|
14
|
-
```bash
|
|
15
|
-
npm install
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### 2. Configure Environment
|
|
19
|
-
```bash
|
|
20
|
-
cp .env.example .env
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Edit `.env` and add your bot token:
|
|
24
|
-
```env
|
|
25
|
-
TELEGRAM_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 3. Test Gemini CLI
|
|
29
|
-
Verify Gemini CLI supports ACP:
|
|
30
|
-
```bash
|
|
31
|
-
gemini --protocol acp
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 4. Run the Bridge
|
|
35
|
-
|
|
36
|
-
**Quick test:**
|
|
37
|
-
```bash
|
|
38
|
-
npm start
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Development (auto-restart):**
|
|
42
|
-
```bash
|
|
43
|
-
npm run dev
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**Production (with PM2):**
|
|
47
|
-
```bash
|
|
48
|
-
npm install -g pm2
|
|
49
|
-
pm2 start ecosystem.config.json
|
|
50
|
-
pm2 logs
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Verify It's Working
|
|
54
|
-
|
|
55
|
-
1. Open Telegram
|
|
56
|
-
2. Find your bot (search for the username you gave it)
|
|
57
|
-
3. Send a message: "Hello!"
|
|
58
|
-
4. You should see "🤔 Thinking..." followed by Gemini's response
|
|
59
|
-
|
|
60
|
-
## Common Issues
|
|
61
|
-
|
|
62
|
-
### "TELEGRAM_TOKEN is required"
|
|
63
|
-
- Check your `.env` file exists
|
|
64
|
-
- Verify the token is on the line `TELEGRAM_TOKEN=...`
|
|
65
|
-
- No quotes needed around the token
|
|
66
|
-
|
|
67
|
-
### "command not found: gemini"
|
|
68
|
-
- Install Gemini CLI first
|
|
69
|
-
- Verify with: `which gemini`
|
|
70
|
-
|
|
71
|
-
### Bot doesn't respond
|
|
72
|
-
- Check logs: `pm2 logs` (if using PM2)
|
|
73
|
-
- Or check console output
|
|
74
|
-
- Verify your bot token is correct
|
|
75
|
-
|
|
76
|
-
### Rate limit errors (429)
|
|
77
|
-
- Increase `UPDATE_INTERVAL_MS` in `.env` to 2000 or higher
|
|
78
|
-
- Restart the bot
|
|
79
|
-
|
|
80
|
-
## Next Steps
|
|
81
|
-
|
|
82
|
-
- Read the full [README.md](README.md) for detailed configuration
|
|
83
|
-
- Configure MCP servers for tool use
|
|
84
|
-
- Set up auto-start with PM2
|
|
85
|
-
|
|
86
|
-
## Getting Help
|
|
87
|
-
|
|
88
|
-
- Check [README.md](README.md) troubleshooting section
|
|
89
|
-
- Review Gemini CLI documentation
|
|
90
|
-
- Open an issue on GitHub
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
**Pro tip:** Keep the bridge running with PM2 and set it to auto-start on boot:
|
|
95
|
-
```bash
|
|
96
|
-
pm2 startup
|
|
97
|
-
pm2 save
|
|
98
|
-
```
|
|
File without changes
|