# 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 # Set automatically by docker compose. Enables Telegram warnings for commands # that cannot see host files or start/stop OpenCode from inside the container. # You usually do not set this yourself. # OPENCODE_TELEGRAM_CONTAINER=1 # 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 # Comma-separated absolute paths to hide from /projects (project worktrees are matched exactly) # PROJECTS_EXCLUDED_PATHS=/home/user/repo-a,/home/user/repo-b # Maximum number of commands shown in /commands (default: 10) # COMMANDS_LIST_LIMIT=10 # Maximum number of providers/models shown per page in the model picker (default: 10) # MODELS_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 # 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, it, ko, pt, ru, tr, zh # BOT_LOCALE=en # 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 = render assistant replies as native Telegram rich blocks # (tables, lists, quotes, headings, highlighted code) # raw = show assistant replies as plain text # MESSAGE_FORMAT_MODE=markdown # Merge Telegram-split long text messages into one prompt (default: 1500 ms) # Text near Telegram's message length limit is buffered for this window (in # milliseconds); any immediately following chunks are sent as one prompt. # Set to 0 to disable merging and process every message immediately. # MESSAGE_MERGE_WINDOW_MS=1500 # Initial runtime settings preset (optional) # A JSON object that seeds the bot's default /settings values on first run. # Keys not yet persisted in settings.json are initialised to these values; # any setting the user has already changed via /settings is left untouched. # Supported keys: ttsMode ("off"|"all"|"auto"), compactOutputMode (bool), # showThinkingContent (bool), showAssistantRunFooter (bool), # pinnedDashboardEnabled (bool), # responseStreamingMode ("edit"|"draft"), sendDiffFileAttachments (bool), # promptQueueEnabled (bool) # The preset is validated at startup: invalid JSON, a non-object value, unknown # keys, or wrong value types abort startup with a clear error (fail fast). # Example — hide the run footer and enable compact mode by default: # INITIAL_SETTINGS_PRESET={"showAssistantRunFooter":false,"compactOutputMode":true} # 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= # Document Extractor API (optional) # If set, the bot will extract text from PDF, DOCX, PPTX, and other documents # using an external API when the current model doesn't natively support them. # The API should accept multipart/form-data POST with a "file" field and # return JSON with a "text" field containing the extracted content. # Only DOC_EXTRACTOR_URL is required; API key is optional for self-hosted setups. # DOC_EXTRACTOR_URL= # DOC_EXTRACTOR_API_KEY= # STT_MODEL= # STT_LANGUAGE= # STT request format (default: multipart) # multipart = standard OpenAI/Groq Whisper form-data upload # json = base64 audio in an `input_audio` JSON body (e.g. OpenRouter) # STT_REQUEST_FORMAT=multipart # 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", "google", or "edge". # # --- 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 # # --- Microsoft Edge TTS --- # Uses Microsoft Edge's online Read Aloud service. No API key or account # required; only an outbound HTTPS/WebSocket connection to # speech.platform.bing.com. Voice list: https://learn.microsoft.com/azure/ai-services/speech-service/language-support # TTS_PROVIDER=edge # TTS_VOICE=en-US-EmmaMultilingualNeural