forked from grinev/opencode-telegram-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
172 lines (141 loc) · 6.77 KB
/
Copy path.env.example
File metadata and controls
172 lines (141 loc) · 6.77 KB
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
# Telegram Bot Token (from @BotFather)
TELEGRAM_BOT_TOKEN=
# Allowed Telegram User ID (from @userinfobot)
TELEGRAM_ALLOWED_USER_ID=
# Telegram Proxy URL (optional)
# Supports socks5://, socks4://, http://, https:// protocols
# Examples:
# TELEGRAM_PROXY_URL=socks5://proxy.example.com:1080
# TELEGRAM_PROXY_URL=socks5://user:password@proxy.example.com:1080
# TELEGRAM_PROXY_URL=http://proxy.example.com:8080
# TELEGRAM_PROXY_URL=
# Telegram Reverse-Proxy mode (optional, alternative to TELEGRAM_PROXY_URL)
# For corporate networks that block api.telegram.org but allow your own server.
# Point TELEGRAM_API_ROOT at an HTTPS endpoint that reverse-proxies to
# https://api.telegram.org (e.g. nginx). Applied to Bot API calls AND file
# downloads. TELEGRAM_PROXY_SECRET (optional) is sent as the X-Proxy-Secret
# header so the reverse proxy can authorize callers. See README for an example
# nginx config.
# TELEGRAM_API_ROOT=https://tg-proxy.yourdomain.com
# TELEGRAM_PROXY_SECRET=some-long-random-string
# Force IPv4 for direct Telegram API/file requests (optional, default: false)
# Enable this if startup fails with "Network request ... failed" in an
# environment where IPv6 DNS exists but outbound IPv6 connectivity is broken.
# TELEGRAM_FORCE_IPV4=false
# OpenCode API URL (optional, default: http://localhost:4096)
# OPENCODE_API_URL=http://localhost:4096
# Automatically restart a local OpenCode server when health-checks fail (default: false)
# Only works when OPENCODE_API_URL points to localhost / 127.0.0.1 / ::1 / 0.0.0.0.
# OPENCODE_AUTO_RESTART_ENABLED=false
# OpenCode health monitor interval in seconds when auto-restart is enabled (default: 300)
# OPENCODE_MONITOR_INTERVAL_SEC=300
# OpenCode Server Authentication (optional)
# OPENCODE_SERVER_USERNAME=opencode
# OPENCODE_SERVER_PASSWORD=
# OpenCode Model Configuration (REQUIRED)
# You must specify a default model provider and model ID
# Examples:
# Anthropic Claude 3.5 Sonnet: OPENCODE_MODEL_PROVIDER=anthropic, OPENCODE_MODEL_ID=claude-3-5-sonnet-20241022
# OpenAI GPT-4 Turbo: OPENCODE_MODEL_PROVIDER=openai, OPENCODE_MODEL_ID=gpt-4-turbo
# Groq Mixtral: OPENCODE_MODEL_PROVIDER=groq, OPENCODE_MODEL_ID=mixtral-8x7b-32768
OPENCODE_MODEL_PROVIDER=opencode
OPENCODE_MODEL_ID=big-pickle
# Server Configuration (optional)
# Logging level: debug, info, warn, error (default: info)
# Use "debug" to see detailed diagnostic logs including all bot events
# LOG_LEVEL=info
# Number of log files to keep (default: 10)
# sources mode: keeps the latest N launch logs
# installed mode: keeps the latest N daily logs
# LOG_RETENTION=10
# Bot Configuration (optional)
# Maximum number of sessions shown in /sessions (default: 10)
# SESSIONS_LIST_LIMIT=10
# Maximum number of user messages shown per page in /messages (default: 10)
# MESSAGES_LIST_LIMIT=10
# Maximum number of projects shown in /projects (default: 10)
# PROJECTS_LIST_LIMIT=10
# Maximum number of commands shown in /commands (default: 10)
# COMMANDS_LIST_LIMIT=10
# Maximum number of scheduled tasks allowed at once (default: 10)
# TASK_LIMIT=10
# Maximum execution time for a scheduled task in minutes (default: 120)
# If exceeded, the bot stops waiting for the result and marks the run as failed.
# SCHEDULED_TASK_EXECUTION_TIMEOUT_MINUTES=120
# Send scheduled task result/error messages without Telegram push notifications (default: false)
# SCHEDULED_TASK_DISABLE_NOTIFICATION=false
# Response streaming mode: "edit" (default) or "draft" (default: edit)
# edit = uses editMessageText to update messages incrementally (may flicker)
# draft = uses sendMessageDraft (Bot API 9.5+) for smooth animated draft previews,
# then finalizes with sendMessage. Only works in private chats.
# RESPONSE_STREAMING_MODE=edit
# Stream update throttle in milliseconds for assistant/tool message edits (default: 1000)
# Higher value = fewer Telegram edit requests, lower value = more real-time updates
# RESPONSE_STREAM_THROTTLE_MS=1000
# Maximum displayed length for bash tool commands in Telegram summaries (default: 128)
# Longer commands are truncated with "..."
# BASH_TOOL_DISPLAY_MAX_LENGTH=128
# Bot locale: supported locale code (default: en)
# Supported locales: en, ar, de, es, fr, ru, zh
# BOT_LOCALE=en
# Hide thinking indicator messages (default: false)
# HIDE_THINKING_MESSAGES=false
# Hide tool call service messages (default: false)
# HIDE_TOOL_CALL_MESSAGES=false
# Hide tool file edit documents sent as .txt attachments (default: false)
# HIDE_TOOL_FILE_MESSAGES=false
# Track background sessions in the currently selected project/worktree (default: true)
# Sends short notifications when detached or non-current sessions in the current directory reply,
# ask questions, or request permissions. Other projects/worktrees are not tracked.
# TRACK_BACKGROUND_SESSIONS=true
# Assistant message formatting mode (default: markdown)
# markdown = convert assistant replies to Telegram MarkdownV2
# raw = show assistant replies as plain text
# MESSAGE_FORMAT_MODE=markdown
# Directory Browser Roots (optional)
# Comma-separated list of paths that /open is allowed to browse.
# Supports ~ for home directory. Defaults to ~ when not set.
# Examples:
# OPEN_BROWSER_ROOTS=~/projects
# OPEN_BROWSER_ROOTS=~/projects,~/work,/opt/repos
# OPEN_BROWSER_ROOTS=
# Code File Settings (optional)
# Maximum file size in KB to send as document (default: 100)
# CODE_FILE_MAX_SIZE_KB=100
# Speech-to-Text / Voice Recognition (optional)
# Enable voice message transcription by setting a Whisper-compatible API URL.
# Works with OpenAI, Groq, or any Whisper-compatible endpoint.
# If STT_API_URL is not set, voice messages will get a "not configured" reply.
# STT_API_URL=
# STT_API_KEY=
# STT_MODEL=
# STT_LANGUAGE=
# STT_NOTE_PROMPT="The following text is transcribed from voice. It may contain homophone or phonetic errors. Infer the intended meaning from context."
# Text-to-Speech credentials (optional)
# TTS reply behavior is controlled globally with /tts and persisted in settings.json.
# Provider: "openai" (default), "elevenlabs", or "google".
#
# --- OpenAI-compatible (default) ---
# Set TTS_API_URL and TTS_API_KEY to any OpenAI-compatible TTS endpoint.
# TTS_API_URL=
# TTS_API_KEY=
# TTS_MODEL=gpt-4o-mini-tts
# TTS_VOICE=alloy
#
# --- ElevenLabs ---
# TTS_PROVIDER=elevenlabs
# TTS_API_URL=https://api.elevenlabs.io/v1
# TTS_API_KEY=
# TTS_MODEL=eleven_flash_v2_5
# TTS_VOICE=21m00Tcm4TlvDq8ikWAM
#
# --- Google Cloud TTS ---
# 1. Create a project at https://console.cloud.google.com
# 2. Enable "Cloud Text-to-Speech API"
# 3. Create a Service Account (IAM & Admin > Service Accounts)
# with role "Cloud Text-to-Speech API User"
# 4. Download the JSON key file
# Free tier: 1M characters/month (WaveNet/Neural2), 4M/month (Standard voices)
# TTS_PROVIDER=google
# TTS_VOICE=en-US-Studio-O
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json