Context Lab

Hermes as a personal Telegram assistant

Guide · AI Practice · Education · Lock down allowlists before you share the bot

Prerequisite: CLI chat already works. Gateway on a broken provider just moves the failure into Telegram.

Risk in one line: the bot can see what you allow and may run tools on the host that runs the gateway. Use allowlists, keep tokens out of git, and start with DM-only to yourself.

CLI Chat First

Do not wire Telegram until hermes doctor and a second-turn CLI chat already work. Fix the provider first.

Bot + User ID

Create a bot with @BotFather, store the token like a password, and fetch your numeric Telegram user ID—not the @username.

Run Gateway Setup

Prefer hermes gateway setup, or write Telegram vars into ~/.hermes/.env by hand.

Allowlist and Secrets

Set TELEGRAM_ALLOWED_USERS. Without an allowlist Hermes refuses everyone. Never commit the bot token.

Smoke-Test, Then Service

Run hermes gateway, DM yourself once, then consider gateway install for reboot persistence.

    Topic summary · original diagrams · no autoplay

    1) Create a bot + find your user ID

    1. In Telegram, open @BotFather → /newbot → save the token (treat it like a password).
    2. Message @userinfobot (or similar) to get your numeric user ID — not your @username.

    Desktop / dashboard QR flows exist on newer Hermes builds; this page sticks to the classic BotFather path so it stays reproducible.

    2) Configure the gateway

    Interactive (preferred):

    hermes gateway setup

    Select Telegram, paste the bot token and allowed user IDs.

    Manual: add to ~/.hermes/.env (example shape only — use your values):

    TELEGRAM_BOT_TOKEN=123456789:AA...your_token...
    TELEGRAM_ALLOWED_USERS=123456789

    Without an allowlist, Hermes denies users by default (safe). Never paste real tokens into docs, tickets, or this site.

    3) Smoke-test, then optionally install a service

    hermes gateway
    # In Telegram: DM your bot one short question
    hermes gateway status

    When DMs work and you want survival across reboot:

    hermes gateway install    # user service (Linux systemd / macOS launchd)
    hermes gateway start
    hermes gateway status

    Laptop sleep still pauses a local gateway. Always-on assistants usually need a small VPS or a machine that stays awake — see official messaging docs for linger / system service flags.

    Personal-assistant hygiene

    Out of scope

    Sources