vkteams-bot-cli 0.7.6

High-performance VK Teams Bot API toolkit with CLI and MCP server support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# VK Teams Bot CLI Command Reference

This document provides a comprehensive reference for all available commands in the VK Teams Bot CLI.

## Global Options

These options can be used with any command:

| Option | Description | Default |
|--------|-------------|---------|
| `--config PATH` | Use custom config file | Auto-detected |
| `--save-config PATH` | Save current config to file | - |
| `--verbose` | Enable verbose logging | false |
| `--output FORMAT` | Output format (pretty, json, table, quiet) | pretty |

## Command Categories

1. [Messaging Commands]#messaging-commands
2. [Chat Commands]#chat-commands
3. [Scheduling Commands]#scheduling-commands
4. [File Commands]#file-commands
5. [Configuration Commands]#configuration-commands
6. [Diagnostic Commands]#diagnostic-commands
7. [Storage Commands]#storage-commands
8. [Daemon Commands]#daemon-commands

---

## Messaging Commands

### send-text
Send a text message to a user or chat.

```bash
vkteams-bot-cli send-text -u USER_ID -m "Message text"
```

**Options:**
- `-u, --user-id USER_ID` (required) - Recipient user or chat ID
- `-m, --message TEXT` (required) - Message text to send
- `-f, --format FORMAT` - Message format (MarkdownV2, HTML)
- `--reply-to MSG_ID` - Reply to specific message
- `--forward MSG_ID CHAT_ID` - Forward message from chat

**JSON Response:**
```json
{
  "success": true,
  "data": {
    "msgId": "123456789",
    "ok": true
  }
}
```

### send-file
Send a file to a user or chat with upload progress.

```bash
vkteams-bot-cli send-file -u USER_ID -p /path/to/file.pdf
```

**Options:**
- `-u, --user-id USER_ID` (required) - Recipient user or chat ID
- `-p, --path FILE_PATH` (required) - Path to file to send
- `-c, --caption TEXT` - File caption
- `--reply-to MSG_ID` - Reply to specific message

**JSON Response:**
```json
{
  "success": true,
  "data": {
    "msgId": "123456790",
    "ok": true,
    "fileId": "file_abc123"
  }
}
```

### send-voice
Send a voice message.

```bash
vkteams-bot-cli send-voice -u USER_ID -p /path/to/voice.ogg
```

**Options:**
- `-u, --user-id USER_ID` (required) - Recipient user or chat ID
- `-p, --path FILE_PATH` (required) - Path to voice file
- `--reply-to MSG_ID` - Reply to specific message

**Supported formats:** OGG, MP3, WAV, M4A, AAC

### edit-message
Edit an existing message.

```bash
vkteams-bot-cli edit-message -c CHAT_ID -m MSG_ID -t "New text"
```

**Options:**
- `-c, --chat-id CHAT_ID` (required) - Chat containing the message
- `-m, --msg-id MSG_ID` (required) - Message ID to edit
- `-t, --text TEXT` (required) - New message text
- `-f, --format FORMAT` - Message format

### delete-message
Delete a message.

```bash
vkteams-bot-cli delete-message -c CHAT_ID -m MSG_ID
```

**Options:**
- `-c, --chat-id CHAT_ID` (required) - Chat containing the message
- `-m, --msg-id MSG_ID` (required) - Message ID to delete

### pin-message / unpin-message
Pin or unpin a message in a chat.

```bash
vkteams-bot-cli pin-message -c CHAT_ID -m MSG_ID
vkteams-bot-cli unpin-message -c CHAT_ID -m MSG_ID
```

---

## Chat Commands

### get-chat-info
Get detailed information about a chat.

```bash
vkteams-bot-cli get-chat-info -c CHAT_ID
```

**JSON Response:**
```json
{
  "success": true,
  "data": {
    "type": "group",
    "title": "Project Chat",
    "about": "Team discussion",
    "public": false,
    "inviteLink": "https://...",
    "admins": ["admin1", "admin2"]
  }
}
```

### get-chat-members
Get list of chat members.

