{"id":50900495,"url":"https://github.com/hah23255/deepseek-telegram-bridge","last_synced_at":"2026-06-16T02:03:56.945Z","repository":{"id":358340645,"uuid":"1240971240","full_name":"hah23255/deepseek-telegram-bridge","owner":"hah23255","description":"Telegram bridge for DeepSeek TUI — remote session control with model switching, agent mode, and full conversation continuity from any device","archived":false,"fork":false,"pushed_at":"2026-05-27T09:14:59.000Z","size":199,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T11:12:01.111Z","etag":null,"topics":["ai-agent","asyncio","automation","chatbot","cli","coding-agent","deepseek","deepseek-tui","developer-tools","python","remote-control","session-management","systemd","telegram-bot","terminal"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hah23255.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-16T19:56:37.000Z","updated_at":"2026-05-27T09:15:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hah23255/deepseek-telegram-bridge","commit_stats":null,"previous_names":["hah23255/deepseek-telegram-bridge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hah23255/deepseek-telegram-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hah23255%2Fdeepseek-telegram-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hah23255%2Fdeepseek-telegram-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hah23255%2Fdeepseek-telegram-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hah23255%2Fdeepseek-telegram-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hah23255","download_url":"https://codeload.github.com/hah23255/deepseek-telegram-bridge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hah23255%2Fdeepseek-telegram-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34387478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","asyncio","automation","chatbot","cli","coding-agent","deepseek","deepseek-tui","developer-tools","python","remote-control","session-management","systemd","telegram-bot","terminal"],"created_at":"2026-06-16T02:03:56.167Z","updated_at":"2026-06-16T02:03:56.922Z","avatar_url":"https://github.com/hah23255.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/hah23255/deepseek-telegram-bridge/main/assets/banner.svg\" alt=\"DeepSeek Telegram Bridge\" width=\"600\" /\u003e\n\n# DeepSeek Telegram Bridge\n\n### Control DeepSeek TUI from Telegram — anywhere, any device.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Python 3.11+](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![DeepSeek TUI](https://img.shields.io/badge/DeepSeek_TUI-v0.8.37-4B32C3)](https://github.com/Hmbown/DeepSeek-TUI)\n[![systemd](https://img.shields.io/badge/systemd-user_unit-FCC624?logo=linux\u0026logoColor=black)](https://systemd.io/)\n[![Telegram](https://img.shields.io/badge/Telegram-Bot-26A5E4?logo=telegram\u0026logoColor=white)](https://telegram.org/)\n\n\u003c/div\u003e\n\n---\n\n## What is this?\n\nA lightweight Python daemon that bridges your Telegram account to a locally\nrunning **DeepSeek TUI** instance. Send messages from your phone, tablet,\nor any device with Telegram — and get responses from DeepSeek TUI with\n**full session continuity**, **model switching**, and optional **agent mode**\nfor file editing and shell commands.\n\n```\nYou on Telegram          Bridge on your machine         DeepSeek TUI\n     │                         │                            │\n     │  \"edit README.md\"       │                            │\n     │ ───────────────────────►│                            │\n     │                         │  spawn subprocess          │\n     │                         │ ──────────────────────────►│\n     │                         │                            │ edits file\n     │                         │ ◄──────────────────────────│\n     │  \"Done — updated.\"      │                            │\n     │ ◄───────────────────────│                            │\n```\n\n## Features\n\n| Category | Capability |\n|----------|-----------|\n| **Remote control** | Chat with DeepSeek TUI from Telegram on any device |\n| **Session continuity** | Conversations persist across messages — pick up where you left off |\n| **Agent mode** | Toggle `/agent on` to enable write, edit, shell, and git from Telegram |\n| **Model switching** | `/model v4-pro` or `/model v4-flash` — switch per chat |\n| **Reasoning control** | `/reasoning low|medium|high|auto` — tune thinking depth |\n| **Security** | User ID allowlist, no exposed ports, systemd hardening |\n| **Observability** | Typing indicators, structured logs, health-check scripts |\n| **Portable** | Single-file daemon (~500 LOC Python), one dependency |\n\n## Quick Start\n\n```bash\n# 1. Get a Telegram bot token from @BotFather and your user ID from @userinfobot\n# 2. Download and install\ngit clone https://github.com/hah23255/deepseek-telegram-bridge.git\ncd deepseek-telegram-bridge\nbash scripts/install.sh\n\n# 3. Edit config/config.json with your bot token and user ID\n# 4. Start\nsystemctl --user start deepseek-telegram-bridge.service\n\n# 5. Message your bot on Telegram — it replies via DeepSeek TUI\n```\n\n## Architecture\n\n```mermaid\nflowchart LR\n    U([\"📱 You\u003cbr/\u003eon Telegram\"])\n    TG[\"Telegram\u003cbr/\u003eBot API\"]\n    B[\"Bridge Daemon\u003cbr/\u003ePython asyncio\u003cbr/\u003e~500 LOC\"]\n    D[\"deepseek-tui\u003cbr/\u003eexec --json\"]\n    CK[(\"Checkpoints\u003cbr/\u003e~/.deepseek/sessions/\")]\n    ST[(\"state.json\u003cbr/\u003echat_settings\")]\n\n    U --\u003e|message| TG\n    TG --\u003e|long-poll\u003cbr/\u003egetUpdates| B\n    B --\u003e|spawn\u003cbr/\u003e--fresh / --continue| D\n    D --\u003e|JSON stdout| B\n    B --\u003e|sendMessage| TG\n    TG --\u003e|reply| U\n    B \u003c--\u003e|read/write| ST\n    D \u003c--\u003e|session continuity| CK\n\n    style U fill:#26A5E4,color:#fff\n    style TG fill:#26A5E4,color:#fff\n    style B fill:#4B32C3,color:#fff\n    style D fill:#6C3,color:#fff\n    style CK fill:#555,color:#fff\n    style ST fill:#555,color:#fff\n```\n\n## Data Flow (per message)\n\n```mermaid\nsequenceDiagram\n    autonumber\n    participant U as 📱 User (Telegram)\n    participant T as Telegram API\n    participant B as Bridge Daemon\n    participant D as deepseek-tui exec\n    participant S as state.json\n\n    U-\u003e\u003eT: \"edit README.md\"\n    T--\u003e\u003eB: getUpdates → message\n    B-\u003e\u003eB: is_authorized(user_id)?\n    B-\u003e\u003eS: lookup chat_settings\n    S--\u003e\u003eB: {model: v4-pro, agent: true}\n    B-\u003e\u003eT: sendChatAction(\"typing\")\n    par heartbeat (every 4s)\n        B-\u003e\u003eT: typing\n    and deepseek-tui subprocess\n        B-\u003e\u003eD: exec --auto --json --model v4-pro --continue\n        D--\u003e\u003eD: reasoning + tool calls\n        D--\u003e\u003eB: {\"output\": \"...\", \"status\": \"completed\"}\n    end\n    B-\u003e\u003eT: sendMessage(reply)\n    T--\u003e\u003eU: 💬 DeepSeek's answer\n    B-\u003e\u003eS: persist session state\n```\n\n## Session Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Fresh: First message (/new or new chat)\n    Fresh --\u003e Continuing: --fresh spawn\n    Continuing --\u003e Continuing: --continue spawn (context preserved)\n    Continuing --\u003e Fresh: /new command\n    Continuing --\u003e Agent: /agent on\n    Agent --\u003e Agent: --auto --continue (tools enabled)\n    Agent --\u003e Continuing: /agent off\n    Agent --\u003e Fresh: /new command\n```\n\n## Telegram Commands\n\n| Command | What it does |\n|---------|-------------|\n| `/start` | Welcome message |\n| `/help` | Show all commands |\n| `/new` | Start fresh session (forgets context) |\n| `/status` | Show current session info |\n| `/model v4-pro` | Switch to deepseek-v4-pro (full quality) |\n| `/model v4-flash` | Switch to deepseek-v4-flash (fast, cheaper) |\n| `/reasoning low` | Minimal thinking (fastest responses) |\n| `/reasoning medium` | Balanced |\n| `/reasoning high` | Deep reasoning for complex tasks |\n| `/reasoning auto` | Default behavior |\n| `/agent on` | Enable tools — write, edit, shell, git |\n| `/agent off` | Disable tools — fast chat only |\n\n## File Layout\n\n```\ndeepseek-telegram-bridge/\n├── src/\n│   └── bridge.py                   # Main daemon (~500 LOC)\n├── config/\n│   └── config.example.json         # Configuration template\n├── scripts/\n│   ├── install.sh                  # Full setup: venv, deps, systemd unit\n│   ├── install-skill.sh            # Install DeepSeek TUI management skill\n│   ├── status.sh                   # Quick health check\n│   └── diagnostics.sh              # 7-point system diagnostic\n├── docs/\n│   ├── USER_MANUAL.md              # End-user guide\n│   └── API_ARCHITECTURE.md         # Internals, extension points\n├── skill/\n│   ├── SKILL.md                    # DeepSeek TUI skill for bridge management\n│   └── references/\n│       ├── bridge-architecture.md\n│       └── troubleshooting.md\n├── requirements.txt                # httpx[http2]\n├── .gitignore\n└── README.md\n```\n\n## DeepSeek TUI Skill\n\nThe pack includes a **management skill** for DeepSeek TUI. Install it to let\nDeepSeek TUI manage the bridge directly:\n\n```bash\nbash scripts/install-skill.sh\n```\n\nAfter installation, you can ask DeepSeek TUI:\n- \"Check the bridge status\"\n- \"Restart the bridge service\"\n- \"Show me recent bridge logs\"\n- \"Add user X to the bridge allowlist\"\n- \"Troubleshoot why the bot isn't replying\"\n\n## Performance\n\n| Prompt | Model | Mode | Time | Output |\n|--------|-------|------|------|--------|\n| \"hi\" | v4-flash | chat --fresh | ~16s | 72 chars |\n| \"test connection\" | v4-flash | chat --continue | ~95s | 1374 chars |\n| Complex task | v4-flash | chat --continue | ~66s | 3542 chars |\n\nAgent mode (`/agent on`) adds 30-120s for tool execution. Use v4-flash for\nfast mobile chat; switch to v4-pro for heavy analysis.\n\n## Requirements\n\n- **Python** 3.11+\n- **deepseek-tui** v0.8.20+ (`npm install -g deepseek-tui --prefix ~/.local`)\n- **httpx** with HTTP/2 support (auto-installed by `install.sh`)\n- **systemd --user** (Linux) — see docs for macOS/Windows alternatives\n- **Telegram bot token** from [@BotFather](https://t.me/BotFather)\n\n## Security\n\n```mermaid\ngraph TD\n    A[Incoming Telegram message]\n    B{user_id in\u003cbr/\u003eallowed_user_ids?}\n    C{chat_id in\u003cbr/\u003eallowed_chat_ids?}\n    D[Process message]\n    E[Drop silently + log]\n\n    A --\u003e B\n    B --\u003e|no| E\n    B --\u003e|yes| C\n    C --\u003e|no| E\n    C --\u003e|yes| D\n\n    style E fill:#E74C3C,color:#fff\n    style D fill:#27AE60,color:#fff\n```\n\n- **Default-deny**: non-empty `allowed_user_ids` = only listed users\n- **No exposed ports**: long-polling only, no webhook server\n- **systemd hardened**: `PrivateTmp`, `ProtectSystem=strict`, `NoNewPrivileges`\n- **Token secrecy**: httpx INFO logs suppressed, token never in log output\n- **Single-user by design**: one bot, one chat perspective\n\n## Comparison\n\n| | deepseek-telegram-bridge | kimi-to-im | cc-telegram-bridge | OpenClaw |\n|---|---|---|---|---|\n| **Agent** | DeepSeek TUI | Kimi CLI | Codex + Claude | Multi-agent |\n| **Language** | Python (~500 LOC) | Python (~1700 LOC) | TypeScript | Go + TS |\n| **Session** | Native checkpoints | --print -S | /resume scan | Gateway |\n| **Agent mode** | `/agent on` toggle | Always on | Per-instance | Always on |\n| **Multi-bot** | Single | Single | Yes (bus) | Yes (gateway) |\n| **Complexity** | Low | Low | High | Very High |\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Built for one user, one host, one Telegram chat.**\n**Not trying to be more than that.**\n\n[Report an issue](https://github.com/hah23255/deepseek-telegram-bridge/issues) · [Docs](docs/) · [Discussions](https://github.com/hah23255/deepseek-telegram-bridge/discussions)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhah23255%2Fdeepseek-telegram-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhah23255%2Fdeepseek-telegram-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhah23255%2Fdeepseek-telegram-bridge/lists"}