Explains the Gmail Commander Telegram bot: slash commands, inline keyboards, compose/reply flow, and AI free-text routing via buildBot(). Covers deployment, preflight checks, and safety controls.
Ships in gmail-commander. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Gmail Commander Telegram bot — slash commands for email access + AI-powered free-text routing. This skill explains what the bot does and where its code lives; operating the running bot is covered by bot-process-control.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
The bot runs in a private Restate tenant on an always-on Mac mini. The tenant imports buildBot() from scripts/bot.ts, owns its own durable Telegram getUpdates chain, and feeds each update into the returned grammY bot through bot.handleUpdate(). There is no workstation daemon; the laptop launchd job was retired on 2026-09-24.
Do not start scripts/bot.ts directly with the production bot token to "test" it. Telegram allows one getUpdates consumer per token, so a second poller breaks the deployed bot with 409 Conflict. Test against a separate bot token, or exercise the code by importing buildBot().
buildBotPLUGIN="$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gmail-commander"
ls -la "$PLUGIN/scripts/bot.ts" 2>/dev/null || echo "SCRIPT_NOT_FOUND"
grep -n "export async function buildBot" "$PLUGIN/scripts/bot.ts" || echo "buildBot EXPORT MISSING — the deployment depends on it"
| Command | Description |
|---|---|
| /inbox | Show recent inbox emails |
| /search | Search emails (Gmail query syntax) |
| /read | Read email by ID |
| /compose | Compose a new email |
| /reply | Reply to an email |
| /abort | Cancel current compose/reply action |
| /drafts | List draft emails |
| /digest | Triage the last N hours now (default 6) |
| /status | Bot status and stats |
| /help | Show all commands |
Tier 1 — Deterministic: Slash commands call the Gmail CLI directly (through scripts/lib/gmail-client.ts, which runs the binary named by GMAIL_CLI_BIN).
Tier 2 — Intelligent: Free-text messages route through the Agent SDK (HAIKU_MODEL) with 4 Gmail MCP tools (list, search, read, draft).
AGENT_TIMEOUT_MS per query (2-minute default)TELEGRAM_CHAT_ID| Concern | File |
|---|---|
| Wiring, compose/reply session flow | scripts/bot.ts (buildBot()) |
| Command list and handlers | scripts/lib/commands.ts |
| Inline-keyboard callbacks, session store | scripts/lib/callbacks.ts |
| Free-text routing, MCP tools | scripts/lib/agent-router.ts |
| Email rendering, HTML escaping | scripts/lib/telegram-format.ts |
| Message chunking (4096-char limit) | scripts/lib/telegram-chunk.ts |
buildBot() still starts no transport and takes no PID lock on importAfter this skill completes, reflect before closing the task:
Do NOT defer. The next invocation inherits whatever you leave behind.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/gmail-commander:interactive-botfrom gmail-commander
npx claudepluginhub terrylica/cc-skills --plugin gmail-commander7 skills in this plugin
/bot-process-controlGmail Commander bot and digest process control - they run unattended in a private Restate deployment, never as workstation launchd jobs. Where they run, how to check them, what not to start locally. TRIGGERS - bot start, bot stop, bot restart, bot status, gmail bot down/email-triageGmail Commander email triage - the three-category Haiku prompt and parser in lib/triage.ts, run on demand by the bot's /digest command. The scheduled digest runs in a private deployment with its own implementation. TRIGGERS - email digest, triage emails, digest categories/gmail-accessAccess Gmail via CLI with 1Password OAuth: read, search and export email, and create drafts. Replies quote the sender verbatim as styled blockquotes and can carry file attachments, built and verified in one command. TRIGGERS - gmail, read email, search inbox, export emails, create draft, compose email, reply to email, draft a reply, quote their words, quoted reply, attach a file to a draft.Other plugins' skills for the same job