```bash
vkteams-bot-cli get-chat-members -c CHAT_ID
```

**Options:**
- `-c, --chat-id CHAT_ID` (required) - Chat ID
- `--cursor CURSOR` - Pagination cursor

### get-profile
Get user profile information.

```bash
vkteams-bot-cli get-profile -u USER_ID
```

### send-action
Send a chat action (typing indicator).

```bash
vkteams-bot-cli send-action -c CHAT_ID -a typing
```

**Available actions:**
- `typing` - Typing indicator
- `looking` - Looking at chat

### set-chat-title
Change chat title.

```bash
vkteams-bot-cli set-chat-title -c CHAT_ID -t "New Title"
```

### set-chat-about
Change chat description.

```bash
vkteams-bot-cli set-chat-about -c CHAT_ID -a "New description"
```

### set-chat-rules
Set chat rules.

```bash
vkteams-bot-cli set-chat-rules -c CHAT_ID -r "1. Be respectful\n2. No spam"
```

---

## Scheduling Commands

### schedule
Schedule messages to be sent later.

#### Schedule Text Message
```bash
vkteams-bot-cli schedule text -u CHAT_ID -m "Message" -t "2024-01-20 10:00:00"
```

**Time Options (mutually exclusive):**
- `-t, --time TIME` - Specific time (ISO format or relative like "1h", "tomorrow")
- `-c, --cron EXPR` - Cron expression for recurring
- `-i, --interval SECONDS` - Repeat interval in seconds

**Additional Options:**
- `--max-runs N` - Maximum number of executions

#### Schedule File
```bash
vkteams-bot-cli schedule file -u CHAT_ID -p /path/to/file -c "0 9 * * *"
```

#### Schedule Voice
```bash
vkteams-bot-cli schedule voice -u CHAT_ID -p /path/to/voice.ogg -i 3600
```

#### Schedule Action
```bash
vkteams-bot-cli schedule action -u CHAT_ID -a typing -t "30m"
```

### scheduler
Manage the scheduler daemon.

#### Start Scheduler
```bash
vkteams-bot-cli scheduler start
```

#### Stop Scheduler
```bash
vkteams-bot-cli scheduler stop
```

#### Check Status
```bash
vkteams-bot-cli scheduler status
```

**JSON Response:**
```json
{
  "success": true,
  "data": {
    "daemon_status": "running",
    "daemon_info": {
      "pid": 12345,
      "started_at": "2024-01-20 08:00:00 UTC"
    },
    "total_tasks": 5,
    "enabled_tasks": 4,
    "disabled_tasks": 1
  }
}
```

#### List Tasks
```bash
vkteams-bot-cli scheduler list
```

### task
Manage scheduled tasks.

#### Show Task
```bash
vkteams-bot-cli task show TASK_ID
```

#### Remove Task
```bash
vkteams-bot-cli task remove TASK_ID
```

#### Enable/Disable Task
```bash
vkteams-bot-cli task enable TASK_ID
vkteams-bot-cli task disable TASK_ID
```

#### Run Task Once
```bash
vkteams-bot-cli task run TASK_ID
```

---

## File Commands

### get-file
Download a file.

```bash
vkteams-bot-cli get-file -f FILE_ID -p /download/path/
```

**Options:**
- `-f, --file-id FILE_ID` (required) - File ID to download
- `-p, --path PATH` - Download directory (default: configured download dir)

---

## Configuration Commands

### setup
Interactive configuration wizard for first-time setup.

```bash
vkteams-bot-cli setup
```

### config
Manage CLI configuration.

```bash
# Show current configuration
vkteams-bot-cli config --show

# Initialize new config file
vkteams-bot-cli config --init

# Interactive configuration wizard
vkteams-bot-cli config --wizard
```

### examples
Show usage examples.

```bash
vkteams-bot-cli examples
```

### list-commands
Show all available commands with descriptions.

```bash
vkteams-bot-cli list-commands
```

### validate
Validate configuration and test bot connection.

```bash
vkteams-bot-cli validate
```

