Connect your agent

Set up Codex, Cursor, Claude Code, Gemini CLI or Hermes to work with Telegram and MAX.

The Windows installer already installs the skill before login. Read tg skill show or max skill show and verify that your agent loaded it. The commands below refresh a skill or install it separately after another installation method.

CLI is the installed terminal program (tg or max). An agent is the AI assistant you use, for example in an editor or terminal. A skill is an instruction file the agent reads to learn the CLI; it does not store your Telegram/MAX login. PATH is the list of folders where your computer looks for commands: if tg --version or max --version works in the agent’s terminal, it can find the installed CLI.

First install the CLI and log in. Your local agent can call tg or max in its terminal. A skill teaches it the commands, output formats and workflows; it does not replace installation or login. MCP is another way to expose tools to the agent.

Choose your agent

Run the command for the messenger you installed. If you use both, run both commands.

AgentTelegramMAXSkill location
Codextg skill install --for agentsmax skill install --for agents~/.agents/skills/<tool>-cli/SKILL.md
Cursor Agenttg skill install --for agentsmax skill install --for agents~/.agents/skills/<tool>-cli/SKILL.md
Claude Codetg skill install --for claudemax skill install --for claude~/.claude/skills/<tool>-cli/SKILL.md
Gemini CLItg skill install --for agentsmax skill install --for agents~/.agents/skills/<tool>-cli/SKILL.md
HermesSave tg skill show as described belowSave max skill show as described below~/.hermes/skills/<tool>-cli/SKILL.md

<tool>-cli is tg-cli or max-cli. ~ means your home directory, including on Windows. skill install without --for installs into both .claude/skills and .agents/skills.

Codex

Use Codex locally in the CLI or IDE. It discovers user skills in ~/.agents/skills. Select $tg-cli or $max-cli in a conversation; restart Codex if a newly installed skill is missing. The CLI must be on the agent's PATH. Official Codex skills guide.

Cursor

Use Agent with terminal access. Cursor reads the shared ~/.agents/skills directory; find tg-cli or max-cli through / in Agent chat. Restart Cursor if it has not picked up the new skill. You can also connect MCP. Official Cursor skills guide.

Claude Code

Run /tg-cli or /max-cli in your local Claude Code session. User skills live in ~/.claude/skills. MCP is optional when the terminal already works. Official Claude Code skills guide.

Gemini CLI

Run gemini skills list to check that tg-cli or max-cli is available. In a running session, use /skills reload to refresh discovery. Gemini supports ~/.agents/skills as a shared skill directory. Official Gemini skills guide.

Hermes

Hermes has its own skill directory. Ask it to create ~/.hermes/skills/tg-cli/SKILL.md from the exact output of tg skill show, or ~/.hermes/skills/max-cli/SKILL.md from max skill show. Keep the frontmatter and UTF-8 text. On macOS or Linux, for Telegram:

mkdir -p ~/.hermes/skills/tg-cli
tg skill show > ~/.hermes/skills/tg-cli/SKILL.md

For MAX, use max-cli in the path and max skill show. Start a new Hermes session and invoke /tg-cli or /max-cli. The terminal environment must have the CLI and the same account session. Official Hermes skills guide.

Check the connection

Ask the agent: “Use tg-cli / max-cli to check my account and list five chats. Then summarise my unread messages by chat and say who needs an answer. Read only for this task.”

It should be able to run account show, chats list --limit 5 and inbox --limit 5, or the equivalent MCP tools. If it cannot find the CLI, reopen the editor after installing Node/npm; see Windows and PATH. If it reports no session, log in in the same environment and profile the agent uses.

The CLI already offers the skill

When AI_AGENT or CLAUDECODE is set, both CLIs suggest skill install if the installed skill is missing or older than the CLI. The reminder goes to stderr, at most once per day; JSON stdout stays usable. After upgrading the CLI, rerun the install command above. For Hermes, refresh the file from skill show.

Other clients

For Claude Desktop, use MCP. For an agent without skill support, give it the Markdown docs. For a cloud agent, install and log in in its execution environment; your local session is not available there automatically.

Continue with first tasks: find a past decision, prepare for a meeting and draft a reply. Writing requests provides copyable examples and useful constraints.

On this page