@4via6/relay 1.0.0 → 1.1.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.
Files changed (66) hide show
  1. package/README.md +99 -48
  2. package/dist/auth.d.ts +1 -0
  3. package/dist/auth.js +6 -3
  4. package/dist/auth.js.map +1 -1
  5. package/dist/bot.js +2 -1
  6. package/dist/bot.js.map +1 -1
  7. package/dist/cli.d.ts +1 -1
  8. package/dist/cli.js +110 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/admin.js +134 -29
  11. package/dist/commands/admin.js.map +1 -1
  12. package/dist/commands/media.js +10 -7
  13. package/dist/commands/media.js.map +1 -1
  14. package/dist/config/index.d.ts +7 -0
  15. package/dist/config/index.js +16 -0
  16. package/dist/config/index.js.map +1 -0
  17. package/dist/config/loader.d.ts +11 -0
  18. package/dist/config/loader.js +161 -0
  19. package/dist/config/loader.js.map +1 -0
  20. package/dist/config/schema.d.ts +32 -0
  21. package/dist/config/schema.js +32 -0
  22. package/dist/config/schema.js.map +1 -0
  23. package/dist/config/setup.d.ts +3 -0
  24. package/dist/config/setup.js +142 -0
  25. package/dist/config/setup.js.map +1 -0
  26. package/dist/daemon.d.ts +5 -0
  27. package/dist/daemon.js +215 -0
  28. package/dist/daemon.js.map +1 -0
  29. package/dist/index.js +33 -29
  30. package/dist/index.js.map +1 -1
  31. package/dist/providers/claude.js +35 -33
  32. package/dist/providers/claude.js.map +1 -1
  33. package/dist/providers/codex.js +33 -31
  34. package/dist/providers/codex.js.map +1 -1
  35. package/dist/providers/index.js +2 -1
  36. package/dist/providers/index.js.map +1 -1
  37. package/dist/providers/opencode.js +8 -5
  38. package/dist/providers/opencode.js.map +1 -1
  39. package/dist/session.js +3 -2
  40. package/dist/session.js.map +1 -1
  41. package/dist/update.d.ts +1 -0
  42. package/dist/update.js +132 -0
  43. package/dist/update.js.map +1 -0
  44. package/dist/utils/files.js +2 -1
  45. package/dist/utils/files.js.map +1 -1
  46. package/dist/utils/logger.d.ts +7 -0
  47. package/dist/utils/logger.js +15 -0
  48. package/dist/utils/logger.js.map +1 -0
  49. package/dist/utils/store.js +1 -0
  50. package/dist/utils/store.js.map +1 -1
  51. package/dist/utils/stream.js +6 -3
  52. package/dist/utils/stream.js.map +1 -1
  53. package/dist/utils/stt.js +27 -16
  54. package/dist/utils/stt.js.map +1 -1
  55. package/dist/utils/system-prompt.js +16 -5
  56. package/dist/utils/system-prompt.js.map +1 -1
  57. package/dist/utils/timeout.js +2 -3
  58. package/dist/utils/timeout.js.map +1 -1
  59. package/docs/commands.md +7 -15
  60. package/docs/configuration.md +122 -108
  61. package/docs/features.md +70 -36
  62. package/docs/getting-started.md +75 -30
  63. package/docs/providers.md +18 -32
  64. package/docs/troubleshooting.md +126 -75
  65. package/package.json +4 -3
  66. package/.env.example +0 -50