### completion
Generate shell completion scripts.

```bash
# Generate for specific shell
vkteams-bot-cli completion bash
vkteams-bot-cli completion zsh
vkteams-bot-cli completion fish
vkteams-bot-cli completion powershell

# Save to file
vkteams-bot-cli completion bash -o ~/.bash_completion.d/vkteams-bot-cli

# Install system-wide
vkteams-bot-cli completion bash --install

# Generate for all shells
vkteams-bot-cli completion bash --all
```

---

## Diagnostic Commands

### health-check
Check bot health and connection.

```bash
vkteams-bot-cli health-check
```

**Options:**
- `-d, --detailed` - Show detailed bot information

**JSON Response:**
```json
{
  "success": true,
  "data": {
    "ok": true,
    "userId": "bot123",
    "nick": "MyBot",
    "firstName": "VK Teams Bot",
    "about": "Official bot"
  }
}
```

### get-self
Get bot's own information.

```bash
vkteams-bot-cli get-self --detailed
```

### api-info
Show API endpoints and configuration.

```bash
vkteams-bot-cli api-info
```

### test-connection
Test connection to VK Teams API.

```bash
vkteams-bot-cli test-connection
```

### system-info
Show system and environment information.

```bash
vkteams-bot-cli system-info
```

### verify-webhook
Test webhook configuration.

```bash
vkteams-bot-cli verify-webhook -u https://myserver.com/webhook
```

### get-events
Get events from the bot's event stream.

```bash
# Get events once
vkteams-bot-cli get-events

# Long polling mode
vkteams-bot-cli get-events -l true
```

---

## Storage Commands

### storage
Manage vector storage for embeddings.

#### Initialize Storage
```bash
vkteams-bot-cli storage init
```

#### Show Information
```bash
vkteams-bot-cli storage info
```

#### Store Document
```bash
vkteams-bot-cli storage store -d "Document content" -m "metadata"
```

#### Search Similar
```bash
vkteams-bot-cli storage search -q "search query" -l 10
```

#### Get Document
```bash
vkteams-bot-cli storage get -i DOCUMENT_ID
```

#### Delete Document
```bash
vkteams-bot-cli storage delete -i DOCUMENT_ID
```

#### List Documents
```bash
vkteams-bot-cli storage list -l 20 -o 0
```

#### Clear Storage
```bash
vkteams-bot-cli storage clear --confirm
```

---

## Daemon Commands

### daemon
Run the bot in daemon mode for webhook handling.

```bash
# Start daemon with default settings
vkteams-bot-cli daemon start

# Start with custom webhook URL
vkteams-bot-cli daemon start --webhook-url https://myserver.com/webhook

# Start on specific port
vkteams-bot-cli daemon start --port 8080

# Enable hot reload
vkteams-bot-cli daemon start --hot-reload
```

**Options:**
- `--webhook-url URL` - Webhook URL for receiving events
- `--port PORT` - Port to listen on (default: 8080)
- `--hot-reload` - Enable configuration hot reload
- `--health-endpoint PATH` - Health check endpoint (default: /health)

---

## Exit Codes

The CLI uses the following exit codes:

| Code | Description |
|------|-------------|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Connection error |
| 4 | API error |
| 5 | File I/O error |
| 6 | Invalid input |
| 7 | Timeout |
| 8 | Feature not supported |

## Environment Variables

| Variable | Description |
|----------|-------------|
| `VKTEAMS_BOT_API_TOKEN` | Bot API token |
| `VKTEAMS_BOT_API_URL` | API base URL |
| `VKTEAMS_PROXY` | HTTP proxy URL |
| `VKTEAMS_LOG_LEVEL` | Log level (trace, debug, info, warn, error) |
| `VKTEAMS_DOWNLOAD_DIR` | Default download directory |
| `VKTEAMS_CONFIG_PATH` | Custom config file path |

## See Also

- [JSON Output Documentation]JSON_OUTPUT.md
- [Configuration Guide]../README.md#configuration
- [Examples]../README.md#examples