coms is a small Go CLI that lets coding agents ask you questions over Telegram and continue work once you reply.
It is designed for away-from-keyboard workflows in Codex/OpenCode/Cursor where the agent can:
- send a concise decision request,
- wait or poll for your response,
- correlate the reply automatically to the latest pending message.
For AI-driven onboarding, see ai_install_guide.md for a step-by-step install-wizard playbook.
- Linux
- macOS
- Windows (PowerShell or cmd.exe)
- Command name stays
coms(the Windows binary file iscoms.exe)
comsCLI (cmd/coms)- Telegram API client (
internal/telegram) - Local offset/pending state (
internal/state) - Shared agent skill package (
skills/telegram-away)
- Go 1.22+
- A Telegram account
- A Telegram bot token in
COMS_TELEGRAM_BOT_TOKEN - A private Telegram DM with your bot
- In Telegram, open BotFather and run
/newbot. - Save the bot token BotFather gives you.
- Open a private DM with your new bot (
https://t.me/<your_bot_username>). - Send at least one message to the bot (for example:
hello). - Keep this workflow in a private DM, not a group chat.
If coms init-chat says chat_not_found:
- confirm you sent a DM to the same bot token,
- send one more message to the bot,
- run
init-chatagain.
- Set bot token environment variable.
Linux/macOS (bash/zsh):
export COMS_TELEGRAM_BOT_TOKEN="<token>"Windows PowerShell:
$env:COMS_TELEGRAM_BOT_TOKEN = "<token>"Windows cmd.exe:
set COMS_TELEGRAM_BOT_TOKEN=<token>Optional persistence across new shells:
- PowerShell or cmd.exe:
setx COMS_TELEGRAM_BOT_TOKEN "<token>"
- Build the CLI from this repo.
Linux/macOS:
go build -o ./bin/coms ./cmd/comsWindows PowerShell or cmd.exe:
go build -o .\bin\coms.exe .\cmd\coms- Initialize chat routing (detects and stores your
chat_id).
Linux/macOS:
./bin/coms init-chatWindows:
.\bin\coms.exe init-chat- Send and receive one test message.
Linux/macOS:
./bin/coms send --message "Test from coms"
./bin/coms wait --timeout-sec 120Windows:
.\bin\coms.exe send --message "Test from coms"
.\bin\coms.exe wait --timeout-sec 120After pulling new changes, rebuild coms and refresh your local skill copy.
Linux/macOS:
go build -o ~/.local/bin/coms ./cmd/coms
cp -R skills/telegram-away ~/.config/opencode/skills/
cp -R skills/telegram-away ~/.codex/skills/Windows (PowerShell):
go build -o "$HOME\\go\\bin\\coms.exe" .\cmd\coms
Copy-Item -Recurse -Force "skills\\telegram-away" "$HOME\\.config\\opencode\\skills\\"
Copy-Item -Recurse -Force "skills\\telegram-away" "$HOME\\.codex\\skills\\"You can also install directly with:
go install github.com/tomrplummer/agent-coms/cmd/coms@latestThen ensure your Go bin directory is on PATH.
- Linux/macOS default:
~/go/bin/coms - Windows default:
%USERPROFILE%\go\bin\coms.exe
Defaults written by init-chat:
| OS | Config path | State path |
|---|---|---|
| Linux/macOS | ~/.config/coms/config.toml |
~/.local/state/coms/state.json |
| Windows | %USERPROFILE%\\.config\\coms\\config.toml |
%USERPROFILE%\\.local\\state\\coms\\state.json |
Required:
COMS_TELEGRAM_BOT_TOKEN- bot token from BotFather
Optional (path overrides, all platforms):
XDG_CONFIG_HOME- controls where config defaults are resolvedXDG_STATE_HOME- controls where state defaults are resolved
You can copy .env.example as a reference for local env setup.
Send a question:
coms send --message "Need your decision on deploy window"Wait for a reply (uses pending request automatically):
coms wait --timeout-sec 900Poll once (non-blocking):
coms pollManual offset advance:
coms ack --update-id 123456- Preferred: reply directly to the Telegram message from the bot.
- You do not need to include a request ID in your reply.
sendstores one pending request in local state (new sends replace old pending).- Successful
wait/pollclears the matched pending request. waittimeout does not clear pending, so a late reply can still match later.
Skill source in this repo:
skills/telegram-away/SKILL.mdskills/telegram-away/agents/openai.yaml
Linux/macOS:
mkdir -p ~/.config/opencode/skills
cp -R skills/telegram-away ~/.config/opencode/skills/Windows (PowerShell):
New-Item -ItemType Directory -Force "$HOME\\.config\\opencode\\skills" | Out-Null
Copy-Item -Recurse -Force "skills\\telegram-away" "$HOME\\.config\\opencode\\skills\\"Restart OpenCode sessions after updating skills.
Linux/macOS:
mkdir -p ~/.codex/skills
cp -R skills/telegram-away ~/.codex/skills/Windows (PowerShell):
New-Item -ItemType Directory -Force "$HOME\\.codex\\skills" | Out-Null
Copy-Item -Recurse -Force "skills\\telegram-away" "$HOME\\.codex\\skills\\"Restart Codex sessions after updating skills.
Install as a personal or project skill.
Personal skill (available everywhere) - Linux/macOS:
mkdir -p ~/.cursor/skills
cp -R skills/telegram-away ~/.cursor/skills/Personal skill (available everywhere) - Windows (PowerShell):
New-Item -ItemType Directory -Force "$HOME\\.cursor\\skills" | Out-Null
Copy-Item -Recurse -Force "skills\\telegram-away" "$HOME\\.cursor\\skills\\"Project skill (checked into repo for teammates) - Linux/macOS:
mkdir -p .cursor/skills
cp -R skills/telegram-away .cursor/skills/Project skill (checked into repo for teammates) - Windows (PowerShell):
New-Item -ItemType Directory -Force ".cursor\\skills" | Out-Null
Copy-Item -Recurse -Force "skills\\telegram-away" ".cursor\\skills\\"Restart Cursor chats after updating skills.
0success2timeout (waitonly)3config/auth/input error4Telegram API or transport error
- Keep
COMS_TELEGRAM_BOT_TOKENsecret. comsmatches messages only for configuredchat_id.- Avoid group chats for this workflow unless you want shared participants to potentially satisfy replies.