Konek is a Telegram bot daemon that connects your phone to Herdr and local AI coding agents such as OMP, Claude Code, Codex, and Pi. It requires no port forwarding, public IP, or VPN because it communicates via outbound HTTPS long polling.
- Two-way communication over the Telegram Bot API. The bot runs on your local machine and polls Telegram servers directly. No inbound ports are opened on your local network.
- Direct Herdr socket connection. The bot watches agent lifecycle states (
idle,working,blocked,done) and routes commands to the target pane. - Approval handling. When an agent pauses at a confirmation dialog (e.g. bash execution or file editing), the bot provides interactive Approve, Reject, and Abort buttons in Telegram.
- Complete transcript extraction. For session-logging agents (such as OMP and Pi), the bot reads the full response from the session
.jsonlfile instead of truncating terminal scrollback. - Automatic message chunking. Responses exceeding Telegram's 4,096-character limit are split cleanly by paragraphs and sent sequentially.
- Parallel execution. Multiple agents can run concurrently. Each turn maintains an independent progress card with real-time spinners and status updates.
- ID-based whitelist authorization. The bot drops messages from unauthorized Telegram accounts. Only configured user IDs can execute commands.
- Go 1.22 or later
- Herdr installed and running (
herdr status) - At least one supported coding agent (OMP, Claude Code, Codex, or Pi)
- Open
@BotFatheron Telegram, send/newbot, and copy your bot token. - Open
@userinfoboton Telegram to find your numeric account ID (e.g.123456789).
Copy the sample configuration file:
cp .env.example .envEdit .env:
TELEGRAM_BOT_TOKEN="your_token_from_botfather"
TELEGRAM_ALLOWED_USER_IDS="123456789"
HERDR_BIN_PATH="/Users/user/.local/bin/herdr"
DEFAULT_CWD="/Users/user/Code/projects"To authorize multiple users, separate their IDs with commas in TELEGRAM_ALLOWED_USER_IDS.
go build -o konek .
./konekSend /start in Telegram to initialize the navigation keyboard.
- Plain text message. Forwards the text as an instruction prompt to the active agent.
@name <prompt>. Sends a prompt to a specific agent without switching your active target. The name can match a workspace label, project folder name, or pane ID (e.g.@keep-silent fix auth validationor@w5:p1 run test suite).- Photo or screenshot attachment. Downloads the image locally and invokes the multimodal agent with the image path. Add your prompt in the photo caption.
/jobs. Lists all running parallel tasks along with elapsed times and abort buttons./broadcast <prompt>. Dispatches the prompt to all currently running agents at once./agents. Opens an inline menu to inspect and select active coding agents./status. Displays active agent details (project name, harness, lifecycle state, working directory)./read [N]. Without arguments, reads the complete latest response from the transcript. With an integer argument (e.g./read 50), reads N lines from the active terminal scrollback./abort. Cancels only the active turn using Escape, keeping the agent process alive at the prompt./stopor/ctrlc. Sends Ctrl+C (SIGINT) to the terminal pane to interrupt running shell processes or exit./keys <key>. Sends specific control keys to the agent terminal (e.g./keys enter,/keys esc,/keys y,/keys n).
/workspaces. Shows an interactive keyboard of all Herdr workspaces. Selecting a workspace lists its terminal panes./newworkspace <name> [folder]. Creates a new workspace in Herdr. If the folder path is omitted, the directory defaults toDEFAULT_CWD/<name>. The bot prompts to launch OMP, Claude Code, Codex, or Pi inside the new pane./split [right|down]. Splits the active terminal pane horizontally or vertically, then offers an agent launcher menu./sh <command>. Runs a shell command on the host in the active project directory (e.g./sh git status,/sh git diff)./img <path>. Uploads an image from the host machine directly to your Telegram chat (e.g./img screenshot.pngor an absolute path)./menu. Reopens the persistent bottom navigation keyboard if closed.
To run Konek automatically on login:
# Copy plist configuration to LaunchAgents
cp dev.konek.bot.plist ~/Library/LaunchAgents/
# Load and start the service
launchctl load ~/Library/LaunchAgents/dev.konek.bot.plistTo check status:
launchctl list | grep dev.konek.botTo stop the service:
launchctl unload ~/Library/LaunchAgents/dev.konek.bot.plistTo run Konek as a persistent user service:
# Ensure user systemd directory exists
mkdir -p ~/.config/systemd/user
# Copy the unit file
cp konek.service ~/.config/systemd/user/
# Reload daemon and start service
systemctl --user daemon-reload
systemctl --user enable --now konek.serviceTo keep the service running even after logout:
loginctl enable-linger $USERTo check logs:
journalctl --user -u konek.service -fTo stop or restart:
systemctl --user stop konek.service
systemctl --user restart konek.serviceYou can register start-konek.vbs to run silently on login without an open command prompt:
schtasks /create /tn "KonekBot" /tr "wscript.exe \"C:\path\to\konek\start-konek.vbs\"" /sc onlogonTo delete the scheduled task:
schtasks /delete /tn "KonekBot" /fInstall and supervise konek.exe as a native Windows service using NSSM:
nssm install Konek "C:\path\to\konek\konek.exe"
nssm set Konek AppDirectory "C:\path\to\konek"
nssm start KonekIf running inside WSL2, enable systemd in /etc/wsl.conf and use the Linux systemd setup above.
Logs are written to the project directory:
konek.logfor standard outputkonek.error.logfor standard error