BETTER-TG-CLI.

Log in to Better-TG-CLI

A login key lets you log in to your Telegram account through the CLI without creating your own API keys on my.telegram.org. Confirm your email with a code: one email, one login key, good for logging in on up to 3 computers; asking again replaces it. Your messages and session stay on your computer only. Already have your own keys? Skip to installation.

Only for notices: important updates and revoked keys. Never shared, no newsletters.

How to install

  1. Paste the prompt into your agent

    Claude Code, Codex, Cursor or any other agent with a terminal. It installs the CLI and the skill and opens the login page.

    Connect my Telegram through Better-TG-CLI (https://github.com/TheVilfer/better-tg-cli):
    1. Install the CLI: `brew install thevilfer/tap/better-tg-cli`. Without Homebrew: `npm install -g better-tg-cli` (needs Node 20+). On Windows: `scoop bucket add thevilfer https://github.com/TheVilfer/scoop-bucket` and `scoop install better-tg-cli`.
    2. Run `telegram onboard --json` (in the background if your timeout is shorter than 15 minutes). A page opens where I get a login key, scan a QR code and enter my password myself. Wait for the `done` event. Don’t ask me for codes, passwords or the login key, and don’t fill in the page yourself.
    3. Install the skill for yourself: `telegram skill install`.
    4. Check the login with `telegram whoami` and briefly tell me what you can now do in Telegram.
  2. Go through the login page

    The agent opens it in the browser on your computer. There you get a login key (your email is confirmed with a code and the key comes back by itself), scan the QR code in Telegram (Settings → Devices → Link Desktop Device) and enter your cloud password if you have one. The agent sees none of it.

  3. Done

    Ask your agent, for example: “what’s unread in my Telegram?” It can write on your behalf only after you allow it: telegram write-access on --for 1h.

    Claude Desktop has no terminal, so it can’t do this. Use PRO mode for it.