February 21, 20267 min read

Solon: A Zero-Dependency Gemini Telegram Bridge

162 lines of Node.js. No npm packages. Full streaming. Remote control of a local Gemini CLI session from your phone, anywhere in the world.


Solon — Gemini Telegram Bridge

>_The Problem

Google's Gemini CLI is powerful. It runs locally, it has tool execution, it maintains session context, and it can operate in YOLO mode where it executes tools without asking permission. The catch: you have to be sitting at the terminal where it's running.

That's fine when you're at your desk. It's not fine when you're on the train, at dinner, or three rooms away from your workstation and need to ask your agent a question. The capability exists on the machine. The interface is locked to the machine.

We needed a bridge. Not a web app. Not a cloud service. A wire between Telegram and the local Gemini process. Something that could be running in a tmux session and forgotten about until you need it.


>_The Name

Solon was an ancient Athenian lawgiver. One of the Seven Sages of Greece. Known for practical wisdom, measured reform, and writing laws simple enough that anyone could follow them.

The bot got the name because it does one thing, does it well, and doesn't try to be something it isn't. Within the Greyforge Council tradition of naming agents after figures who represent their function, Solon is the quiet messenger: no ambition beyond reliable delivery.


>_Architecture: 162 Lines, Zero Dependencies

The entire bot is a single file. No package.json. No node_modules. Node.js 20+ provides everything needed: fetch for the Telegram API, spawn for Gemini CLI, fs.promises for file handling. Nothing else.

01
Long-poll Telegram for updates. 30-second timeout, reconnect on failure. No webhooks, no public endpoint, no exposed ports.
02
Queue inbound messages. Sequential processing prevents session locking. If you send three messages while Solon is thinking, they execute in order.
03
Spawn gemini --prompt with session resume. Each message resumes the same session ID. Full context persistence across every interaction.
04
Parse streaming JSON events. Gemini's stream-json output format provides real-time events: assistant messages, tool invocations, completions.
05
Debounced live updates to Telegram. Edit the status message at most once per 1.2 seconds. Shows a typing cursor (█) during streaming. Respects Telegram rate limits.

When the Gemini process exits, the status message is deleted and the full response is delivered in clean chunks (4000 character max per Telegram message). If the process fails, you get an error code. If it produces no output, you get a checkmark. No ambiguity.


>_What It Actually Does

Real-Time Streaming

Watch Solon compose the response live on your phone. The message updates in real-time with a typing cursor, then resolves to the final output. You see the thinking happen.

Tool Execution (YOLO Mode)

Gemini CLI can write files, run shell commands, and execute tools. In YOLO mode, Solon approves everything automatically. You tell it to refactor a file from your phone, and it does. No confirmation dialogs.

File Uploads

Send any document to the bot. It downloads the file and saves it directly to your workspace directory. Then the next message to Gemini can reference that file by name.

Session Persistence

Every message resumes the same Gemini session. Context carries forward. Ask a question at 9 AM and reference the answer at 9 PM. The session remembers.

Admin Commands

/logs shows the last 20 lines of the bridge log. Useful for debugging without SSH-ing into the machine.


>_Setup in 60 Seconds

No build step. No dependency install. Clone, configure, run.

terminal
git clone https://github.com/GreyforgeLabs/geminibot.git
cd geminibot
cp .env.example .env
# Edit .env with your Telegram token + user ID
node bot.mjs

For persistent operation, wrap it in tmux:

terminal
tmux new-session -d -s solon "node bot.mjs"

That's it. The bot is now running. Open Telegram, send it a message, and your local Gemini session answers.


>_Why Open Source

Not everything we build is proprietary. ForgeClaw is closed because it represents hundreds of hours of routing logic, council orchestration, and domain-specific intelligence that would be immediately commoditized if published. That decision stands.

Solon is different. It's a utility. A wire between two endpoints. There is no secret sauce in bridging Telegram to a CLI process. The value is in the execution: clean, minimal, reliable. Publishing it costs us nothing and helps anyone who has the same problem we had.

Solon is the first project under OpenForge, our open-source initiative. Not every tool needs to be proprietary. Some tools just need to work.

Open source. Free. Self-hosted.

No cloud dependency, no API keys beyond your own Telegram bot token, no data leaving your machine except through Telegram's API. Your Gemini session, your hardware, your control.

github.com/GreyforgeLabs/geminibot →

>_What's Next for Solon

The v5 streaming architecture is stable. The roadmap is short and deliberate:

  • Image handling — send screenshots to Gemini for visual analysis
  • Voice note transcription — speak into Telegram, Gemini processes the text
  • Multi-session support — switch between Gemini sessions from the chat
  • Markdown rendering — clean formatting for code blocks and structured output

PRs welcome. The codebase is small enough to read in five minutes and contribute to in ten.