Turn your Telegram into a live AI Agent Control Room & Ops Mission Control
Control OpenCode, AI coding agents, and terminal operations on your machine or VPS directly from your phone via Telegram.
๐ฆ View on NPM โข ๐ท๏ธ Releases โข ๐ Quick Start โข ๐ฑ Features โข โ FAQ
Developers shouldn't be chained to their desks waiting for an AI agent to finish modifying code, executing test suites, or running remote deployment scripts.
AgentGram turns your phone into a mobile developer cockpit:
- ๐ฒ Live Streaming Mission Control: Real-time progress updates inside a dynamic message (updates smoothly every ~2.5s with tools, steps, and output tails).
- ๐ One-Tap Permission Buttons: Approve or reject file edits and commands with
[ โ Allow Once ],[ โพ๏ธ Always Allow ], or[ โ Reject ]. - โก Auto Mode: Enable full autonomy for routine tasks; safety policies automatically intercept destructive commands.
- ๐ก๏ธ Enterprise Prompt Injection Shield: Multi-layer defense against role hijacking, jailbreaks, delimiter evasion, and malicious prompt injections.
- ๐ Extensible Channels & Engines: Built-in Telegram and Console channels, a dedicated OpenCode adapter, and generic CLI wrappers for Claude Code, Aider, and Shell. Configure additional CLI engines or load your own local channel/engine plugin without rebuilding the bridge. Slack, Discord, and Webhooks require an additional adapter.
- ๐ Multi-Machine & Server Ops: Run operations, SSH jump-host connections, deploy scripts (
pinpoint-go), and remote log diagnostics directly from your phone. - โก Zero npm Runtime Dependencies: Uses Node.js built-ins. Your selected coding engine must be installed or available separately.
flowchart LR
User["๐ฑ Telegram / Console / Webhook"] -->|IChannelAdapter| ControlRoom["โก AgentGram Control Room"]
ControlRoom -->|IAgentEngine| Engine["๐ค OpenCode / Claude Code / Shell"]
Engine -->|Configured Execution| Project["๐ Project Files & Git"]
ControlRoom -->|Authorized Ops / SSH| Remote["๐ฅ๏ธ Remote VPS / Server"]
OpenCode events with a session ID are isolated to the active engine session before text, tool output, permissions or completion can affect its run. The control room also rejects events explicitly addressed to another run session; engines without session IDs retain their existing behavior.
ุฃุญุฏุงุซ OpenCode ุงูุชู ุชุญู ู ู ุนุฑูู ุฌูุณุฉ ุชุจูู ู ุนุฒููุฉ ุนู ุงูุฌูุณุงุช ุงูุฃุฎุฑูุ ุจู ุง ูููุง ุงูุฑุฏูุฏ ูุงูุฃุฏูุงุช ูุทูุจุงุช ุงูุฅุฐู ูุฅุชู ุงู ุงูู ูู ุฉ.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โก AgentGram ยท Live Mission Control โ
โ โ
โ Agent: ๐ง build (OpenCode) | Mode: ๐ build โ
โ Channel: ๐ก Telegram Bot โ
โ Status: ๐ข Executing bash (npm test) โ
โ Step: 4/12 ยท โณ 14s ยท ๐ 3 files modified โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ > PASS tests/auth.test.js โ
โ > PASS tests/api.test.js โ
โ > All 14 tests passing โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ [ โน Stop ] [ ๐ค Diff ] [ ๐ Mode ] โ
โ [ ๐ Projects ] [ ๐ Language ] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Run immediately in any repository without installing globally:
# Launch interactive pairing wizard (takes 30 seconds)
npx agentgram init
# Start the live control room
npx agentgram start
# Or run in background as a detached daemon
npx agentgram start --daemonInstall globally across your development machine or VPS:
npm install -g agentgram
# Initialize pairing in any repo
agentgram init
# Start control room
agentgram startWant AgentGram to run 24/7 on your machine or cloud VPS?
# On macOS (installs to ~/Library/LaunchAgents/com.agentgram.plist)
# On Linux (installs to ~/.config/systemd/user/agentgram.service)
npx agentgram service install
# Check service status
npx agentgram service statusRun 24/7 on any cloud server or VPS:
git clone https://github.com/rumuze/agentgram.git && cd agentgram
TG_BOT_TOKEN="your_bot_token" TG_ALLOWED_CHAT_ID="your_chat_id" docker compose up -dOnce connected, your Telegram chat becomes your project mission control:
| Command / Control | Description |
|---|---|
| Live Status Card | Edits automatically every ~2.5s showing active tools, steps, and output tails |
| Interactive Approvals | Commands requiring approval render inline buttons: [ โ
Allow Once ], [ โพ๏ธ Always Allow ], [ โ Reject ] |
| Interactive Questions | Agent questions appear as clickable buttons (single-choice, multi-select, or custom text) |
| Fast Interrupt | Type stop, ููู, or ุฅููุงู at any time to immediately cancel execution |
| Presence Check | Ask ูู ุงูุช ุดุบุงูุ, ุงูุญุงูุฉ, or status to get an instant live status report |
| Instant Mentions | Mention @agent or @model in any message to dynamically switch personas |
/mode |
Switch execution mode: read (read-only diagnosis), build (interactive approval), or auto (autonomous execution) |
/agents |
Switch active agent persona on the fly (e.g. build, delegate, code-review) |
/models |
Switch LLM provider and model dynamically |
/diff |
Get a condensed git diff summary of unstaged and staged changes |
/usage |
View token usage, quota renewal countdowns, and rate limits |
/stop |
Immediately interrupt and terminate the running agent process |
/lang |
Toggle between English and Arabic UI |
The following support levels describe the adapters included in this package:
| Integration | Included support |
|---|---|
| Telegram / Console | Built-in channel adapters |
| OpenCode | Dedicated engine adapter |
| Claude Code / Aider / Shell | Generic CLI execution, output, and cancellation; not full OpenCode event/permission parity |
| Additional CLI tools | Configurable executable and argument templates |
| Additional channels / engines | Trusted local JavaScript plugin implementing the exported adapter contracts |
| Slack / Discord / Webhooks | No bundled adapter; supply your own plugin |
Add an engine profile to your project's .agentgram.json:
{
"channel": "console",
"engine": "my-agent",
"cliEngines": {
"my-agent": {
"command": "my-agent-cli",
"args": ["--quiet"],
"promptArgs": ["run", "--prompt", "{prompt}"]
}
}
}Replace my-agent-cli and its arguments with your installed tool's actual executable and non-interactive options. {prompt} is replaced inside each argument and passed directly to the executable without shell interpolation. Profiles can also customize the built-in CLI wrappers; opencode remains reserved for the dedicated adapter. Choose another profile with agentgram start --engine my-agent.
Create bridge-plugin.mjs in your project. This minimal working example registers a named Console channel:
export function register({ channels, engines, config }) {
channels.register('team-console', cfg => channels.get('console', cfg));
// Register your own IChannelAdapter or IAgentEngine factory here.
// Factories receive the resolved config, including config.extra.
}Then add "plugins": ["./bridge-plugin.mjs"] and "channel": "team-console" to .agentgram.json. Plugins are loaded before adapters are resolved. Paths are relative to the project directory; .js, .mjs, and .cjs files are supported. A plugin exports register(context) (which may be async), or a default object with that method. The package exports BridgePluginContext, IChannelAdapter, and IAgentEngine for typed plugin authors.
These plugins execute local code with the bridge's privileges: only enable plugins and project configuration you trust. They are not sandboxed. The bridge does not download or install plugins. A missing or invalid plugin stops startup rather than silently falling back.
Global CLI profiles are merged with project profiles by name, with project settings taking precedence. A project's plugins list replaces the global list. extra settings merge at the top level and survive save/reload. The default Telegram/OpenCode setup requires no extension configuration.
Run agentgram integrations --dir /path/to/project (or add --json) to list built-in adapters, configured CLI profiles, plugin registrations, and the selected channel/engine. This command loads the configured trusted plugins but does not start a channel or engine and does not require Telegram pairing. Registration does not prove that a CLI executable is installed or a service is reachable.
The bridge includes application-level policy checks. These are not an operating-system sandbox or a guarantee against prompt injection:
- ๐ก๏ธ Advanced Prompt Injection Defense:
- Role Hijacking & Jailbreak Defense: Detects and blocks imperative prompt overrides ("ignore previous instructions", "disregard prior directives", "DAN mode", "system override:", and Arabic variants "ุชุฌุงูู ุงูุชุนููู ุงุช ุงูุณุงุจูุฉ", "ุฃูุช ุงูุขู ูู ูุถุน ุงูู ุทูุฑ").
- System Boundary Isolation: Blocks delimiter evasion and token spoofing (
</untrusted-report>,<system>,<|im_start|>,[INST] <<SYS>>). - Unicode & Obfuscation Stripping: Normalizes Unicode (NFKC) and strips zero-width/invisible evasion characters (
\u200B,\u200C,\uFEFF,\u2060) and BiDi overrides (\u202E). Recursively inspects base64 payloads. - Data Exfiltration Defense: Blocks markdown image (
) and HTML link exfiltration vectors.
- ๐ Cryptographic Quarantine Envelopes:
- External error logs, server alerts, and untrusted inputs are wrapped inside isolated blocks (
<untrusted-report id="...">) signed with cryptographically random nonces (secrets.token_hex(8)).
- External error logs, server alerts, and untrusted inputs are wrapped inside isolated blocks (
- ๐ซ Execution Blocklist:
- Irreversible destructive host wiping is blocked by default (
rm -rf /,rm -rf ~,mkfs,shutdown,dd if=).
- Irreversible destructive host wiping is blocked by default (
- ๐ค Single Chat ID Lock: Every message and inline callback query validates
chat.id == ALLOWED_CHAT_ID. Unknown users are ignored. - ๐ Loopback & Token Isolation: OpenCode server runs strictly on
127.0.0.1with a per-session randomized high-entropy password; bot token is saved with strict0600file permissions.
agentgram <command> [options]
npx agentgram <command> [options]
COMMANDS:
init Interactive setup wizard & automatic Telegram pairing
start Start the control room for the current project
stop Stop running background daemon
status Display current daemon, server, and workspace status
integrations List built-in adapters, profiles, and plugin registrations
service install Install as persistent background service (macOS launchd / Linux systemd)
service uninstall Remove persistent background service
service status Check persistent background service status
help Display help message
OPTIONS:
--dir <path> Set target project directory (defaults to current working directory)
--daemon, -d Run in background as a detached process
--channel <name> Communication channel: telegram (default), console
--engine <name> AI coding engine: opencode (default), shell, claude, aider
--version, -v Show version number
Contributions are welcome! Please read our Contributing Guide and Code of Conduct.
Distributed under the MIT License. See LICENSE for more details.
Developed with โค๏ธ by Rumuze.