@@ -1 +1 @@
1
- {"version":3,"file":"stt.js","sourceRoot":"","sources":["../../src/utils/stt.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,CAAC,CACP,OAAO,CAAC,GAAG,CAAC,cAAc;QAC1B,OAAO,CAAC,GAAG,CAAC,YAAY;QACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAC/B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,MAAM,CAAgB,CAAC;IAErE,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,MAAM,MAAM,GAAuC;YACjD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;YAC9B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAClC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;SAC3C,CAAC;QACF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,C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,IAAI,CAAC,EAAE,EAAE,wBAAwB,CAAC,CAAC;YACvG,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;QAC7D,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC9D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { readFileSync, existsSync, watchFile, unwatchFile } from "fs";
2
- import { resolve } from "path";
2
+ import { resolve, join } from "path";
3
+ import { getConfig } from "../config/index.js";
3
4
  const DEFAULT_SYSTEM_PROMPT = `You are a coding assistant accessed through a Telegram bot. Your responses are delivered as Telegram messages, so keep them concise and under 4000 characters when possible — use Markdown formatting (bold, inline code, code blocks) for readability. Focus on actionable, practical answers: provide code, commands, or direct solutions rather than lengthy explanations. Messages may originate from voice transcriptions, so interpret the user's intent generously even if the wording is imprecise or contains transcription artifacts.`;
4
5
  let cachedPrompt = null;
5
6
  let watchedPath = null;
@@ -56,9 +57,19 @@ export function unwatchSystemPrompt() {
56
57
  }
57
58
  }
58
59
  function resolvePromptPath() {
59
- const envPath = process.env.SYSTEM_PROMPT_FILE;
60
- if (envPath)
61
- return resolve(envPath);
62
- return resolve("skill.md");
60
+ const config = getConfig();
61
+ // 1. Explicit path from config
62
+ if (config.systemPromptFile)
63
+ return resolve(config.systemPromptFile);
64
+ // 2. .relay/SKILL.md
65
+ const relaySkill = join(config.dataDir || ".relay", "SKILL.md");
66
+ if (existsSync(relaySkill))
67
+ return resolve(relaySkill);
68
+ // 3. ./SKILL.md in cwd (backward compat)
69
+ const cwdSkill = resolve("SKILL.md");
70
+ if (existsSync(cwdSkill))
71
+ return cwdSkill;
72
+ // 4. Return the .relay/SKILL.md path anyway (for watch setup)
73
+ return resolve(relaySkill);
63
74
  }
64
75
  //# sourceMappingURL=system-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/utils/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,qBAAqB,GAAG,ihBAAihB,CAAC;AAEhjB,IAAI,YAAY,GAAkB,IAAI,CAAC;AACvC,IAAI,WAAW,GAAkB,IAAI,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC;IAC/C,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IACrC,IAAI,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;YAC3D,IAAI,WAAW,EAAE,CAAC;gBAChB,YAAY,GAAG,WAAW,CAAC;gBAC3B,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;oBAC7B,IAAI,WAAW;wBAAE,WAAW,CAAC,WAAW,CAAC,CAAC;oBAC1C,SAAS,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE;wBAC3C,YAAY,GAAG,IAAI,CAAC;oBACtB,CAAC,CAAC,CAAC;oBACH,WAAW,GAAG,QAAQ,CAAC;gBACzB,CAAC;gBACD,OAAO,Y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I,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QACvD,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,IAAI,WAAW,EAAE,CAAC;QAChB,WAAW,CAAC,WAAW,CAAC,CAAC;QACzB,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,+BAA+B;IAC/B,IAAI,MAAM,CAAC,gBAAgB;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAErE,qBAAqB;IACrB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,QAAQ,EAAE,UAAU,CAAC,CAAC;IAChE,IAAI,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvD,yCAAyC;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE1C,8DAA8D;IAC9D,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,7 +1,6 @@
1
- const DEFAULT_PROMPT_TIMEOUT = 5 * 60 * 1000; // 5 minutes
1
+ import { getConfig } from "../config/index.js";
2
2
  export function getPromptTimeout() {
3
- const env = process.env.PROMPT_TIMEOUT_MS;
4
- return env ? Number(env) : DEFAULT_PROMPT_TIMEOUT;
3
+ return getConfig().promptTimeoutMs;
5
4
  }
6
5
  export async function withTimeout(promise, ms, label = "Operation") {
7
6
  let timer;
@@ -1 +1 @@
1
- {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../src/utils/timeout.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAE1D,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC1C,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,EAAU,EACV,QAAgB,WAAW;IAE3B,IAAI,KAAoC,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;QAC/C,KAAK,GAAG,UAAU,CAChB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,oBAAoB,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAC7E,EAAE,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAM,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../src/utils/timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,EAAE,CAAC,eAAe,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAmB,EACnB,EAAU,EACV,QAAgB,WAAW;IAE3B,IAAI,KAAoC,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;QAC/C,KAAK,GAAG,UAAU,CAChB,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,oBAAoB,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAC7E,EAAE,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAM,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
package/docs/commands.md CHANGED
@@ -202,27 +202,19 @@ List all available OpenCode commands that can be used with `/cmd`.
202
202
 
203
203
  ### `/models`
204
204
 
205
- List all available models grouped by provider. Each model shows capability badges:
205
+ List all available models with an interactive inline keyboard. Tap a model button to select it instantly.
206
+
207
+ Each model shows capability badges:
206
208
 
207
209
  - `[reasoning]` -- The model supports extended thinking/reasoning
208
210
  - `[vision]` -- The model accepts image input
209
- - `[active]` -- Currently selected model
210
-
211
- Example output:
211
+ - `✓` prefix -- Currently selected model
212
212
 
213
- ```
214
- Available Models
215
-
216
- anthropic
217
- claude-sonnet-4-20250514 [reasoning] [active]
218
- claude-opus-4-20250514 [reasoning]
219
- claude-haiku-4-20250514
213
+ Models are grouped by provider with header rows. If there are more than 8 models, pagination buttons (`« Prev` / `Next »`) appear at the bottom.
220
214
 
221
- openrouter
222
- deepseek/deepseek-r1 [reasoning]
223
- ```
215
+ Tapping a model button switches to that model immediately and shows a confirmation with capabilities.
224
216
 
225
- All providers fetch models dynamically from their respective APIs.
217
+ All providers fetch models dynamically from their respective APIs. If the provider API key is not set, no models are listed.
226
218
 
227
219
  ### `/model [provider/model]`
228
220
 
@@ -1,88 +1,108 @@
1
1
  # Configuration Reference
2
2
 
3
- All configuration is done through environment variables in the `.env` file. Copy `.env.example` to `.env` to get started.
3
+ Relay uses a JSON config file at `.relay/config.json`. Run `relay onboard` for the interactive wizard, or pass settings via CLI flags.
4
4
 
5
- ## Required Variables
5
+ ## Setup
6
6
 
7
- | Variable | Description |
8
- |----------|-------------|
9
- | `BOT_TOKEN` | Telegram bot token from [@BotFather](https://t.me/BotFather) |
10
- | `ALLOWED_USER_ID` | Your Telegram user ID (only this user can interact with the bot) |
11
- | `PROVIDER` | Which coding agent to use: `opencode`, `claude`, or `codex` |
7
+ ```bash
8
+ relay onboard # Interactive wizard
9
+ relay --bot-token=xxx --allowed-user-id=123 --provider=opencode # CLI flags
10
+ ```
11
+
12
+ Config resolution order: **CLI flags > config file > defaults**.
13
+
14
+ ## Subcommands
15
+
16
+ | Command | Description |
17
+ |---------|-------------|
18
+ | `relay onboard` | Interactive configuration wizard |
19
+ | `relay start` | Start the bot as a background daemon |
20
+ | `relay stop` | Stop the background daemon |
21
+ | `relay restart` | Restart the background daemon |
22
+ | `relay logs` | Tail daemon logs (Ctrl+C to exit) |
23
+ | `relay status` | Show daemon status (PID, uptime, memory) |
24
+ | `relay update` | Update Relay to the latest version |
25
+
26
+ ## CLI Flags
27
+
28
+ | Flag | Description |
29
+ |------|-------------|
30
+ | `--help`, `-h` | Show help |
31
+ | `--version`, `-v` | Show version |
32
+ | `--bot-token` | Telegram bot token |
33
+ | `--allowed-user-id` | Telegram user ID |
34
+ | `--provider` | Provider: `opencode`, `claude`, `codex` |
35
+ | `--bot-mode` | `polling` or `webhook` |
36
+ | `--webhook-url` | Webhook URL (when `--bot-mode=webhook`) |
37
+ | `--webhook-port` | Webhook port (default: 3000) |
38
+ | `--webhook-secret` | Webhook secret token |
39
+ | `--streaming-enabled` | `true` or `false` |
40
+ | `--stream-edit-interval-ms` | Stream edit interval in ms |
41
+ | `--prompt-timeout-ms` | Prompt timeout in ms |
42
+ | `--log-level` | `debug`, `info`, `warn`, `error` |
43
+ | `--data-dir` | Data directory (default: `.relay/`) |
44
+ | `--system-prompt-file` | Custom system prompt file path |
45
+
46
+ ## Core Settings
47
+
48
+ | Config field | CLI flag | Default | Description |
49
+ |-------------|----------|---------|-------------|
50
+ | `botToken` | `--bot-token` | -- | Telegram bot token from [@BotFather](https://t.me/BotFather) |
51
+ | `allowedUserId` | `--allowed-user-id` | -- | Your Telegram user ID |
52
+ | `provider` | `--provider` | `opencode` | Coding agent: `opencode`, `claude`, or `codex` |
12
53
 
13
54
  ## Provider Configuration
14
55
 
15
- Each provider has its own set of required and optional variables. See [Providers](providers.md) for detailed setup.
56
+ Each provider has its own settings. Provider API keys (like `ANTHROPIC_API_KEY`) are configured in your coding agent's environment, not in Relay.
57
+
58
+ See [Providers](providers.md) for detailed setup.
16
59
 
17
60
  ### OpenCode
18
61
 
19
- | Variable | Required | Default | Description |
20
- |----------|----------|---------|-------------|
21
- | `OPENCODE_MODE` | No | `start` | `start` spawns a local server, `connect` connects to a remote URL |
22
- | `OPENCODE_URL` | No | `http://localhost:4096` | Server URL (used when `MODE=connect`) |
23
- | `OPENCODE_HOSTNAME` | No | `127.0.0.1` | Bind address (used when `MODE=start`) |
24
- | `OPENCODE_PORT` | No | `4096` | Port number (used when `MODE=start`) |
25
- | `OPENCODE_MODEL` | No | Server default | Model override, e.g. `anthropic/claude-sonnet-4-20250514` |
62
+ | Config field | CLI flag | Default | Description |
63
+ |-------------|----------|---------|-------------|
64
+ | `opencodeMode` | `--opencode-mode` | `start` | `start` spawns a local server, `connect` connects to a remote URL |
65
+ | `opencodeUrl` | `--opencode-url` | `http://localhost:4096` | Server URL (used when mode=`connect`) |
66
+ | `opencodeHostname` | `--opencode-hostname` | `127.0.0.1` | Bind address (used when mode=`start`) |
67
+ | `opencodePort` | `--opencode-port` | `4096` | Port number (used when mode=`start`) |
68
+ | `opencodeModel` | `--opencode-model` | Server default | Model override, e.g. `anthropic/claude-sonnet-4-20250514` |
26
69
 
27
70
  ### Claude Code
28
71
 
29
- | Variable | Required | Default | Description |
30
- |----------|----------|---------|-------------|
31
- | `ANTHROPIC_API_KEY` | Yes | -- | Anthropic API key |
32
- | `CLAUDE_MODEL` | No | `sonnet` | Model name or ID (use `/models` to see all available) |
33
- | `CLAUDE_PERMISSION_MODE` | No | `acceptEdits` | How Claude handles file edits |
34
- | `CLAUDE_CWD` | No | Current directory | Working directory for Claude |
72
+ | Config field | CLI flag | Default | Description |
73
+ |-------------|----------|---------|-------------|
74
+ | `claudeModel` | `--claude-model` | `sonnet` | Model name or ID |
75
+ | `claudePermissionMode` | `--claude-permission-mode` | `acceptEdits` | How Claude handles file edits |
76
+ | `claudeCwd` | `--claude-cwd` | Current directory | Working directory |
35
77
 
36
78
  ### OpenAI Codex
37
79
 
38
- | Variable | Required | Default | Description |
39
- |----------|----------|---------|-------------|
40
- | `CODEX_API_KEY` | Yes* | -- | OpenAI API key (*or use `OPENAI_API_KEY`) |
41
- | `CODEX_MODEL` | No | `o3` | Model name or ID (use `/models` to see all available) |
42
- | `CODEX_CWD` | No | Current directory | Working directory for Codex |
80
+ | Config field | CLI flag | Default | Description |
81
+ |-------------|----------|---------|-------------|
82
+ | `codexModel` | `--codex-model` | `o3` | Model name or ID |
83
+ | `codexCwd` | `--codex-cwd` | Current directory | Working directory |
43
84
 
44
85
  ## Bot Mode
45
86
 
46
- | Variable | Default | Description |
47
- |----------|---------|-------------|
48
- | `BOT_MODE` | `polling` | `polling` for long-polling, `webhook` for webhook mode |
49
- | `WEBHOOK_URL` | -- | Public URL for receiving Telegram updates (required when `BOT_MODE=webhook`) |
50
- | `WEBHOOK_PORT` | `3000` | Port for the webhook HTTP server |
51
- | `WEBHOOK_SECRET` | -- | Optional secret token for webhook verification |
52
-
53
- ### Long Polling (default)
54
-
55
- The bot connects to Telegram and pulls updates. Simple to set up, works behind NATs/firewalls.
56
-
57
- ```env
58
- BOT_MODE=polling
59
- ```
60
-
61
- ### Webhook Mode
62
-
63
- The bot runs an HTTP server and Telegram pushes updates to it. Lower latency and better for production deployments.
64
-
65
- ```env
66
- BOT_MODE=webhook
67
- WEBHOOK_URL=https://your-server.com/bot
68
- WEBHOOK_PORT=3000
69
- WEBHOOK_SECRET=your-random-secret
70
- ```
71
-
72
- Requirements:
73
- - A public HTTPS URL that Telegram can reach
74
- - The port must be accessible (default: 3000)
87
+ | Config field | CLI flag | Default | Description |
88
+ |-------------|----------|---------|-------------|
89
+ | `botMode` | `--bot-mode` | `polling` | `polling` or `webhook` |
90
+ | `webhookUrl` | `--webhook-url` | -- | Public URL for webhook (required when mode=`webhook`) |
91
+ | `webhookPort` | `--webhook-port` | `3000` | Webhook HTTP server port |
92
+ | `webhookSecret` | `--webhook-secret` | -- | Secret token for webhook verification |
75
93
 
76
94
  ## Data Persistence
77
95
 
78
- | Variable | Default | Description |
79
- |----------|---------|-------------|
80
- | `RELAY_DATA_DIR` | `.relay/` | Directory for persisted bot state |
96
+ | Config field | CLI flag | Default | Description |
97
+ |-------------|----------|---------|-------------|
98
+ | `dataDir` | `--data-dir` | `.relay/` | Directory for persisted bot state |
81
99
 
82
- Relay persists session state, model selection, and provider-specific data to disk so they survive restarts. The `.relay/` directory is created automatically in the project root.
100
+ Relay persists session state, model selection, and provider-specific data to disk so they survive restarts. The `.relay/` directory is created automatically.
83
101
 
84
102
  Files stored:
103
+ - `config.json` — Your configuration (0600 permissions)
85
104
  - `session.json` — Active session ID and selected model
105
+ - `SKILL.md` — Custom system prompt (optional, create manually)
86
106
  - `claude-mcp.json` — Claude provider MCP server configurations
87
107
  - `codex-threads.json` — Codex provider thread ID mappings
88
108
 
@@ -90,71 +110,65 @@ The directory is excluded from git via `.gitignore`.
90
110
 
91
111
  ## Streaming
92
112
 
93
- | Variable | Default | Description |
94
- |----------|---------|-------------|
95
- | `STREAMING_ENABLED` | `false` | Enable progressive message editing during AI responses |
96
- | `STREAM_EDIT_INTERVAL_MS` | `2000` | How often (in ms) to update the Telegram message while streaming |
97
-
98
- When streaming is enabled, the bot sends a "Thinking..." placeholder and progressively updates it as the AI generates its response. This works with all three providers.
113
+ | Config field | CLI flag | Default | Description |
114
+ |-------------|----------|---------|-------------|
115
+ | `streamingEnabled` | `--streaming-enabled` | `false` | Enable progressive message editing |
116
+ | `streamEditIntervalMs` | `--stream-edit-interval-ms` | `2000` | Update interval (ms) while streaming |
99
117
 
100
118
  ## Timeout
101
119
 
102
- | Variable | Default | Description |
103
- |----------|---------|-------------|
104
- | `PROMPT_TIMEOUT_MS` | `300000` | Maximum time (in ms) to wait for a provider response. Default is 5 minutes. |
120
+ | Config field | CLI flag | Default | Description |
121
+ |-------------|----------|---------|-------------|
122
+ | `promptTimeoutMs` | `--prompt-timeout-ms` | `300000` | Max wait time for provider response (5 min) |
105
123
 
106
- If the AI takes longer than this to respond, the request is cancelled and an error message is shown.
124
+ ## Logging
107
125
 
108
- ## System Prompt
126
+ | Config field | CLI flag | Default | Description |
127
+ |-------------|----------|---------|-------------|
128
+ | `logLevel` | `--log-level` | `info` | Log level: `debug`, `info`, `warn`, `error` |
109
129
 
110
- | Variable | Default | Description |
111
- |----------|---------|-------------|
112
- | `SYSTEM_PROMPT_FILE` | `skill.md` | Path to your custom system prompt file |
130
+ Relay uses structured JSON logging via pino. Set to `debug` for verbose output when troubleshooting.
113
131
 
114
- The bot looks for a file named `skill.md` in the project root. If found, its contents are prepended to every message sent to the AI. If the file doesn't exist, a built-in default prompt is used.
132
+ ## System Prompt
133
+
134
+ | Config field | CLI flag | Default | Description |
135
+ |-------------|----------|---------|-------------|
136
+ | `systemPromptFile` | `--system-prompt-file` | -- | Path to custom system prompt file |
115
137
 
116
- The file is watched for changes and reloaded automatically. You can also force a reload with `/system reload`.
138
+ The bot looks for a system prompt in this order:
139
+ 1. Explicit path from `systemPromptFile` config
140
+ 2. `.relay/SKILL.md` if it exists
141
+ 3. `./SKILL.md` in the current directory (backward compatibility)
142
+ 4. Built-in default prompt
117
143
 
118
- See [Features > System Prompt](features.md#system-prompt) for details on customizing the prompt.
144
+ The file is watched for changes and reloaded automatically. Use `/system reload` to force a reload.
119
145
 
120
146
  ## Voice / Speech-to-Text
121
147
 
122
- | Variable | Default | Description |
123
- |----------|---------|-------------|
124
- | `STT_PROVIDER` | `auto` | STT provider: `groq`, `openai`, `assemblyai`, or `auto` |
125
- | `GROQ_API_KEY` | -- | Groq API key for Whisper |
126
- | `GROQ_STT_MODEL` | `whisper-large-v3-turbo` | Groq transcription model |
127
- | `OPENAI_API_KEY` | -- | OpenAI API key for Whisper |
128
- | `OPENAI_STT_MODEL` | `gpt-4o-mini-transcribe` | OpenAI transcription model |
129
- | `ASSEMBLYAI_API_KEY` | -- | AssemblyAI API key |
148
+ | Config field | CLI flag | Default | Description |
149
+ |-------------|----------|---------|-------------|
150
+ | `sttProvider` | `--stt-provider` | `auto` | STT provider: `groq`, `openai`, `assemblyai`, or `auto` |
151
+ | `groqApiKey` | `--groq-api-key` | -- | Groq API key for Whisper |
152
+ | `openaiSttApiKey` | `--openai-stt-api-key` | -- | OpenAI API key for speech-to-text |
153
+ | `assemblyaiApiKey` | `--assemblyai-api-key` | -- | AssemblyAI API key |
154
+ | `groqSttModel` | -- | `whisper-large-v3-turbo` | Groq transcription model |
155
+ | `openaiSttModel` | -- | `gpt-4o-mini-transcribe` | OpenAI transcription model |
130
156
 
131
- Set at least one API key to enable voice message support. When `STT_PROVIDER=auto` (default), the cheapest available provider is selected automatically:
157
+ Set at least one API key during `relay onboard` to enable voice message support. When `sttProvider` is `auto` (default), the cheapest available provider is selected:
132
158
 
133
159
  1. **Groq** (fastest, has a free tier)
134
160
  2. **AssemblyAI**
135
161
  3. **OpenAI**
136
162
 
137
- ## Example `.env` File
138
-
139
- ```env
140
- # Telegram
141
- BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
142
- ALLOWED_USER_ID=987654321
143
-
144
- # Provider
145
- PROVIDER=opencode
146
- OPENCODE_MODE=start
147
-
148
- # Bot mode (polling or webhook)
149
- BOT_MODE=polling
150
-
151
- # Streaming
152
- STREAMING_ENABLED=true
153
- STREAM_EDIT_INTERVAL_MS=2000
154
-
155
- # Timeout
156
- PROMPT_TIMEOUT_MS=300000
157
-
158
- # Voice (set at least one for voice support)
159
- GROQ_API_KEY=gsk_...
163
+ ## Example Config
164
+
165
+ ```json
166
+ {
167
+ "botToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
168
+ "allowedUserId": 987654321,
169
+ "provider": "opencode",
170
+ "streamingEnabled": true,
171
+ "logLevel": "info",
172
+ "groqApiKey": "gsk_..."
173
+ }
160
174
  ```
package/docs/features.md CHANGED
@@ -24,13 +24,21 @@ Relay streams AI responses in real time. As the AI generates text, the Telegram
24
24
 
25
25
  ### Configuration
26
26
 
27
- Streaming is enabled by default. To disable it:
27
+ Streaming is configured during `relay onboard`, or via CLI flag:
28
28
 
29
- ```env
30
- STREAMING=false
29
+ ```bash
30
+ relay --streaming-enabled=true
31
31
  ```
32
32
 
33
- When disabled, the bot waits for the complete response before sending a single message.
33
+ Or set it in `.relay/config.json`:
34
+
35
+ ```json
36
+ {
37
+ "streamingEnabled": true
38
+ }
39
+ ```
40
+
41
+ When disabled (default), the bot waits for the complete response before sending a single message.
34
42
 
35
43
  ---
36
44
 
@@ -68,12 +76,14 @@ Send voice notes to the bot and they'll be transcribed and processed as text inp
68
76
 
69
77
  ### Setup
70
78
 
71
- Configure at least one speech-to-text provider:
79
+ Configure at least one speech-to-text provider during `relay onboard`, or set keys in `.relay/config.json`:
72
80
 
73
- ```env
74
- GROQ_API_KEY=gsk_... # Groq Whisper (fastest, has free tier)
75
- OPENAI_API_KEY=sk-... # OpenAI Whisper
76
- ASSEMBLYAI_API_KEY=... # AssemblyAI
81
+ ```json
82
+ {
83
+ "groqApiKey": "gsk_...",
84
+ "openaiSttApiKey": "sk-...",
85
+ "assemblyaiApiKey": "..."
86
+ }
77
87
  ```
78
88
 
79
89
  If multiple providers are configured, the cheapest available one is selected automatically.
@@ -194,25 +204,17 @@ Relay supports switching between AI models at runtime.
194
204
 
195
205
  ### Listing available models
196
206
 
197
- Use `/models` to see all configured models:
207
+ Use `/models` to see all available models as an interactive inline keyboard. Models are grouped by provider, with capability badges shown next to each name. The currently active model is marked with a `✓` prefix.
198
208
 
199
- ```
200
- Available Models
209
+ Tap any model button to switch to it instantly — no need to type a command.
201
210
 
202
- anthropic
203
- claude-sonnet-4-20250514 [reasoning] [active]
204
- claude-opus-4-20250514 [reasoning]
205
- claude-haiku-4-20250514
206
-
207
- openrouter
208
- deepseek/deepseek-r1 [reasoning]
209
- ```
211
+ If there are more than 8 models, pagination buttons (`« Prev` / `Next »`) appear at the bottom.
210
212
 
211
213
  ### Capability badges
212
214
 
213
215
  - `[reasoning]` — The model supports extended thinking/reasoning
214
216
  - `[vision]` — The model accepts image input
215
- - `[active]` — Currently selected model
217
+ - `✓` prefix — Currently selected model
216
218
 
217
219
  ### Switching models
218
220
 
@@ -236,8 +238,10 @@ Capabilities: reasoning, vision
236
238
  ### Provider behavior
237
239
 
238
240
  - **OpenCode**: Lists all models from all configured providers dynamically
239
- - **Claude**: Fetches available models dynamically from the Anthropic API (`GET /v1/models`)
240
- - **Codex**: Fetches available models dynamically from the OpenAI API (`GET /v1/models`)
241
+ - **Claude**: Fetches available models dynamically from the Anthropic API — requires `ANTHROPIC_API_KEY` in the environment
242
+ - **Codex**: Fetches available models dynamically from the OpenAI API — requires `CODEX_API_KEY` or `OPENAI_API_KEY` in the environment
243
+
244
+ If the provider API key is not set or the API call fails, no models are listed.
241
245
 
242
246
  ---
243
247
 
@@ -247,14 +251,26 @@ Customize the AI's behavior with a system prompt file.
247
251
 
248
252
  ### Default behavior
249
253
 
250
- The bot loads a system prompt from `skill.md` in the project root. If the file doesn't exist, a built-in default prompt is used.
254
+ The bot looks for a system prompt in this order:
255
+ 1. Explicit path from `systemPromptFile` in config
256
+ 2. `.relay/SKILL.md` if it exists
257
+ 3. `./SKILL.md` in the current directory (backward compatibility)
258
+ 4. Built-in default prompt
251
259
 
252
260
  ### Custom prompt file
253
261
 
254
- Set a custom path:
262
+ Set a custom path in `.relay/config.json`:
255
263
 
256
- ```env
257
- SYSTEM_PROMPT_FILE=prompts/my-prompt.md
264
+ ```json
265
+ {
266
+ "systemPromptFile": "prompts/my-prompt.md"
267
+ }
268
+ ```
269
+
270
+ Or via CLI flag:
271
+
272
+ ```bash
273
+ relay --system-prompt-file=prompts/my-prompt.md
258
274
  ```
259
275
 
260
276
  ### Hot reload
@@ -397,10 +413,18 @@ Relay automatically persists critical state to disk so it survives bot restarts
397
413
 
398
414
  ### Configuration
399
415
 
400
- Override the data directory:
416
+ Override the data directory in `.relay/config.json`:
417
+
418
+ ```json
419
+ {
420
+ "dataDir": "/path/to/custom/data"
421
+ }
422
+ ```
423
+
424
+ Or via CLI flag:
401
425
 
402
- ```env
403
- RELAY_DATA_DIR=/path/to/custom/data
426
+ ```bash
427
+ relay --data-dir=/path/to/custom/data
404
428
  ```
405
429
 
406
430
  Default: `.relay/` in the project root.
@@ -413,11 +437,21 @@ For production deployments, you can run Relay in webhook mode instead of long-po
413
437
 
414
438
  ### Setup
415
439
 
416
- ```env
417
- BOT_MODE=webhook
418
- WEBHOOK_URL=https://your-server.com/bot
419
- WEBHOOK_PORT=3000
420
- WEBHOOK_SECRET=your-random-secret
440
+ Configure webhook mode during `relay onboard`, or set it in `.relay/config.json`:
441
+
442
+ ```json
443
+ {
444
+ "botMode": "webhook",
445
+ "webhookUrl": "https://your-server.com/bot",
446
+ "webhookPort": 3000,
447
+ "webhookSecret": "your-random-secret"
448
+ }
449
+ ```
450
+
451
+ Or via CLI flags:
452
+
453
+ ```bash
454
+ relay --bot-mode=webhook --webhook-url=https://your-server.com/bot --webhook-port=3000
421
455
  ```
422
456
 
423
457
  ### Requirements
@@ -434,7 +468,7 @@ WEBHOOK_SECRET=your-random-secret
434
468
 
435
469
  ### Switching back to polling
436
470
 
437
- Set `BOT_MODE=polling` (or remove the variable). The bot will clear any stale webhook before starting long-polling.
471
+ Set `botMode` to `polling` in your config (or remove it — polling is the default). The bot will clear any stale webhook before starting long-polling.
438
472
 
439
473
  ### Benefits over polling
440
474