# Connect your agent (/en/docs/agents) The Windows installer already installs the skill before login. Read `tg skill show`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-show "Command reference: tg skill show") or `max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: 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](/llms.mdx/docs/installation/content.md). 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](/llms.mdx/docs/mcp/content.md) is another way to expose tools to the agent. ## Choose your agent [#choose-your-agent] Run the command for the messenger you installed. If you use both, run both commands. | Agent | Telegram | MAX | Skill location | | ------------ | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | | Codex | `tg skill install --for agents`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-install "Command reference: tg skill install") | `max skill install --for agents`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install") | `~/.agents/skills/-cli/SKILL.md` | | Cursor Agent | `tg skill install --for agents`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-install "Command reference: tg skill install") | `max skill install --for agents`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install") | `~/.agents/skills/-cli/SKILL.md` | | Claude Code | `tg skill install --for claude`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-install "Command reference: tg skill install") | `max skill install --for claude`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install") | `~/.claude/skills/-cli/SKILL.md` | | Gemini CLI | `tg skill install --for agents`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-install "Command reference: tg skill install") | `max skill install --for agents`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install") | `~/.agents/skills/-cli/SKILL.md` | | Hermes | Save `tg skill show`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-show "Command reference: tg skill show") as described below | Save `max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show") as described below | `~/.hermes/skills/-cli/SKILL.md` | `-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 [#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](https://learn.chatgpt.com/docs/build-skills). ### Cursor [#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](/llms.mdx/docs/mcp/content.md#cursor-and-claude-desktop). [Official Cursor skills guide](https://cursor.com/help/customization/skills). ### Claude Code [#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](https://code.claude.com/docs/en/skills). ### Gemini CLI [#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](https://geminicli.com/docs/cli/skills/). ### Hermes [#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`[↗](/llms.mdx/docs/tg/commands/content.md#tg-skill-show "Command reference: tg skill show"), or `~/.hermes/skills/max-cli/SKILL.md` from `max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show"). Keep the frontmatter and UTF-8 text. On macOS or Linux, for Telegram: ```sh 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`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: 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](https://hermes-agent.nousresearch.com/docs/user-guide/features/skills/). ## Check the connection [#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](/llms.mdx/docs/installation/content.md#windows). If it reports no session, log in in the same environment and profile the agent uses. ## The CLI already offers the skill [#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 [#other-clients] For **Claude Desktop**, use [MCP](/llms.mdx/docs/mcp/content.md#cursor-and-claude-desktop). For an agent without skill support, give it [the Markdown docs](/llms.mdx/docs/mcp/content.md#documentation-for-your-agent). For a cloud agent, install and log in in its execution environment; your local session is not available there automatically. Continue with [first tasks](/llms.mdx/docs/first-tasks/content.md): find a past decision, prepare for a meeting and draft a reply. [Writing requests](/llms.mdx/docs/prompting/content.md) provides copyable examples and useful constraints. # Full Bot API (/en/docs/bot-api) **All Bot API methods are exposed through the CLI.** Use the complete native interface alongside convenient bot commands for messages, files and chat administration. Telegram covers all 185 methods in the pinned Bot API 10.3 schema; MAX covers all 33 operations in its official schema. Use Telegram CLI **0.25.0 or later** and MAX CLI **0.25.0 or later**. See [installation](/llms.mdx/docs/installation/content.md). ## Discover every method [#discover-every-method] ```sh tg sales bot api --help max sales bot api --help tg sales bot api get-me --json max sales bot api get-my-info --json ``` The first word is your bot profile. Each method's `--help` lists its native fields. Method names and parameters follow the provider's API, so they can differ between Telegram and MAX. ## Use native inputs and results [#use-native-inputs-and-results] Parameters are flags or JSON through `--body`, `--body-file` or stdin. The provider's native `timeout` is `--poll-timeout`; `--timeout` limits the whole command. Results retain the provider's native structure, and integers outside JavaScript's safe range are strings. Some methods need specific bot rights or platform capabilities. Writes use the profile's guard, recipient checks and journal. Keep credentials out of arguments: use stdin or a protected JSON file. Credential-returning methods require `--store-token ` and store the token only in the OS keyring, printing a receipt. ## CLI and MCP [#cli-and-mcp] The complete native API is a **CLI interface**. MCP provides separate tools for common tasks; it does not expose one tool per native API method. An agent with terminal access can use `tg bot api`[↗](/llms.mdx/docs/tg/commands/content.md#tg-bot "Command reference: tg bot") or `max bot api`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api "Command reference: max bot api") for operations beyond those tools. Details: [Telegram bot guide](https://github.com/leemour/tg-cli/blob/v0.25.0/docs/bot.md), [MAX bot guide](https://github.com/leemour/max-cli/blob/v0.25.0/docs/bot.md), [Telegram Bot API](https://core.telegram.org/bots/api), [MAX Bot API](https://dev.max.ru/docs-api). # First tasks (/en/docs/first-tasks) After [installation](/llms.mdx/docs/installation/content.md) and [connecting your agent](/llms.mdx/docs/agents/content.md), give it a task in ordinary language. Start with reading. Logging in connects the account; it does not download every chat's history. A search through older conversations may need a separate, bounded history fetch. ## Try a read-only task [#try-a-read-only-task] Copy this into your agent: > ```text prompt > Use tg cli to list five recent work chats and check my incoming messages for requests that need > an answer. Show the messages behind your conclusions and say which chats you checked. Read only: > don't send anything or mark anything read. > ``` The agent can start with: ```sh tg chats list --limit 5 tg inbox --limit 5 ``` Unread messages are a starting point, not proof that someone needs an answer. The agent should inspect context when necessary and tell you about skipped chats or truncated results. Ordinary reads do not mark messages read. [Reading and inbox](/llms.mdx/docs/tg/usage/content.md#reading) explains their limits. The examples below use **fictional chats, IDs, messages and results**. They illustrate possible dialogues, not commands you should run unchanged. Commands follow the Telegram v0.24 reference; your agent should check the installed CLI's skill and command help. MAX has its own [usage reference](/llms.mdx/docs/max/usage/content.md); do not assume every Telegram option has a MAX equivalent. ## Find a decision in older history [#find-a-decision-in-older-history] **You** > ```text prompt > In “Atlas · team”, find the analytics fee we agreed in September 2026. Show the estimate and the > confirmation. Check the local archive first; tell me if it lacks that period. Don't send anything. > ``` **The agent checks the chat and its archive** ```sh tg chats list --search Atlas --kind group tg store status -1001001001001 tg messages search 'analytics after:2026-09-01 before:2026-10-01' --chat -1001001001001 --json --language legacy ``` **Agent** > I found “Atlas · team”, but its local history only covers 28 September onward. The search found > no fee in those messages. That doesn't tell us whether a fee was agreed earlier in the month. > May I fetch this chat's history back to 1 September? **You** > ```text prompt > Yes, only that chat. Fetch back to 1 September. If more than 1,000 messages are needed, stop and > tell me what remains. > ``` **The agent fetches, checks coverage and verifies a match** ```sh tg store fetch -1001001001001 --since-time 2026-09-01 --limit 1000 tg store status -1001001001001 tg messages search 'analytics after:2026-09-01 before:2026-10-01' --chat -1001001001001 --json --language legacy tg messages context -1001001001001 4312 --before-n 2 --after-n 4 ``` **Agent** > **Agreed fee: €1,500 excluding VAT.** Marco proposed it on 5 September (message 4312); you > confirmed it on 6 September (message 4315). The surrounding discussion describes the analytics > setup, not ongoing support. The archive still has gaps, so I cannot rule out a later change > elsewhere in September. > > Sources: “Atlas · team”, messages 4312 and 4315. Nothing was sent. The fee is supported by the estimate and confirmation, but a partial archive cannot establish that it remained unchanged for the rest of the month. Another bounded fetch can resume later. A fetch from September also reads newer history on its way back, while the search filters narrow the result to September. **Why these commands:** `messages list` reads a window of messages and stores them locally; `store fetch` fills a larger stretch of history. `messages search` searches only what is stored. `messages context` checks what was said around a match. Neither the latest 20 messages nor an empty local search proves that a month has been checked. [Archive and search](/llms.mdx/docs/tg/archive/content.md). ## Prepare for a meeting [#prepare-for-a-meeting] **You** > ```text prompt > Prepare a 20-minute agenda for the Atlas call with Anna and Tom. Check the project and design > groups plus my direct chats with those participants over the past week. Separate decisions, > current risks and open questions. Cite sources; don't send anything. > ``` **The agent finds groups and participants, then reads the selected chats** ```sh tg chats list --search Atlas --kind group tg contacts list --search Anna tg contacts list --search Tom tg messages list -1001001001001 --after-time 7d --limit 100 tg messages list -1001001001002 --after-time 7d --limit 100 tg messages list 100200300 --after-time 7d --limit 100 tg messages list 100200301 --after-time 7d --limit 100 ``` **Agent** > **Decisions:** the launch is set for 9 October; the smaller analytics scope is approved. > > **Current risk:** the revised design has arrived, but nobody has confirmed acceptance yet. > Tom's direct message supersedes the older “waiting for the design” blocker in the group. > > **Agenda:** confirm scope (5 minutes), approve the revised design (10 minutes), assign owners > for launch checks (5 minutes). > > Sources: team messages 4501/4508, design message 732, Tom's direct message 188. > Checked the two groups and both direct chats for the past week; no sending or read marks. **You** > ```text prompt > Check whether Anna approved the revised design after Tom sent it. If not, add that as a question. > ``` **The agent reads the follow-up window** ```sh tg messages context -1001001001002 732 --before-n 2 --after-n 10 tg messages list 100200300 --after-time 2026-10-02T12:00:00+02:00 --limit 50 ``` **Agent** > Anna acknowledged receipt but did not explicitly approve it in the messages checked. Add: > **“Anna, can we approve the revised design, or are changes still needed?”** Keep approval open. > > Sources: design message 735 and Anna's direct message 204. No reply was sent. The sample time is the fictional design's delivery time. If a read window is truncated, the agent must follow the message cursor or report the missing part before claiming to have checked the whole week. It should ask about ambiguous participant names rather than choose a direct chat without evidence. [Message windows and cursors](/llms.mdx/docs/tg/usage/content.md#pages). ## Check promises and prepare replies [#check-promises-and-prepare-replies] **You** > ```text prompt > Check Atlas discussions from the past week for promises and questions involving me. Include > the team group and my direct chats with Anna and Tom. Separate what I owe from what I'm waiting > for, check for later completion, and draft replies. Don't send them. > ``` **The agent resolves the chats and reviews both sides of each conversation** ```sh tg chats list --search Atlas --kind group tg contacts list --search Anna tg contacts list --search Tom tg review --chat -1001001001001 --since-time 7d tg review --chat 100200300 --since-time 7d tg review --chat 100200301 --since-time 7d ``` **Agent** > **You owe Anna:** comments on the slides, promised for 2 October. I found no completion in the > checked messages. Sources: team message 4520, Anna's direct message 201. > > **Waiting for a decision:** Anna's approval of the revised design. Source: design discussion > quoted in Tom's direct message 188. > > **Completed:** Tom sent the design in his direct chat. His earlier promise is no longer open. > > Draft to Anna: “I've received the slides. I'll confirm a delivery time for my comments shortly.” > Nothing was sent; this covers only the three chats listed above. **You** > ```text prompt > Don't invent a delivery time. Check what I actually promised Anna and make the draft specific. > ``` **The agent checks the original promise and its replies** ```sh tg messages context -1001001001001 4520 --before-n 3 --after-n 6 tg messages context 100200300 201 --before-n 2 --after-n 5 ``` **Agent** > You promised comments on the pricing slides by Friday, 2 October. Draft: > **“I promised comments on the pricing slides by Friday and missed that deadline. I'll send you > an updated delivery time.”** This acknowledges the promise without making a new deadline up. > > Sources: team message 4520 and Anna's direct message 201. Still a draft. `review` supplies messages for the agent to interpret. Its unanswered-question filter is a heuristic, not a complete account of everyone's obligations. The agent should report incomplete review windows and check later messages before labelling an old promise outstanding. [Review and unanswered questions](/llms.mdx/docs/tg/usage/content.md#who-owes-what-review). ## Other useful requests [#other-useful-requests] | Task | What to specify | Next guide | | ------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------ | | Morning brief | Chats or channels, period, topics and what deserves attention | [Inbox](/llms.mdx/docs/tg/usage/content.md#what-needs-an-answer) | | Recommended contact | Service, country, currencies and comparison criteria | [Prompt examples](/llms.mdx/docs/prompting/content.md#find-a-recommended-contact) | | Project documents | Chats, file types, approved versions and whether downloading is allowed | [Files](/llms.mdx/docs/prompting/content.md#find-the-right-files) | | Reminders | Exact dates, times, timezone, recipients and message text | [Scheduling](/llms.mdx/docs/prompting/content.md#schedule-reminders) | | Voice message | The message or sender and whether you need a transcript or action list | [Voice messages](/llms.mdx/docs/tg/usage/content.md#voice-messages) | | Offline export | Chat, period, destination and no network access | [Offline work](/llms.mdx/docs/prompting/content.md#work-offline) | For prompts you can adapt, continue to [How to phrase requests](/llms.mdx/docs/prompting/content.md). For command syntax, use [Telegram commands](/llms.mdx/docs/tg/commands/content.md) or [MAX commands](/llms.mdx/docs/max/commands/content.md). # Getting started (/en/docs) WireCat brings your Telegram and MAX accounts to your terminal and AI agent. ## Start here [#start-here] 1. [Install and log in](/llms.mdx/docs/installation/content.md) — with Codex, Cursor, Claude Code, Gemini CLI, Hermes, or your terminal. 2. [Connect your agent](/llms.mdx/docs/agents/content.md) — teach it the commands, then ask it to summarise your inbox. 3. [Try your first tasks](/llms.mdx/docs/first-tasks/content.md) — search history, prepare for a meeting and draft replies. 4. [Write a request](/llms.mdx/docs/prompting/content.md) — describe your goal, scope and desired result. 5. [Choose CLI or MCP](/llms.mdx/docs/mcp/content.md) — understand the connection and give your agent these docs. ## Choose your messenger [#choose-your-messenger] | Messenger | What you get | Documentation | | --------------- | ------------------------------------------------------------------- | ------------------------- | | Telegram · `tg` | Your personal account, inbox, search and a local archive | [Telegram](/llms.mdx/docs/tg/content.md) | | MAX · `max` | Your personal account, bots through the official Bot API and groups | [MAX](/llms.mdx/docs/max/content.md) | Use **Telegram / MAX** at the top to switch messengers. It keeps the same section when both tools have it. The language switcher next to search keeps the current page when a translation is available. ## Give the docs to your agent [#give-the-docs-to-your-agent] Share [wirecat.dev/llms.txt](/llms.txt) for the page index, or use **Copy Markdown** on any page. [MCP and documentation](/llms.mdx/docs/mcp/content.md#documentation-for-your-agent) explains all the options. # Installation (/en/docs/installation) The Telegram and MAX CLIs are npm packages that run on **Windows, macOS and Linux**. Ask your local agent to check your computer, install the CLI and help connect your account, or install it yourself in a terminal. Once you have logged in, check your account and first chats, then give your agent a useful task. ## 1. Choose a messenger [#1-choose-a-messenger] Open **Telegram** or **MAX** below and copy the request into your local agent. It works with Codex, Cursor, Claude Code, Gemini CLI and Hermes. To install it yourself, open **Install in a terminal** inside the selected messenger. ### Install Telegram [#tg] Copy this request into your agent. It will help you install and log in on your computer. ```text Set up tg on my computer. First read the guide: https://wirecat.dev/llms.mdx/docs/installation/content.md Check that Node.js 22.16+ (22.x) or 24+ and npm are installed. Install with npm install -g @leemour/tg-cli (use npm.cmd in Windows PowerShell). Make sure tg runs by name in your current shell and in future terminals. On Windows, find the installation folder with npm.cmd prefix -g; add it to user PATH if missing, preserve existing entries, and refresh your own shell PATH. Do not assume npm updated your running shell. On macOS/Linux, check npm prefix -g and its bin folder when resolving the command; preserve existing shell configuration. If PowerShell blocks the generated script, use the .cmd launcher and follow the documented package repair without changing the permanent execution policy. Before login, run tg skill install --for all. Read tg --help, tg commands --json and tg skill show, then load and verify the installed skill for your agent. Use guided setup if the installed cli supports it; otherwise follow the login guide. Tell me setup takes about five minutes and chat history downloads are a separate step. Have me enter login codes and passwords locally or scan the QR code. Verify tg --version, run tg doctor, check the logged-in account and show the first five chats. ``` ### Install MAX [#max] Copy this request into your agent. It will help you install and log in on your computer. ```text Set up max on my computer. First read the guide: https://wirecat.dev/llms.mdx/docs/installation/content.md Check that Node.js 22.16+ (22.x) or 24+ and npm are installed. Install with npm install -g @leemour/max-cli (use npm.cmd in Windows PowerShell). Make sure max runs by name in your current shell and in future terminals. On Windows, find the installation folder with npm.cmd prefix -g; add it to user PATH if missing, preserve existing entries, and refresh your own shell PATH. Do not assume npm updated your running shell. On macOS/Linux, check npm prefix -g and its bin folder when resolving the command; preserve existing shell configuration. If PowerShell blocks the generated script, use the .cmd launcher and follow the documented package repair without changing the permanent execution policy. Before login, run max skill install --for all. Read max --help, max commands --json and max skill show, then load and verify the installed skill for your agent. Use guided setup if the installed cli supports it; otherwise follow the login guide. Tell me setup takes about five minutes and chat history downloads are a separate step. Have me enter login codes and passwords locally or scan the QR code. Verify max --version, run max doctor, check the logged-in account and show the first five chats. ``` Allow about five minutes for installation and login. Downloading chat history is a separate step; choose the chats and amount of history after setup. ## 2. Log in on your computer [#2-log-in-on-your-computer] Enter login codes and passwords in your local terminal when the CLI asks for them. ### Telegram [#telegram] 1. Run in your local terminal: ```sh tg setup --agent all ``` 2. On first login, the CLI obtains Telegram application credentials. Enter your phone number and the code sent in Telegram when requested. 3. On your phone, choose the right Telegram account. Open Settings → Devices → Link Desktop Device and scan the computer’s QR code. 4. Enter your two-step verification password if requested, then wait for setup to check your account and five chats and install agent skills. It reuses an existing session; history downloads remain a separate choice. For login alone, use `tg session start --app auto`[↗](/llms.mdx/docs/tg/commands/content.md#tg-session-start "Command reference: tg session start"). If automatic registration fails, use: ```sh tg session start --app browser ``` [Telegram login instructions](/llms.mdx/docs/tg/sessions/content.md) explain application credentials, QR and phone login. ### Log in to MAX [#log-in-to-max] 1. Run: ```sh max setup --agent all ``` 2. On your phone, open MAX → Settings → Devices. Scan the computer’s QR code and confirm the connection. 3. Follow the terminal prompts. Guided setup checks your account and five chats and installs agent skills. It reuses an existing session; it does not download all history or start the background service. Use `max session start qr`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") if you only want to log in. See [MAX login instructions](/llms.mdx/docs/max/sessions/content.md) for alternatives, or the [bot guide](/llms.mdx/docs/max/bot/content.md) to connect a bot. ### Check the connection [#check-the-connection] Run the command for your messenger: ```sh tg account show ``` ```sh max account show ``` The response should show your account. Diagnostics may report a missing session before login; that is expected. Repeat the check after login, then list your chats. ## 3. Connect your agent [#3-connect-your-agent] [Connect your agent](/llms.mdx/docs/agents/content.md) gives the steps for all five agents. For Claude Desktop or an MCP connection, continue to [MCP and documentation](/llms.mdx/docs/mcp/content.md). > ```text prompt > Summarise my unread messages by chat and tell me who needs an answer. > ``` The CLI command is `tg inbox --limit 5`[↗](/llms.mdx/docs/tg/commands/content.md#tg-inbox "Command reference: tg inbox") or `max inbox --limit 5`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox"). Continue with [first tasks](/llms.mdx/docs/first-tasks/content.md): find a past decision, prepare for a meeting and draft a reply. [Writing requests](/llms.mdx/docs/prompting/content.md) provides copyable examples and useful constraints. ## Updates and file locations [#updates-and-file-locations] These belong to each CLI's reference: [Telegram installation](/llms.mdx/docs/tg/installation/content.md), [MAX installation](/llms.mdx/docs/max/installation/content.md). If a check fails, see [Telegram troubleshooting](/llms.mdx/docs/tg/troubleshooting/content.md) or [MAX troubleshooting](/llms.mdx/docs/max/troubleshooting/content.md). ## Terminal commands [#terminal-commands] For manual installation, you need **Node.js 22.16+ (22.x) or 24+** with npm. [Download Node.js](https://nodejs.org/en/download), open a new terminal and check the versions: ```sh node --version ``` ```sh npm --version ``` ### Telegram [#telegram-1] Install: ```sh npm install -g @leemour/tg-cli ``` Version: ```sh tg --version ``` Diagnostics: ```sh tg doctor ``` Log in: ```sh tg setup --agent all ``` Account: ```sh tg account show ``` First five chats: ```sh tg chats list --limit 5 ``` ### MAX terminal commands [#max-terminal-commands] Install: ```sh npm install -g @leemour/max-cli ``` Version: ```sh max --version ``` Diagnostics: ```sh max doctor ``` Log in: ```sh max setup --agent all ``` Account: ```sh max account show ``` First five chats: ```sh max chats list --limit 5 ``` ### Windows [#windows] The agent request above uses npm and asks the agent to install its skill, check PATH and verify the command. It does not download an installation script. npm creates the command launcher in its global installation folder. On Windows, that folder must be on PATH. An already-running agent must also refresh its own shell environment; changing the saved user PATH does not update an open terminal. For manual installation, the PowerShell installer below handles PATH and skill installation for you: ```powershell & ([scriptblock]::Create((Invoke-RestMethod 'https://wirecat.dev/install.ps1'))) -Tool tg -Agent all ``` ```powershell & ([scriptblock]::Create((Invoke-RestMethod 'https://wirecat.dev/install.ps1'))) -Tool max -Agent all ``` It installs the npm package, preserves existing user PATH entries, updates this PowerShell, installs the agent skill and verifies bare `tg` or `max`. No manual PATH editing is needed. The installer completes these steps even when npm skips lifecycle scripts. It keeps the `.cmd` launcher and removes only npm's generated PowerShell shim for this package; execution policy is unchanged. `-Agent codex|cursor|claude|gemini|all|none` selects the skill; default is `all`. An already-running agent refreshes its shell environment itself before subsequent commands. Account login still needs your QR scan or code, entered locally. # Local storage: contents, updates and exports (/en/docs/max/archive) Documentation version: v0.25.0 Everything `max` reads stays on your computer, so you can answer offline, search and export it. This page explains what is stored, how to keep it current, how to download earlier history and how to export it.**## What is stored [#what-is-stored]Read data is saved locally so you can use it without a network connection:```sh max chats list --offline # только из локальной копии, никуда не подключаться max messages send 0 "текст" --offline # отказ: из копии отправить нельзя max store clear --left # посмотреть, сколько данных покинутых чатов можно удалить max store clear --left --allow-dangerous # удалить их из общей копии ```A chat you left or were removed from disappears from `chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") and `chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") on the next login. Its messages remain in local storage. `max store clear --left --allow-dangerous`[↗](/llms.mdx/docs/max/commands/content.md#max-store-clear "Command reference: max store clear") deletes both the chat and its messages; without `--allow-dangerous`, the command only reports how much it would delete. If you rejoin, the chat reappears in the list.`chats list|show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") and `contacts list|show`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts "Command reference: max contacts") save data in the shared store used by `tg`. It starts filling on your first run without `--offline` after upgrading; the old `max` cache is not migrated. `chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") gets group settings (`description`, `access`, `settings`) only from MAX, so these fields are absent with `--offline`.Normal commands still query MAX: login already returns chats and contacts, so answering only from storage would deliberately miss changes. Use `--offline` when there is no network or when you do not want to connect.MAX receives the saved contact marker, so the next login may return only changed contacts. `max contacts list`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-list "Command reference: max contacts list") reads the shared store updated by that login. Run `max contacts sync`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-sync "Command reference: max contacts sync") to retrieve the full contact list again.The old profile cache is no longer opened or migrated into the shared store. `max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") shows its path if the file remains. There is no command to erase the entire shared store; `store clear --left`[↗](/llms.mdx/docs/max/commands/content.md#max-store-clear "Command reference: max store clear") removes only data for departed chats.**### Downloading history [#downloading-history]`max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") downloads a chat's history into local storage, back to a date, a message count or the start of the chat:```sh max store fetch Друзья --since-time 2026-01-01 max store fetch Друзья --last 500 max store fetch Друзья --background # в фоне; `max store jobs show ` следит за ним ```It pages backwards like the web client's scroll-up behavior: 30 messages at a time, starting from the oldest already downloaded. Each page is followed by a pause between `--pause` and twice that duration (default `5s`, giving 5–10 seconds, similar to a person scrolling). A run downloads at most `--limit` messages (default 1,200, or 40 pages). Running the same command again resumes where it stopped and skips downloaded data. Without `--since-time` or `--last`, repeated runs continue to the beginning. `--since-time` and `--last` cannot be combined. `--since-time` accepts ISO 8601 or a relative time (`30d`). Ctrl-C or `--timeout` stops after the current page, preserving downloaded data.If MAX specifies a wait time, the command waits. Any other error stops it without retrying the request. `store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") does not read reactions or mark messages as read. `--estimate` is unsupported for MAX: MAX message IDs do not let it count missing messages.Downloaded data goes into the shared store used by `tg`; `max store info`[↗](/llms.mdx/docs/max/commands/content.md#max-store-info "Command reference: max store info") shows its path. `max store status`[↗](/llms.mdx/docs/max/commands/content.md#max-store-status "Command reference: max store status") shows message counts and fully downloaded ranges for each chat. The older `max` cache is not migrated; download its history again.`max store jobs list`[↗](/llms.mdx/docs/max/commands/content.md#max-store-jobs-list "Command reference: max store jobs list") shows background downloads; `max store jobs cancel `[↗](/llms.mdx/docs/max/commands/content.md#max-store-jobs-cancel "Command reference: max store jobs cancel") stops one.Store maintenance:- `max store check`[↗](/llms.mdx/docs/max/commands/content.md#max-store-check "Command reference: max store check") — file integrity, search indexes, disk space and stale chats. - `max store backup <файл>`[↗](/llms.mdx/docs/max/commands/content.md#max-store-backup "Command reference: max store backup") — back up the live store without overwriting an existing file; `max store restore <файл>`[↗](/llms.mdx/docs/max/commands/content.md#max-store-restore "Command reference: max store restore") restores it and keeps the previous file alongside. - `max store reindex`[↗](/llms.mdx/docs/max/commands/content.md#max-store-reindex "Command reference: max store reindex") — rebuild the search index without losing messages. - `max store migrate`[↗](/llms.mdx/docs/max/commands/content.md#max-store-migrate "Command reference: max store migrate") — upgrade the file to this version's schema.**### Exporting to a file [#exporting-to-a-file]Export conversations from local storage as JSONL (the same objects as `messages list --jsonl`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list")) or readable Markdown:```sh max store export Друзья --format markdown --output друзья.md max store export 111 --format jsonl --since-time 2026-09-01 > чат.jsonl ```Export **never connects to the network** and includes only downloaded or previously read data. Fetch older history with `max store fetch <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch"). Existing files are never overwritten. A file written with `--output` is accessible only to you (`0600`): it contains photo links that open without logging in.**## Search [#search]`max messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-search "Command reference: max messages search") reads only the local archive. Its default is a strict Lucene profile: words, phrases, Boolean groups, fields, dates and limited regex. The full [search reference](/llms.mdx/docs/max/search/content.md) explains syntax and migration. Use `--language legacy` for the previous filters and typo correction.```sh max messages search 'invoice kind:private' --json max messages search 'invoice date:[2026-01-01 TO 2026-02-01}' --timezone Europe/Madrid --json max messages search 'preset:secret kind:saved' --json ```An empty result means “not found in the selected archive”. JSON reports completeness and coverage; the last network update time is currently unknown. `--source` selects providers and accounts, `--newest` sorts by time and `--context` includes neighboring messages. `--regex` remains a separate JavaScript mode.**## Conversations within a group [#conversations-within-a-group]Busy groups contain several conversations at once. `max conversations`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations "Command reference: max conversations") finds them in local storage using replies, mentions and message order, without querying MAX or using AI:```sh max conversations build --chat Друзья # найти; ещё раз — после того, как скачано больше max conversations list --chat Друзья --since-time 7d max conversations show 91 # один разговор, от старых к новым max messages links Друзья # почему это сообщение там, где оно есть ```Nothing is built until you run `build`, and a new build replaces the previous one. Download history first with `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch").Your own agent can link messages more accurately. `max conversations batches status --chat <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-batches-status "Command reference: max conversations batches status") reports message and batch counts; `batches next` returns the next batch, and `conversations links add --batch `[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-links-add "Command reference: max conversations links add") reads the agent's JSON response from stdin. `conversations links clear`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-links-clear "Command reference: max conversations links clear") removes those responses. `max` itself never calls a model.**### Semantic search [#semantic-search]After building conversations, `max` can find them by topic rather than exact words. `max conversations embed`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-embed "Command reference: max conversations embed") computes a vector for each conversation on your computer; `max conversations search`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-search "Command reference: max conversations search") finds those closest to your question:```sh max models text download e5-small # один раз: 135 МБ, общая папка с tg max conversations embed --chat Друзья # продолжает с места, где остановился max conversations search "где снять квартиру" --chat Друзья max conversations search "аренда квартиры" # во всех чатах, для которых посчитано ```Nothing leaves your computer. `max conversations embed status --chat <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-embed-status "Command reference: max conversations embed status") reports remaining work; `embed clear --chat <чат>` deletes vectors. An external service can compute vectors with your own key: run `max models text key set openai`[↗](/llms.mdx/docs/max/commands/content.md#max-models-text-key-set "Command reference: max models text key set"), then use `--provider openai` with `embed` and `search`. Before sending anything, `embed` shows chunk and token counts and the cost, then waits for confirmation (`--yes` in scripts).**## Live messages: `max serve` and `max watch` [#live-messages-max-serve-and-max-watch]An ordinary command connects, performs one action and exits. `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") is the exception: it keeps one MAX connection open and shares new messages with listeners.**You do not need to start it manually.** The first command that needs MAX starts `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") in the background if necessary, then continues on its own connection. Subsequent commands use the server. **An automatically started server stops after 15 minutes without use.** Its log is `<профиль>.serve.log` beside the profile's state, with permissions 600. Disable automatic startup for one run with `--no-serve`, or permanently with `max config set serve false`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set"). `max session end`[↗](/llms.mdx/docs/max/commands/content.md#max-session-end "Command reference: max session end") first stops the profile's server if a command started it.**A manually started server (`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve"), `max server start`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start")) stops only with Ctrl-C or `max server stop`[↗](/llms.mdx/docs/max/commands/content.md#max-server-stop "Command reference: max server stop")**, not because of inactivity, `max session end`[↗](/llms.mdx/docs/max/commands/content.md#max-session-end "Command reference: max session end") or other socket requests. Running `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") manually replaces an automatically started background server. You can explicitly choose an idle timeout with `--idle`. `max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") stops any server for the profile, logs in and restarts it with the new session, keeping a single MAX connection at a time.```sh max serve # вручную, в одном терминале; Ctrl-C — остановить max serve --idle 30m # или остановиться, когда им 30 минут никто не пользуется max server start # то же, но в фоне; ответ — когда сервер уже подключён max server status # работает ли, с какого времени, какой версии, подключён ли к MAX max server restart # остановить и запустить снова — например, после обновления max max server stop # остановить сервер профиля, как бы он ни был запущен max server logs # последние строки его журнала; --lines 200 — больше max server install # служба systemd (Linux) или launchd (macOS) для профиля; ничего не запускает max server uninstall # убрать службу; сначала max server stop max watch # в другом: новые сообщения по мере прихода max watch --jsonl # то же для скрипта: одно сообщение на строку, как у `messages list` max watch --jsonl | ./on-message.sh max watch --events --jsonl # ещё правки, удаления и реакции; у каждой строки поле "event" ```- **After updating `max`**, an automatically started server replaces itself with the new version. A manually started server keeps its old version until restarted. `max server status`[↗](/llms.mdx/docs/max/commands/content.md#max-server-status "Command reference: max server status") shows this; `max server restart`[↗](/llms.mdx/docs/max/commands/content.md#max-server-restart "Command reference: max server restart") fixes it. - **Running as a service.** After `max server install`[↗](/llms.mdx/docs/max/commands/content.md#max-server-install "Command reference: max server install"), `max server start`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start") and `max server stop`[↗](/llms.mdx/docs/max/commands/content.md#max-server-stop "Command reference: max server stop") control the server through systemd or launchd. The service runs `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") as a manual server, without an idle timeout. If MAX rejects login, the service **does not** restart it: every retry would be another account login. `max server status`[↗](/llms.mdx/docs/max/commands/content.md#max-server-status "Command reference: max server status") shows the service and log location. - **One server per profile.** A second `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") for that profile refuses to start. The socket lives beside profile state with permissions 600, so only the owner can listen. - **Network behavior matches a web.max.ru tab:** a ping every 30 seconds, replies to MAX pings and acknowledgements for incoming messages. It **does not mark messages as read** or send messages. - **If MAX disconnects**, the server reconnects after 1, 2, 4… seconds, with the delay capped at one minute. `max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") reports this on stderr. If MAX no longer accepts the token, the server stops with an authentication error. - **All clients share one MAX connection per profile.** Commands, `max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") and `max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") do not log in independently: reads, sends and reactions use the server's connection. Send safeguards still run in the command. If no server exists, the command starts one and waits. With `serve: false` and no server, the command connects itself. A second server refuses before logging in. - The server keeps its session state current when messages arrive, a chat is read on your phone or a chat changes. If MAX reports something it cannot apply, such as deleted messages, it logs in again in the background, at most once a minute. - **With `--events`, line formats change:** `{"event": "message", "message": …}`, `{"event": "edit", "message": …}`, `{"event": "delete", "chatId", "chatTitle", "messageId"}`, `{"event": "reaction", "chatId", "chatTitle", "messageId", "reactions"}`. Without the flag, each line is a message as before. `max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") cannot show who is typing: MAX sends typing notifications only to a client with that chat open. - **`max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") sees only messages arriving while it and the server are connected.** Messages during an outage are missed. A `status` line with `connected: true` after an outage tells you to fetch them: `max inbox --since-time <время из поля at предыдущей строки status>`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox").**## Next steps [#next-steps]- [Personal account guide](/llms.mdx/docs/max/usage/content.md) — reading and sending. - [Diagnostics](/llms.mdx/docs/max/diagnostics/content.md) — what a command did. - [Command reference](/llms.mdx/docs/max/commands/content.md) — every `store`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store"), `serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") and `watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") option. # MAX bots (/en/docs/max/bot) Documentation version: v0.25.0 `max bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") works with a bot through the official [MAX Bot API](https://dev.max.ru/docs-api), using its bot token. It is separate from your personal account: a bot has its own name, chats and token. `max …` without `bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") uses your personal account ([Personal account guide](/llms.mdx/docs/max/usage/content.md)).Create a bot at [business.max.ru](https://business.max.ru/self). MAX issues bots only to verified organizations, individual entrepreneurs and registered self-employed people. Every bot undergoes moderation.See the [Command reference](/llms.mdx/docs/max/commands/content.md) for all commands and options.**## Your first minute [#your-first-minute]```sh max sales bot auth set # токен — в скрытом вводе max sales bot me # какой это бот ````auth set` asks MAX who the token belongs to before saving it. A typo cannot overwrite a working token.**## Finding a chat ID [#finding-a-chat-id]MAX has no list of all chats a bot belongs to, so obtain IDs from what the bot has done or received.- **A conversation with a person.** Address them as `user:<номер>`. The send response includes the destination chat ID in `chatId`. - **A group or channel.** Add the bot, then request the latest updates from MAX: ```sh max sales bot api get-updates --limit 10 ``` The chat ID is in `chat_id`. With no new updates, the command waits up to 30 seconds; `--poll-timeout 0` disables waiting. MAX does not deliver these updates a second time. This command does not work while the bot has a webhook.Open the chat with `max sales bot chats show` and its ID. The bot then knows its title, which you can use in subsequent commands. `chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") shows every chat the bot has already seen.- Group and channel IDs are **negative**. - A positive ID usually identifies a person. Use `user:<номер>` for a person; without `user:`, MAX treats the ID as a chat and returns “chat not found” (code `6`), and `max` explains the correct form.**## Multiple bots [#multiple-bots]A bot is stored under a name you choose, used as the command's **first word**, just like a personal-account profile:```sh max sales bot auth set max support bot auth set max support bot messages send user:4815162342 "Ваша заявка принята" max bot list --check # все имена с токеном бота и какой бот за каждым ```Without a name, the profile comes from `defaultProfile`, or `default` if unset: `max bot me`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-me "Command reference: max bot me"). `MAX_PROFILE` sets the name for the whole shell session.**## Token storage [#token-storage]The token is stored in the system password store, under `bot:<имя>`, separately from the personal-account token. If no password store is available, it goes into a file with permissions `0600`, just like a personal token.```sh max sales bot auth show # откуда взят токен и какой это бот max sales bot auth remove # забыть токен ````MAX_BOT_TOKEN` takes precedence over stored credentials, which is useful in CI. `auth set` does not save a token from this variable.**## Messages [#messages]Use an ID for a chat, `user:<номер>` for a person, or a title for a chat the bot has already seen:```sh max sales bot messages send "Команда продаж" "Сборка готова" max sales bot messages send user:4815162342 "Здравствуйте" max sales bot messages send "Команда продаж" "**Итоги недели** в закрепе" --md max sales bot messages send "Команда продаж" "Принято" --reply-to mid.0000019a7f3c21de echo "Текст из трубы" | max sales bot messages send "Команда продаж" - ````--silent` sends without a notification. Text can contain up to 4,000 characters. `user:4815162342` and `mid.0000019a7f3c21de` are made-up IDs here and below; use your own.**### Files [#files]`--file` attaches a file from disk. Images, video and audio are detected by extension; other files are sent as documents. `--photo` sends an image as a photo, `--voice` sends Ogg Opus as a voice message, and `--as-file` sends video as a document. Files from hidden directories or `max`'s own directories require `--allow-any-file`. Text is optional when sending a file:```sh max sales bot messages send "Команда продаж" "Отчёт за неделю" --file report.pdf max sales bot messages send "Команда продаж" --file screenshot.png ```The file is uploaded to MAX before the message is sent. While MAX processes a video or large file, it may report “not ready”; `max` waits up to four times, about nine seconds in total. If upload fails, nothing is sent to the chat.`uploads put` only uploads the file and prints an attachment object. Put this in the body's `attachments` for `bot api send-message`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api-send-message "Command reference: max bot api send-message"):```sh max sales bot uploads put report.pdf ``````sh max sales bot messages list "Команда продаж" --limit 20 max sales bot messages show "Команда продаж" mid.0000019a7f3c21de max sales bot messages edit "Команда продаж" mid.0000019a7f3c21de "Исправленный текст" max sales bot messages delete "Команда продаж" mid.0000019a7f3c21de --allow-dangerous max sales bot messages pin "Команда продаж" mid.0000019a7f3c21de --notify max sales bot messages unpin "Команда продаж" mid.0000019a7f3c21de ```Always specify a message together with its chat. This keeps commands consistent between `max` and `tg`, where message IDs are only unique within a chat. `max` will not touch a message from a different chat. `--html` formats text as HTML; it cannot be combined with `--md`. Deletion asks for confirmation; `--allow-dangerous` answers yes. Pinning is silent by default; `--notify` notifies members. A send response contains the message and `operationId`, identifying its log record.If the connection drops during a send, `max` does not retry automatically. It reports an unknown outcome (code `14`). Check the chat before sending again.**## Chats [#chats]MAX has no “all bot chats” endpoint. `chats list`[↗](/en/docs/max/commands#max-chats-list "Command reference: max chats list") therefore shows **chats this bot has seen on this computer**: those opened with `chats show`[↗](/en/docs/max/commands#max-chats-show "Command reference: max chats show"), sent to or read from. It is not a complete list.```sh max sales bot chats list max sales bot chats show "Команда продаж" max sales bot chats action "Команда продаж" typing # typing, photo, video, voice, file max sales bot chats leave "Команда продаж" # вернуть бота может только админ чата ```**### Members and admins [#members-and-admins]The bot must be a chat admin with permission for the action.First allow the bot to join groups. By default, MAX prevents bots from being added to group chats, whether through the app or `max chats members add`[↗](/en/docs/max/commands#max-chats-members-add "Command reference: max chats members add") (response `participants.filter.out`). Enable this at [business.max.ru](https://business.max.ru/self): bot → **⋮ → Settings → Privacy** ([MAX documentation](https://dev.max.ru/docs/chatbots/bots-create/manage)). Then add it to the group and make it an admin in the MAX app. Group checks require permission to read messages; without it, MAX returns no group messages. You can also grant it with your own account: `max chats admins add "Поход" <номер бота> --can read,members,delete`[↗](/en/docs/max/commands#max-chats-admins-add "Command reference: max chats admins add").```sh max sales bot chats members list "Команда продаж" --limit 50 max sales bot chats members add "Команда продаж" 4815162342 2342481516 max sales bot chats members remove "Команда продаж" 4815162342 --block max sales bot chats admins list "Команда продаж" max sales bot chats admins add "Команда продаж" 4815162342 --can read,pin --title "Дежурный" max sales bot chats admins remove "Команда продаж" 4815162342 ````members list` returns up to 100 people and a `marker`. Fetch the next page with `--marker` and that value. Admin permissions in `--can` use the same names as `max chats admins add`[↗](/en/docs/max/commands#max-chats-admins-add "Command reference: max chats admins add"): `read`, `members`, `admins`, `info`, `pin`, `link`, `edit`, `delete`. `read` grants access to group messages.**## Local storage [#local-storage]`max` saves everything the bot reads, sends or receives on this computer. You can read and search this copy offline:```sh max sales bot messages list "Команда продаж" --offline max sales bot messages show "Команда продаж" mid.0000019a7f3c21de --offline max sales bot messages search "итоги недели" ```Search matches words, with best matches first; `--newest` puts recent matches first. All words are required. `"фраза"`, `-слово`, `а OR б` and the filters `from:`, `chat:`, `after:`, `before:`, `has:` work as in `max messages search --language legacy`[↗](/en/docs/max/commands#max-messages-search "Command reference: max messages search"), including typo correction. For strict search across the shared archive, use [regular search](./search.md) with `in:bots`.Download older chat history into the local store:```sh max sales bot store fetch "Команда продаж" # до 1000 сообщений, новые сначала max sales bot store fetch "Команда продаж" --last 500 # пока не будет 500 последних max sales bot store fetch "Команда продаж" --since-time 7d # за последние семь дней ```Repeated runs resume where the previous run stopped without refetching downloaded messages. Requests pause one second (`--pause`) and fetch 100 messages each (`--page-size`).Normal commands still query MAX, which has the full chat history. A message the bot deletes, or that `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch") learns was deleted, is removed from local storage. If deletion happens while `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch") is stopped, the local copy does not know about it.People are found in the same copy. Use an ID, `@username` or part of a name. If two people match, `max` shows both and asks for an ID.```sh max sales bot contacts show @ann # где писала, и её личный чат с ботом max sales bot contacts show @ann --refresh # сначала перечитать личный чат у MAX max sales bot messages search --from @ann # всё, что она написала max sales bot messages search "счёт" --from @ann --from Борис max sales bot messages between @ann Борис --limit 20 ````between` shows only chats where every named person has posted, returning the latest 20 messages from each, oldest first. A “shared chat” here means the bot saw messages from each person, not that MAX's member list includes them.**Each bot sees only its own local copy.** Reading another bot's copy requires both permission in configuration and an explicit request in the command:```sh max shop config set --bot readOtherBots true # боту shop можно читать всех ботов max shop config set --bot readOtherBots news,support # или только этих max shop bot messages search заказ --bots news # и тогда — явно, в команде max shop bot contacts show @ann --all-bots # все, кого разрешено ````--all-bots` and `--bots` are supported by `messages search`[↗](/en/docs/max/commands#max-messages-search "Command reference: max messages search"), `contacts show`[↗](/en/docs/max/commands#max-contacts-show "Command reference: max contacts show") and `messages between`[↗](/en/docs/max/commands#max-messages "Command reference: max messages"). Without `readOtherBots`, both refuse with code `5` and name the command that enables access. Through `max <имя> bot mcp`, the equivalent fields (`all_bots`, `bots`) are offered only when access is permitted.**## Updates [#updates]```sh max sales bot watch # новые сообщения, до Ctrl-C или --timeout max sales bot watch --events --jsonl # и всё остальное: правки, удаления, кнопки, кто вошёл и вышел max sales bot watch --types message_created,message_edited ````watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch") saves incoming data before printing it: messages in local storage, button presses for `callbacks answer`, and joins and departures for group checks below. Without `--events`, only new messages are printed. With `--events`, every line identifies its event (`message`, `edit`, `delete`, `callback`, `joined`, `left`, `added`, `removed`, `started`, `other`). `--types` accepts MAX event names. The next run resumes where the previous one stopped. `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch") does not work while a webhook is configured.Updates received by `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch") are no longer delivered to another reader using this bot's `get-updates`.**## Checking a chat against rules [#checking-a-chat-against-rules]A bot can monitor a group where it is an admin using the same rules as `max chats moderate`[↗](/en/docs/max/commands#max-chats-moderate "Command reference: max chats moderate") for a personal account ([groups.md](./groups.md)). Each bot has its own rules:```sh max sales bot chats rules set -72894839451 invites remove # приглашения в чужие чаты — удалять автора max sales bot chats rules set -72894839451 consent.remove allow # без вопросов max sales bot chats moderate -72894839451 # проверить, что нового max sales bot chats moderate -72894839451 --dry-run # только показать ```The check examines messages since the previous check (the past day on its first run) and new members, then performs actions allowed by rules and consent. Differences from personal accounts:- **Removed members are banned** and cannot return through the invite link. The link appears expired or invalid to them but keeps working for everyone else. An admin can add them back manually (`max chats members add`[↗](/en/docs/max/commands#max-chats-members-add "Command reference: max chats members add")). Use `--no-ban` to remove without banning. Bans work only in chats with an invite link. - **The bot learns about joins only from `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch").** MAX delivers each event to one reader, so checks use joins saved by `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch"). Without `watch`[↗](/en/docs/max/commands#max-watch "Command reference: max watch"), the check examines only messages and reports that limitation. - **Bots cannot see account ages.** The Bot API does not provide them, so the account-age rule does not apply.The bot needs admin permissions to delete messages and remove members.**## Comments [#comments]Comments appear under channel posts. Specify the post ID (`mid.…`) first, then the comment ID:```sh max sales bot comments list mid.0000019a7f3c21de --limit 20 max sales bot comments get mid.0000019a7f3c21de 42 max sales bot comments send mid.0000019a7f3c21de "Спасибо за вопрос" max sales bot comments edit mid.0000019a7f3c21de 42 "Исправлено" max sales bot comments delete mid.0000019a7f3c21de 42 ```Comments use the same recipient allowlist as messages sent to that channel.**## Buttons [#buttons]When someone presses a button under a bot message, the bot receives a callback ID (`callback_id`) and can answer it:```sh max sales bot callbacks answer f9LHodD0cOL5 --notification "Готово" max sales bot callbacks answer f9LHodD0cOL5 --text "Заказ подтверждён" ````--notification` displays a short notice only to the person who pressed the button; `--text` replaces the message containing it. The response goes to the chat where the button was pressed, but the callback ID does not reveal that chat, so the recipient allowlist does not apply.**## Command menu [#command-menu]The menu is what someone sees when typing `/` in a bot chat.```sh max sales bot commands list max sales bot commands set start=Начать help=Помощь "report=Отчёт за день" max sales bot commands clear ````set` replaces the entire menu. Each entry is `имя=описание`; the description is optional.**## Webhooks [#webhooks]A webhook is an address where MAX pushes everything the bot receives. While one is configured, the bot cannot receive updates through `get-updates`.```sh max sales bot webhooks list max sales bot webhooks set https://bot.example.ru/max --secret-stdin --types message_created,bot_started max sales bot webhooks delete https://bot.example.ru/max ```- The address must use HTTPS on port 443 with a certificate MAX trusts. - A new address **does not replace** an old one: MAX sends every update to both. `set` therefore refuses if another address is configured. Remove it first, or use `--add` if you need both. - `--secret-stdin` prompts without showing input or reads from a pipe. MAX sends this secret in `X-Max-Bot-Api-Secret`, letting your server identify MAX. The secret never appears in command arguments.**## Who the bot may contact [#who-the-bot-may-contact]Bots follow the same profile settings as personal accounts:- `readOnly` — read without changing anything. - `allow` — only listed actions: `send`, `edit`, `delete`, `pin`, `groups` for members and chat settings, `profile` for bot commands, and `read` for updates. An action without its own permission name, such as webhooks, is forbidden when `allow` is set.Each bot has its own list of chats it may write to:```sh max sales bot recipients add "Команда продаж" max sales bot recipients list max sales bot recipients remove "Команда продаж" max sales bot recipients clear # писать можно снова в любой чат ```Without a list, the bot may write anywhere. With one, sending to another chat refuses with code `7` and shows a command to add it.Every bot write — send, edit, delete or pin — is logged:```sh max sales bot sends list ```The log records the chat, action, outcome and text length, but never the text itself. **Every** bot write, including through `bot api`[↗](/en/docs/max/commands#max-bot-api "Command reference: max bot api"), uses the recipient allowlist and log. There is no hourly send limit until one is configured in the `bot`[↗](/en/docs/max/commands#max-bot "Command reference: max bot") section (`max <имя> config set --bot sendsPerHour 200`; see [Configuration](./configuration.md)).**## Any API operation [#any-api-operation]Every Bot API operation is available as `max bot api <операция>`[↗](/en/docs/max/commands#max-bot-api "Command reference: max bot api"). Commands are generated from the official API schema by cli-core; command construction and input validation are shared with Telegram. New MAX operations appear after updating the schema:```sh max sales bot api get-my-info max sales bot api get-subscriptions max sales bot api answer-on-callback --callback-id f9LHodD0cOL5 --body '{"notification": "Готово"}' max sales bot api send-message --user-id 4815162342 --body-file message.json ```Path and query parameters become flags; the body is JSON in `--body`, `--body -` (from a pipe) or `--body-file`. `--body-file -` also reads stdin. The native `timeout` parameter is named `--poll-timeout`; the global `--timeout` limits the whole command. The shared `--store-token ` option is unavailable for current MAX methods: each rejects it before performing the operation. Before sending, the body is checked against the schema. Errors identify the field and expected type without exposing its value. See [Bot API coverage](https://github.com/leemour/max-cli/blob/v0.25.0/docs/dev/bot-api-coverage.md) for all operations and their read/write classification.**## Scripts and agents [#scripts-and-agents]With `--json`, stdout contains only data; errors go to stderr with an exit code:| Code | Meaning | | ---- | --------------------------------------------------------------------------------- | | `4` | No bot token, or MAX rejected it | | `5` | Read-only profile or action forbidden by `allow` | | `6` | Chat not found, for example an unseen title or a person addressed without `user:` | | `7` | Chat is absent from the bot's recipient allowlist | | `8` | Bot's `sendsPerHour` limit reached | | `14` | No response; the write outcome is unknown |Messages use the same output format as personal-account messages. IDs above 2^53 are printed as strings to preserve every digit.`--trace` and `--record` also work for bots: each Bot API request produces a stderr line; file uploads show type, size and response code without the URL or filename. Failed runs are saved and appear in `max runs list`[↗](/en/docs/max/commands#max-runs-list "Command reference: max runs list") ([Diagnostics](./diagnostics.md)).**## Certificate [#certificate]The `platform-api2.max.ru` certificate is signed by a Russian Ministry of Digital Development root certificate absent from Node. `max` adds it only to its own Bot API requests, without changing your system. Bot requests identify themselves as `max-cli/<версия>`.**## Connecting a bot to an agent (MCP) [#connecting-a-bot-to-an-agent-mcp]`max <имя> bot mcp` exposes a bot to an agent, just as `max mcp`[↗](/en/docs/max/commands#max-mcp "Command reference: max mcp") exposes a personal account:```sh claude mcp add sales-bot -- max sales bot mcp max sales bot mcp config # запись для Claude Desktop, Cursor и других ```The bot profile determines agent access: bot details, seen chats, messages, search, people, members and admins, comments, command menu, logs and recipients. Unless read-only, it also allows sending, editing, pinning, typing indicators, comments, callback answers, deletion, adding and removing members, and rule-based checks (`max_bot_chats_moderate`). `max_bot_status` shows the profile, token source, bot owner and enabled write tools.- `readOnly: true` limits the agent to reading. - `allow` permits only named actions: `"allow": ["send"]` allows sends and comments, but not editing or deleting. - Deleting a message or comment first shows a confirmation form; starting the server with `--allow-dangerous` removes this form. - Actions whose group rules require confirmation appear together in one form. - `--confirm-send` shows every write in a form before performing it.`--allow-send`, `--allow-delete` and `--allow-moderate` no longer grant permissions. The server accepts them with a warning.Every write runs through the same command you would run yourself, including the recipient allowlist, `readOnly`, `allow` and logging. The agent cannot access tokens or webhooks; it can only read recipients, command menus and admins. It also cannot leave chats, send files or use `bot api`[↗](/en/docs/max/commands#max-bot-api "Command reference: max bot api").With `--md`, the bot uses MAX rules: `__жирный__`, `++подчёркнутый++`, `^^выделенный^^`, links, code, headings and quotations. The formatter creates safe HTML with escaped text and addresses; this is an internal representation, and the --md argument remains Markdown. # Changelog (/en/docs/max/changelog) Documentation version: v0.25.0 Notable changes to `@leemour/max-cli`, one section per version, newest first. Versions follow [Semantic Versioning](https://semver.org/lang/ru/); the command interface may still change before `1.0.0`.## 0.25.0 — 03.10.2026 [#0250--03102026]**### New [#new]- **`max skill show link-conversations`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show") prints the shared conversation-linking skill.** Available without a session; omitting the name still prints the main MAX skill. - `bot api`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api "Command reference: max bot api") shares its command builder and input validation with Telegram. Generators remain in cli-core; MAX parameters, native responses and current permissions are preserved. The shared `--store-token ` option is intended for operations that return credentials; other operations reject it.**### Changed — may break scripts [#changed--may-break-scripts]- **`max sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list") respects the configured `limit`, like Telegram.** Previously, omitting the flag always selected 20 attempts. The JSON `limit` field contains the selected limit; `items`, `page` and `hasMore` remain. `--limit` overrides configuration. - **`max models audio list --json`[↗](/llms.mdx/docs/max/commands/content.md#max-models-audio-list "Command reference: max models audio list") adds `directory`:** the shared model directory used by MAX and Telegram. Model commands, their directory and download verification are now shared; existing files, model order and the `transcribeModel` setting remain. Models need no repeat download. JSONL still returns one model per line. - **`--md` uses MAX's own formatter** for send/edit and captions: nested styles, `__жирный__`, `++подчёркнутый++`, links and code. Bots support highlighting, headings and quotations through safe HTML; the personal protocol explicitly rejects unconfirmed types. Telegram uses different syntax. Unknown wire types are no longer sent silently.## 0.24.0 — 03.10.2026 [#0240--03102026]**### Added [#added]- **`max setup`[↗](/llms.mdx/docs/max/commands/content.md#max-setup "Command reference: max setup") guides the first run for a personal account:** it checks local directories, offers QR login, checks the account and up to five chats, and connects the selected agent skill. Repeating setup reuses an existing session. History is downloaded separately; setup does not start the background service. Help, installation and agent instructions explain next steps and Windows execution without PATH. `max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show") is available before login.**### Changed — may break scripts [#changed--may-break-scripts-1]- **`max chats check`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") is replaced by `max chats moderate`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-moderate "Command reference: max chats moderate"):** shared rules and moderation with Telegram. `--since-time` accepts a timestamp or `30m`/`2h`/`1d`, replacing the previous message-ID `--since`; JSON is now `{ chatId, rows }`. Each run reads up to 1,000 messages. Rule levels are `deny|readonly|ask|allow`; old `forbid` and `flag|confirm` values are read as `deny` and `ask`. The saved check position moves from the session into the existing rules file, so the first run continues from that position. CLI and personal-account MCP share the position; MCP tool names and flags remain unchanged. Joining by link is named `join` in `chats events`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-events "Command reference: max chats events"). - **`max upgrade --json`[↗](/llms.mdx/docs/max/commands/content.md#max-upgrade "Command reference: max upgrade") always includes `restarted`.** In MAX this is an empty array: the server restart policy is unchanged. Version checks and no-update results use the same response shape as installation; previous fields remain. Scripts that validate the exact set of keys must account for the additional field. - **Local search uses a strict Lucene profile:** parentheses, fields, date ranges and `--timezone`, limited wildcards and regex. Prefix matching is explicit, as `слово*`; the previous typo-correcting search remains available with `--language legacy`. JSON reports coverage even without matches. The guide and skill explain migration; JavaScript `--regex` runs in a separate worker with size and time limits. - **`max commands --json`[↗](/llms.mdx/docs/max/commands/content.md#max-commands "Command reference: max commands") returns the JSON contract version in `contract`.** Value `0` matches Telegram CLI; previous reference fields remain. Scripts that compare the entire JSON against a saved string must account for the new field; reading individual fields requires no changes. - **Group reads use shared options and formats.** `chats events`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-events "Command reference: max chats events") accepts `--since-time` instead of `--since` and `--type` instead of `--event`; the boundary is a time, rather than a message ID. Creation events are now `create` instead of `new`. `chats members list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-members-list "Command reference: max chats members list") shows a page with `--limit`, `--page` and `--all`; add `--all` for the previous scope. JSON no longer contains `chatId` or `rolesKnown`, but roles, registration dates and last-seen times remain in rows. `chats inspect`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-inspect "Command reference: max chats inspect") returns `id`, `kind`, `title`, `username`, `participantsCount`, `description` and `member` instead of a record with access, link and settings. `member` and `username` are `null` when MAX does not report them. These are shared MAX and Telegram reads; update scripts and filters. Warnings about incomplete member lists and unknown roles remain; no read marks messages as read. See [groups](/llms.mdx/docs/max/usage/content.md#%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B-%D0%B8-%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%D1%8B). - **Group-management commands return shared JSON with `operationId`.** `chats create`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-create "Command reference: max chats create"), `join`, `update` and `link reset` put the record in `chat`; `leave` returns `chatId`. `members add` now has `added` and `notAdded`, while `members remove` has `removed`; `admins` commands return `personId`, and adding an admin also returns `rights`. This is the shared MAX and Telegram operation format; scripts must update result parsing. `link show` keeps its previous format. Titles and settings still change through two requests: if the title or description changed but the settings request did not complete, the command reports `outcome_unknown` and records a partial result in the journal. Read `chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") before retrying. See [group management](/llms.mdx/docs/max/usage/content.md#%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B-%D0%B8-%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%D1%8B). - **`max account update`[↗](/llms.mdx/docs/max/commands/content.md#max-account-update "Command reference: max account update") and `max account sessions end`[↗](/llms.mdx/docs/max/commands/content.md#max-account-sessions-end "Command reference: max account sessions end") return the shared format with `operationId`.** Profile changes return `{operationId, account}` with `id`, `name`, `username`, `phone`; ending sessions returns `{operationId, sessions}` instead of an array. This is the shared MAX and Telegram operation format; scripts must read data from `account`[↗](/llms.mdx/docs/max/commands/content.md#max-account "Command reference: max account") or `sessions`. A profile description is no longer returned after a change: use `account show`[↗](/llms.mdx/docs/max/commands/content.md#max-account-show "Command reference: max account show"). Phone numbers remain masked; `sessions end` still requires `--others --yes`. Profile photos now accept JPG, JPEG, PNG and WebP; convert GIF to one of these formats. See [profile and sessions](/llms.mdx/docs/max/usage/content.md#%D0%BA%D0%BE%D0%BD%D1%82%D0%B0%D0%BA%D1%82%D1%8B-%D0%BF%D1%80%D0%BE%D1%84%D0%B8%D0%BB%D1%8C-%D0%BF%D0%B0%D0%BF%D0%BA%D0%B8). - **`max chats folders create|update|delete`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-folders "Command reference: max chats folders") returns `operationId` alongside the result.** Creating and updating return `{operationId, folder}`; deleting returns `{operationId, folderId}`, instead of the folder record itself. This is the shared MAX and Telegram operation format; scripts must read the record from `folder` and use `folderId` after deletion. `update` without `--title`, `--add` or `--remove` now refuses rather than rewriting the same folder. Listing folders keeps its previous format. See [folders](/llms.mdx/docs/max/usage/content.md#%D0%BA%D0%BE%D0%BD%D1%82%D0%B0%D0%BA%D1%82%D1%8B-%D0%BF%D1%80%D0%BE%D1%84%D0%B8%D0%BB%D1%8C-%D0%BF%D0%B0%D0%BF%D0%BA%D0%B8). - **`max contacts add|remove|block|unblock|rename|import`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts "Command reference: max contacts") returns the shared format with `operationId`.** Adding and renaming return `{operationId, person}`; deleting and blocking return `{operationId, personId}`; importing returns `{operationId, sent, recognised}`. `recognised` now contains person records (`id`, `name`, `username`) returned by MAX, instead of phone numbers; if no records are returned, the list is empty. `sent` counts file rows, including duplicate numbers. This is the shared MAX and Telegram operation format; scripts must update response parsing. A phone number rejected by MAX no longer reports the file row; malformed rows still report their number. See [contacts](/llms.mdx/docs/max/usage/content.md#%D0%BA%D0%BE%D0%BD%D1%82%D0%B0%D0%BA%D1%82%D1%8B-%D0%BF%D1%80%D0%BE%D1%84%D0%B8%D0%BB%D1%8C-%D0%BF%D0%B0%D0%BF%D0%BA%D0%B8). - **`max cache clear` is removed.** All reads and name resolution use the shared local store; `max store clear --left --allow-dangerous`[↗](/llms.mdx/docs/max/commands/content.md#max-store-clear "Command reference: max store clear") removes data for departed chats. There is no command to erase the entire shared store. The old file is neither migrated nor opened; `max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") shows its path, and history can be fetched again with `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch").**### Fixed [#fixed]- **`max conversations embed status`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-embed-status "Command reference: max conversations embed status") estimates e5-small time more accurately.** It uses the measured 31 chunks/s rather than 15; on the measured laptop, the previous estimate was twice as long. Actual time depends on the computer and text length. Three worker threads delivered a measured 1.04–1.1× speedup at substantial memory cost; thread allocation is unchanged. - **`max_messages_search` through MCP retains archive coverage metadata and uses the same search parameters as CLI.** Available parameters include `language`, `timezone`, versioned `ast`, chat names, and `source`, `newest`, `context` filters. The default profile accepts single-character queries. Previously, some parameters were absent and responses lost `query`, `coverage` and `completeness`; empty results did not explain local-store coverage. Previous response fields and the tool name remain unchanged. - **`max runs list --limit`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-list "Command reference: max runs list") suggests increasing the limit when some records are not shown.** The hint no longer suggests an unsupported `--page` option. Reading the list or an individual record does not create another run; the JSON list still contains `hasMore`. - **`chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") displays a saved group even if it is absent from the latest login delta.** Previously, the read could fail with “chat not found”. Unknown settings and links now stay empty; reading changes nothing in the group. - **`max messages transcribe`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-transcribe "Command reference: max messages transcribe") finds a saved transcript by chat name when the model has not been downloaded.** Previously, it looked for text using the entered name instead of the chat ID and suggested downloading the model again. The full name or an unambiguous fragment now returns saved text without downloading the recording or recognizing it again. See [voice messages](/llms.mdx/docs/max/usage/content.md). - On Windows, the generator uses Node instead of directly launching `.cmd`; documentation checks recognize Windows paths. Unix-permission tests do not require them on Windows, where ACLs control access. - **`max bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") errors before an action starts follow the bot profile’s recording settings, even with `--timeout` before the command.** Previously, a global option before `bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") could cause personal-account settings to apply. When bot-profile recording is disabled, a command-parsing error no longer creates a record against that setting.## 0.23.0 — 03.10.2026 [#0230--03102026]**### Added [#added-1]- **`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") and chat-management commands save names and chats in shared local storage.** The old profile cache is no longer opened. A complete chat list marks departed chats; an empty response preserves the previous list. - **Contact commands and shared read commands save data in shared local storage.** Name resolution and `contacts sync`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-sync "Command reference: max contacts sync") no longer require the old profile cache; synchronization still returns counts only. Deleting the old file does not reset the sync position. Run `max contacts sync`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-sync "Command reference: max contacts sync") to fetch the complete list again. - **`max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") releases its search model after 10 minutes without searches.** Agent `conversations_search` no longer holds about 1 GB throughout the session. The next search reloads the model in about a second (cli-messaging 0.110.0). - **Chat and person completion uses the selected account's shared store.** The old cache is unnecessary. Tab still never connects to MAX; bot commands suggest chats from their local list. - **`max mcp setup codex|claude-code`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp-setup "Command reference: max mcp setup") and `max mcp doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp-doctor "Command reference: max mcp doctor")** add local MCP to the selected client and check startup and available tools. Installation requires `--allow-writes` if the profile offers writes; this approval changes no permissions and does not verify MAX login. - **`max <бот> bot store fetch <чат>`** downloads history to the bot's local store, newest first, with resumable runs. `--last`, `--since-time`, `--limit`, `--page-size`, `--pause` work like `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch"). - **`--yes` for any command** approves a write prompt required by consent level `ask`; `max account sessions end --others --yes`[↗](/llms.mdx/docs/max/commands/content.md#max-account-sessions-end "Command reference: max account sessions end") works as before.**### Changed — may break scripts [#changed--may-break-scripts-2]- **`messages send --topic`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") and `polls create --topic`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-create "Command reference: max polls create") clearly reject MAX destinations.** This shared option addresses Telegram forum topics, unsupported by MAX. No message or poll is sent; ordinary calls without `--topic` are unchanged. - **`max doctor --json`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") reports the shared store in `store`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store") and the old file in `legacyCache`.** It no longer opens the old cache or checks its schema. Scripts reading `cache` must switch to `store`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store"). Delete old files manually and fetch history with `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch"). - **MCP reads the shared message store.** Search, contacts, chat resources and transcripts use `messages.db` under the profile account. The old cache is no longer opened. Reading history saves searchable messages. Voice attachments have `kind: "voice"`. Tool names and parameters are unchanged. - **`inbox`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox") and `review`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") use shared command and message formats.** Replace `--since` with `--since-time`. `review --unanswered`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") accepts durations (`4h`, `1d`), not a number of hours. JSON voice attachments use `kind: "voice"` instead of `"audio"`. `--all` includes muted and archived chats. The first inbox run migrates the previous `inbox --new`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox") position. Review pages backwards and returns at most 300 messages per chat, marking incomplete results. Update script commands and JSON checks. - **Personal-account transcripts are saved in shared storage.** `messages transcribe`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-transcribe "Command reference: max messages transcribe"), `inbox`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox"), `review`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") and MCP use the same account-scoped text as `messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list"). Old profile-cache transcripts are not migrated; an explicit `--transcribe` request recreates them using a downloaded model. - **`max <бот> bot people show` becomes `max <бот> bot contacts show`**, with MCP tool `max_bot_contacts_show`. Together with `bot messages search|between`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages "Command reference: max bot messages"), these commands are shared with `tg`; options and responses are unchanged. - **`max <бот> bot chats check` becomes `max <бот> bot chats moderate`**, shared with `tg`. `--since` becomes `--since-time`, still accepting `2h`, `1d`. JSON changes from a list to `{ chatId, rows }`; MCP tool is `max_bot_chats_moderate`. Rules and check positions remain in the same files. Consent `flag` now behaves like `confirm`: ask, or proceed with `--allow-dangerous`. - **`max <бот> bot mcp` grants access according to bot profile settings, rather than flags.** Without flags, agents can write unless `readOnly: true` or `allow` restricts them. Deletion uses a confirmation form; `--allow-dangerous` removes it. `--allow-send`, `--allow-delete` and `--allow-moderate` are accepted with warnings but grant nothing. Set `readOnly: true` to retain read-only access. The server is now shared with `tg`. - **`max bot messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search") matches words, best matches first**, instead of substrings newest first; use `--newest` for the old order. All words are required. `"фраза"`, `-слово`, `а OR б` and filters `from:`, `chat:`, `after:`, `before:`, `has:` are supported; typos are corrected with a stderr notice. Words need not be quoted; `--from` remains repeatable. Bot search does not support `in:`; it searches its own copy and copies permitted by `readOtherBots`.**### Fixed [#fixed-1]- **Bot write rejections suggest a valid configuration command with `--bot`.** Read-only failures suggest disabling `readOnly`; missing `allow` permissions suggest adding the action while retaining existing permissions. Previously the hint named nonexistent `bot config`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot").## 0.22.0 — 02.10.2026 [#0220--02102026]Most personal-account commands are now shared with tg: identical options and `--json` responses, and one shared store. Many names changed; see “Changed — may break scripts”. The previous max cache is not migrated. After upgrading, run commands without `--offline` and download history again with `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch").**### Added [#added-2]- **`max conversations search "<запрос>"`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-search "Command reference: max conversations search")** finds semantically related conversations in one or all chats. Download `max models text download e5-small`[↗](/llms.mdx/docs/max/commands/content.md#max-models-text-download "Command reference: max models text download") once (135 MB, shared with `tg`), then use `max conversations embed --chat <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-embed "Command reference: max conversations embed") to calculate vectors locally. `embed status` reports remaining work; `embed clear` deletes vectors. With `--provider openai` and your key (`max models text key set openai`[↗](/llms.mdx/docs/max/commands/content.md#max-models-text-key-set "Command reference: max models text key set")), an external service computes vectors; `embed` first reports token count and cost and asks for approval. - **Direct-chat `chats list --json`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") includes `providerMetadata.partnerId`**, identifying the other person. Shared commands use it because MAX chat IDs and participant IDs differ. - **`max messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-search "Command reference: max messages search") can search other accounts in shared storage:** query `in:max`, `in:personal`, `in:bots`, `in:all` or use `--source`. Otherwise it searches the current account as before. - **`max conversations build|list|show`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations "Command reference: max conversations") and `max messages links`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-links "Command reference: max messages links")** find group conversations locally from replies, mentions and message order without querying MAX. **`conversations batches status|next`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-batches "Command reference: max conversations batches") and `conversations links add|clear`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations-links "Command reference: max conversations links")** provide agent batches and accept its responses. - **`max server logs`[↗](/llms.mdx/docs/max/commands/content.md#max-server-logs "Command reference: max server logs"), `max server install`[↗](/llms.mdx/docs/max/commands/content.md#max-server-install "Command reference: max server install"), `max server uninstall`[↗](/llms.mdx/docs/max/commands/content.md#max-server-uninstall "Command reference: max server uninstall")**, matching tg. `install` writes a systemd (Linux) or launchd (macOS) service without starting it; `max server start`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start") and `stop` then use the service. Authentication rejection does not restart the service, avoiding repeated logins. `max server start --idle`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start") and `restart --idle` remain supported. - **`max store status`[↗](/llms.mdx/docs/max/commands/content.md#max-store-status "Command reference: max store status")** reports per-chat message counts and complete downloaded ranges. **`store fetch --background`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch")** and **`store jobs list|show|cancel`[↗](/llms.mdx/docs/max/commands/content.md#max-store-jobs "Command reference: max store jobs")** manage background downloads. **`store info|check|migrate|backup|restore|reindex`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store")** maintain the shared store. **`store clear --left --allow-dangerous`[↗](/llms.mdx/docs/max/commands/content.md#max-store-clear "Command reference: max store clear")** deletes departed chats and messages. - **`max bot auth`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-auth "Command reference: max bot auth"), `max bot list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-list "Command reference: max bot list"), `max bot chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats-list "Command reference: max bot chats list"), `max bot recipients`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-recipients "Command reference: max bot recipients") and `max bot sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-sends-list "Command reference: max bot sends list") are shared with tg** through cli-messaging, with identical responses and hints. Tokens, recipients and logs retain their locations. - **`max cache clear --left`** deletes only departed chats and their messages from the profile cache. - **`max messages search --regex`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-search "Command reference: max messages search")** searches saved text with a regular expression. **`messages show|context msg:…`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages")** accepts a search locator without a separate message ID. - **`max polls show <чат> <сообщение>`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-show "Command reference: max polls show")** reads a poll, answer IDs and vote counts without changing anything. - **`max polls create --send-id`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-create "Command reference: max polls create")** safely retries poll creation after a missing response without creating a second poll. - **`max messages send --photo <путь>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send")** sends `.jpg .png .webp` as a photo, like tg. `send` also exposes `--no-preview`, but rejects it because MAX does not support it. - **`max skill install`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install")** installs a versioned agent skill into `~/.claude/skills/max-cli/` for Claude Code and `~/.agents/skills/max-cli/` for Codex and Gemini CLI. Use `--for claude` or `--for agents` for one destination. `max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show") is unchanged. - **Agents automatically learn about the skill.** With `AI_AGENT` or `CLAUDECODE` set, a missing or outdated skill produces a once-daily stderr hint for `max skill install`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-install "Command reference: max skill install"), without affecting stdout. Disable with `max config set skillHint false --defaults`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set"). - **`max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") and `max bot mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-mcp "Command reference: max bot mcp") expose `max://skill`** and mention it in agent instructions. - **`max messages delete`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-delete "Command reference: max messages delete") returns `operationId`**, also found in `max sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list"). MCP `max_messages_delete` does too. Options are unchanged. - **Every send-log record includes `operationId`**, grouping records for one send, edit, deletion or chat change. For a message send, it equals `sendId`. - **Installation is about 16 MB smaller:** the database layer is bundled instead of installed separately. `max` commands are unchanged.**### Changed — may break scripts [#changed--may-break-scripts-3]- **`max messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-search "Command reference: max messages search") matches words, best results first.** Use `--newest` for the former newest-first order. Queries support `"фраза"`, `-слово`, `OR`, `from:`, `chat:`, `after:`/`before:` and `has:`. Typos are corrected with a stderr notice. `--context ` shows neighboring messages. JSON adds `match` and `score`. - **`max bot updates watch`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") becomes `max bot watch`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-watch "Command reference: max bot watch")**, matching tg and personal `max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch"). Without `--events`, only new messages appear; with it, each line identifies its event (`{ "event": "message" | "edit" | "delete" | "callback" | "joined" | … }`) instead of exposing raw MAX events. `--timeout` ends normally with code `0`. Read-only bot profiles may watch updates. Resume positions are unchanged. - **`bot webhooks list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-webhooks-list "Command reference: max bot webhooks list") returns `{ url, types }`**, not MAX-specific fields. `bot callbacks answer --text`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-callbacks-answer "Command reference: max bot callbacks answer") no longer reads stdin through `-`. `bot commands`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-commands "Command reference: max bot commands"), `bot callbacks`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-callbacks "Command reference: max bot callbacks") and `bot webhooks`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-webhooks "Command reference: max bot webhooks") are shared with tg. `webhooks set --secret-stdin` prompts only after permission checks. - **Node 22.16 or later is required**, or Bun as before. If Linux Node uses an outdated system SQLite, `max` restarts using bundled SQLite from `@leemour/cli-messaging-sqlite` before reading or sending. Official Node builds and Bun need no change. - **`max store`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store") is shared between tg and max.** `store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") writes to shared storage and pages MAX as before: 30 messages, 5–10-second pauses, up to 40 pages per run. This gives both messengers one store and consistent `messages`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages"), `conversations`[↗](/llms.mdx/docs/max/commands/content.md#max-conversations "Command reference: max conversations") and `store`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store") reads. The old cache is not migrated; refetch history. Also: * `store fetch --estimate`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") is rejected for MAX because message IDs cannot count missing records. * `store fetch|export --since`[↗](/llms.mdx/docs/max/commands/content.md#max-store "Command reference: max store") becomes `--since-time`, accepting time only, not message IDs. * `store fetch --max-pages `[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") becomes `--limit <сообщений>`, default 1,200 or forty 30-message pages. Page size uses `--page-size`. * `store export --format md`[↗](/llms.mdx/docs/max/commands/content.md#max-store-export "Command reference: max store export") becomes `--format markdown`; `jsonl` is unchanged. Missing ranges are reported by `store status`[↗](/llms.mdx/docs/max/commands/content.md#max-store-status "Command reference: max store status") rather than export stderr. Existing files are never overwritten. * `store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") no longer prints a ready-made export command. * If two messages share a millisecond and a page boundary separates them, `store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") can rarely miss the earlier one. - **`max messages list|show|context|search`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages") are shared with tg.** `--offline` and `search` read the shared store, providing the same options and responses. At this release, `max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") message and chat readers still use the old max cache, so MCP and terminal offline results may differ. The new store fills after an online run; old max data and transcripts are not migrated. Also: * Voice attachments use `"kind": "voice"`, not `"audio"`; `inbox`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox") and `review`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") still use `"audio"` in this release. * `messages list --before`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") and `--after` split into `--before-id`, `--before-time`, `--after-id`, `--after-time`; `messages context`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-context "Command reference: max messages context") uses `--before-n`, `--after-n`. Old options produce unknown-option errors. * `messages list --before-id`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") excludes its anchor. Offline, it requires a locally stored message ID. * `messages list --transcribe --json`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") omits `transcribeProblem`; stderr explains failures. Offline, `unheard` is empty. Audio uses a separate connection, causing a second MAX login with `--no-serve`. * Speech models are found in `~/.cache/cli-common/models/audio`, shared with tg. Redownload or move models from `~/.cache/max-cli/models/audio`. * `messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-search "Command reference: max messages search") matches words and prefixes (`квартир` finds “квартира”), rather than arbitrary three-letter substrings. `--chat` accepts a stored chat title. - **`max chats list|show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") and `max contacts list|show`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts "Command reference: max contacts") are shared with tg.** Offline reads use shared storage with identical options and responses. It fills after the first online run; the old cache is not migrated, so initial offline reads return `not_found`. Also: * `chats list --search|--kind|--unread`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") checks the 200 newest chats online and reports older chats on stderr; offline it checks all stored chats. * `chats show --offline`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") omits `description`, `access`, `settings`, available only from MAX. * Invalid `--kind` values now report `--kind is one of dialog, group, channel, saved`. * `cache clear` also clears this account from shared storage; `contacts sync`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-sync "Command reference: max contacts sync") fetches everything into it. - **`max messages send|edit|forward`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages") are shared with tg.** JSON `send` returns `{sendId, operationId, message}`, plus `scheduledFor` with `--at-time`; `forward` also returns `{sendId, operationId, message}`; `edit` returns `{operationId, message}`, instead of an unwrapped message. MCP `max_messages_send`, `max_messages_edit`, `max_messages_forward` match. `max_messages_edit` drops `markdown`; `max_messages_forward` drops `send_id`. Read the message under `message` rather than at the root. `send` supports one `--file` and one `--photo`, not repeated files. An unknown scheduled-send outcome suggests `messages scheduled`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-scheduled "Command reference: max messages scheduled") without naming the chat. - **`max polls`[↗](/llms.mdx/docs/max/commands/content.md#max-polls "Command reference: max polls") is shared with tg.** `polls vote|close --json`[↗](/llms.mdx/docs/max/commands/content.md#max-polls "Command reference: max polls") returns `{operationId, poll}`, with `poll` shaped as `{chatId, messageId, question, answers: [{id, text, voters, chosen}], closed, multiple, anonymous, voters}`. `polls create`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-create "Command reference: max polls create") returns `{sendId, operationId, message}`. MCP `max_polls_vote`, `max_polls_close`, `max_polls_create` match. `max_polls_create` replaces `revote` with `silent`. - **Reactions, pins and read receipts share tg's JSON format**, including `operationId`: * `reactions add|remove`[↗](/llms.mdx/docs/max/commands/content.md#max-reactions "Command reference: max reactions"): `{operationId, chatId, messageId, reaction}`, your reaction or `null`; message counts remain available through `messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list"). * `messages pin|unpin`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages"): `{operationId, chatId, messageId, pinned}`, with `pinned` as `true` or `false`. * `chats mark-read`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-mark-read "Command reference: max chats mark-read"): `{operationId, chatId, until}`, with `null` meaning through the latest message. MCP `max_reactions_add`, `max_reactions_remove`, `max_messages_pin`, `max_messages_unpin`, `max_chats_mark_read` match. - **`max messages unpin <чат> <сообщение>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-unpin "Command reference: max messages unpin")** now requires a message ID, like tg and pin. MAX has one pin and removes it regardless of the supplied ID. MCP `max_messages_unpin` also requires `message`. Calls to `messages unpin <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-unpin "Command reference: max messages unpin") must add any message ID from that chat. - **`max serve --detach`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") and `max serve --stop`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") are removed**, replaced by `max server start`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start") and `max server stop`[↗](/llms.mdx/docs/max/commands/content.md#max-server-stop "Command reference: max server stop"). `serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") handles foreground work; `max server`[↗](/llms.mdx/docs/max/commands/content.md#max-server "Command reference: max server") controls background work. Update scripts and manually written services. - **`max server status --json`[↗](/llms.mdx/docs/max/commands/content.md#max-server-status "Command reference: max server status") matches tg:** `byHand` becomes `by` (`hand`, `command`, `server`[↗](/llms.mdx/docs/max/commands/content.md#max-server "Command reference: max server"), `unit`), with added `log`, `unit`, `stale` for a crashed server's marker. `max server start`[↗](/llms.mdx/docs/max/commands/content.md#max-server-start "Command reference: max server start"), `stop`, `restart` return `{ started, by, pid, startedAt, log }` and `{ stopped, by, pid }`; `socket` is removed. - **`max messages send --at`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") becomes `--at-time`**, consistent across time-taking commands. Scripts using `--at` receive unknown-option errors. MCP `max_messages_send` parameter `at` remains unchanged. - **`--markdown` is removed in favor of `--md`** for sending, `messages edit`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-edit "Command reference: max messages edit") and all formatting reads. Update scripts using the old name. - **`max sends list --json`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list") renames `cid` to `sendId`, a string instead of a number**, matching `outcome_unknown` and `--send-id`. Older records are displayed in the new format too. - **Run events (`--trace`, `--record`, `max runs show`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-show "Command reference: max runs show")) use the shared tg/max format.** Send IDs are `send`, not `cid`; MAX error keys are `providerError`, not `maxError`, in events, `run.json` and error `details`. - **`max bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") returns `outcome_unknown` (code `14`) for write responses 502, 503 or 504**, previously `provider_unavailable` (code `12`). Gateway responses do not prove whether MAX executed the request; it may have succeeded. Scripts retrying code `12` could duplicate writes. For code `14`, check the result first. Reads still retry and return `provider_unavailable`. - **Bot commands use shared tg names; old names are removed.** `max bot messages get <сообщение>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages "Command reference: max bot messages") → `messages show <чат> <сообщение>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-show "Command reference: max messages show"); `messages edit|delete`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages") also take chat first. `bot chats get`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats "Command reference: max bot chats") → `chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show"); `bot chats pin|unpin`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats "Command reference: max bot chats") → `messages pin|unpin <чат> <сообщение>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages"). `--format markdown|html` becomes `--md` or `--html`. `--type` is removed: use `--photo`, `--voice`, or `--as-file` for video documents. `chats action`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") accepts `typing`, `photo`, `video`, `voice`, `file`. Sends and edits return `{ operationId, message }`. Deletion asks for approval; `--allow-dangerous` supplies it. MCP names are `max_bot_chats_show`, `max_bot_messages_show`, `max_bot_messages_pin`, `max_bot_messages_unpin`. - **`max bot members`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") and `max bot admins`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") become `max bot chats members`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats-members "Command reference: max bot chats members") and `max bot chats admins`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats-admins "Command reference: max bot chats admins")**, matching tg. `admins add` replaces `--permissions` with `--can`, accepting `max chats admins add`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-admins-add "Command reference: max chats admins add") words (`read`, `members`, `admins`, `info`, `pin`, `link`, `edit`, `delete`), and `--alias` with `--title`. Calls/statistics permissions are unavailable. `admins list` returns `{ id, name, username, role, rights, title }`. MCP: `max_bot_chats_members_list|add|remove`, `max_bot_chats_admins_list`. - **Local-only changes are now classified as writes.** `config set`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set"), `unset`, `chats rules set`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-rules-set "Command reference: max chats rules set"), `unset`, `recipients add`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients-add "Command reference: max recipients add"), `remove`, `clear`, and bot `auth set`, `remove`, `chats rules set`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-rules-set "Command reference: max chats rules set"), `unset`, `recipients add`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients-add "Command reference: max recipients add"), `remove`, `clear` write configuration, rules, recipient lists or keyring entries, never MAX. The [Command reference](/llms.mdx/docs/max/commands/content.md) labels them “Changes data only on this computer”; `max commands`[↗](/llms.mdx/docs/max/commands/content.md#max-commands "Command reference: max commands") shows them in `writes`. Read-only filters using `max commands --json`[↗](/llms.mdx/docs/max/commands/content.md#max-commands "Command reference: max commands") now exclude them.**### Fixed [#fixed-2]- **Time-based `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch") no longer skips a boundary message** and stops if MAX repeatedly returns the same page. - **`max messages list --before-time`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") excludes messages at the exact millisecond boundary:** before means strictly earlier. - **`max messages list --after-id`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") (0.21.0: `--after `) reports a next page when present**, instead of always claiming none for forward reads. - **`max messages send --voice`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") works through `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve").** Previously its waveform was lost, causing MAX `proto.payload`, code `11`. It already worked with `--no-serve`. - **`max chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") and `max chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") remove departed chats** on the next login returning a complete MAX chat list. Previously they remained with stale member counts. Messages remain until `max cache clear --left`. `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") detects departure only on its next full login. - **`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") no longer confuses responses after prolonged use.** Two-byte request numbers wrap after 65,536 requests; pending numbers are now skipped to avoid assigning another request's response.## 0.21.0 — 30.09.2026 [#0210--30092026]**### Changed — may break scripts [#changed--may-break-scripts-4]Commands follow one naming rule: resource, then action. Old names return “unknown command” or “unknown option”, code `1`, without performing anything.- **`max backup messages` → `max store fetch`[↗](/llms.mdx/docs/max/commands/content.md#max-store-fetch "Command reference: max store fetch").** Download starts immediately; `--estimate` only calculates (previously downloading required `--run`). Each run still handles up to `--max-pages` pages, default 40, with the same pauses. `--pause` requires a duration (`5s`, `500ms`); unitless numbers refuse. `--since` and `--last` are optional: repeated runs otherwise reach the beginning, resuming where they stopped. - **`max export messages` → `max store export`[↗](/llms.mdx/docs/max/commands/content.md#max-store-export "Command reference: max store export").** - **`--cid` → `--send-id`** for `messages send`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") and `messages forward`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-forward "Command reference: max messages forward"). `outcome_unknown` uses `sendId`; MCP `max_messages_send` and `max_messages_forward` rename `cid` to `send_id`. - **`max chats read`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") → `max chats mark-read`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-mark-read "Command reference: max chats mark-read")**; MCP `max_chats_read` → `max_chats_mark_read`. - **`max chats settings`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") is removed.** `max chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") displays `settings`, `description`, `access`; `max chats link show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-link-show "Command reference: max chats link show") still displays invites. Change settings with `max chats update <чат> --all-can-pin on|off`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-update "Command reference: max chats update") and other flags. - **`max update` → `max upgrade`[↗](/llms.mdx/docs/max/commands/content.md#max-upgrade "Command reference: max upgrade")**, including update hints. - **`max recipients off`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients "Command reference: max recipients") → `max recipients clear`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients-clear "Command reference: max recipients clear")**, response `off` → `cleared`; **`max bot recipients off`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-recipients "Command reference: max bot recipients") → `max bot recipients clear`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-recipients-clear "Command reference: max bot recipients clear")**. - **`max account sessions end-others`[↗](/llms.mdx/docs/max/commands/content.md#max-account-sessions "Command reference: max account sessions") → `max account sessions end --others`[↗](/llms.mdx/docs/max/commands/content.md#max-account-sessions-end "Command reference: max account sessions end")**; omitting `--others` refuses.**### Added [#added-3]- **`max complete`[↗](/llms.mdx/docs/max/commands/content.md#max-complete "Command reference: max complete") appears in `max --help`**, making Tab setup discoverable. - **[Browser access guide](/llms.mdx/docs/max/remote/content.md): ChatGPT or Claude** through a password-authenticated proxy and public Tailscale address without a domain. Based on documentation, not tested end to end.## 0.20.0 — 30.09.2026 [#0200--30092026]**### Changed — may break scripts [#changed--may-break-scripts-5]- **Shared storage upgrades to schema 6** (cli-messaging 0.49.0). The first `max` run upgrades `messages.db`. Older tg versions then refuse the file; install the same-day or newer release with `npm install -g @leemour/tg-cli@latest`. MAX commands are unchanged. - **`--all-bots` requires permission to read other bots.** Configure `readOtherBots` in `bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") with `max <имя> config set --bot readOtherBots true`, or a profile list. Otherwise the command refuses with code `5` and an enabling command. - **Ambiguous person candidates are sorted by name**, unnamed people first, instead of cache order. Error wording is unchanged.**### Added [#added-4]- **`--bots news,support`** for `bot messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search"), `bot people show`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot"), `bot messages between`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-between "Command reference: max bot messages between") reads only those profiles if permitted by `readOtherBots`. `bot messages search`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search") also supports `--all-bots`. - **`bot mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-mcp "Command reference: max bot mcp") exposes `all_bots` and `bots`** for these three tools only when cross-bot reads are allowed. - **People are isolated per bot.** A person seen by one bot is unavailable to another without `--all-bots` or `--bots`. - **Bot text search matches three-letter substrings inside words** (`вартир` finds “квартиру”), like personal search in this release.## 0.19.0 — 28.09.2026 [#0190--28092026]**### Changed — may break scripts [#changed--may-break-scripts-6]- **Closing polls through `max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") requires `edit`**, rather than `reaction`. Closing edits the poll message, and `max polls close`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-close "Command reference: max polls close") already required `edit`; agent and human permissions now agree. With restricted `allow`, add `edit` to expose `max_polls_close`. Unrestricted profiles are unchanged. See [MCP guide](/llms.mdx/docs/max/mcp/content.md).**### Fixed [#fixed-3]- **`max mcp --confirm-send`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") starts when only `mcpTools` enables writes.** Previously it required an `--allow-*` flag, potentially leaving contacts, groups and profile changes without confirmation. Without `--confirm-send`, behavior is unchanged; add it to approve each change. - **`max <бот> bot messages search --limit N` reports further matches.** Previously `hasMore: false` was always returned and `limit` came from configuration instead of `N`, causing scripts and agents to stop early. Now `hasMore: true` is returned when matches exceed `N`.## 0.18.1 — 28.09.2026 [#0181--28092026]**### Fixed [#fixed-4]- **`max contacts rename`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-rename "Command reference: max contacts rename") appears immediately** in `contacts show`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-show "Command reference: max contacts show") and direct-chat titles. Previously names remained stale until background `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") logged in again because it ignored the returned contact. If still stale, the first 0.18.1 command replaces the old server.## 0.18.0 — 28.09.2026 [#0180--28092026]**### Added [#added-5]- **Account-changing tools in `max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp"):** add, remove, rename and block contacts; close your poll; join, leave and create groups; appoint and remove admins; change profile name and description. Previously MCP only read and sent messages. Only the owner enables them through `mcpTools`, for example `max config set mcpTools contacts,polls`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set"); agents cannot self-enable through flags. Every action passes `readOnly`, `allow` and logging. See [MCP guide](/llms.mdx/docs/max/mcp/content.md). - **Bot file uploads appear in `--trace` and run records.** `bot messages send --file`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-send "Command reference: max bot messages send") and `bot uploads put`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-uploads-put "Command reference: max bot uploads put") show two lines with file type, size, HTTP status and duration. Upload URLs and filenames are never displayed or logged.**### Fixed [#fixed-5]- **`max contacts rename`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-rename "Command reference: max contacts rename") actually changes names.** MAX previously returned success without changing anything when `lastName` was omitted. It is now always sent, `null` when absent, matching the web client. Repeat `contacts rename`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-rename "Command reference: max contacts rename") attempts made through 0.17.x.## 0.17.1 — 28.09.2026 [#0171--28092026]**### Fixed [#fixed-6]- **Invalid `--limit`, `--last`, `--max-pages` errors repeat your input** for `messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list"), `inbox`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox"), `backup`, `sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list") and bots. `--limit abc` previously reported `NaN`; 0.17.0 fixed only paginated lists. - **`runs list`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-list "Command reference: max runs list") and `sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list") truncated by `--limit` report `hasMore: true`** and the requested limit rather than a misleading `hasMore: false`, preventing scripts from stopping early. - **Renamed contacts use your chosen name**, matching the MAX app, instead of the person's own name after `contacts rename`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-rename "Command reference: max contacts rename") or an app rename.## 0.17.0 — 28.09.2026 [#0170--28092026]**### Changed — may break scripts [#changed--may-break-scripts-7]- **Every JSON list becomes `{items, page, limit, hasMore}` rather than an array.** Applies to `account sessions list`[↗](/llms.mdx/docs/max/commands/content.md#max-account-sessions-list "Command reference: max account sessions list"), `chats members list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-members-list "Command reference: max chats members list"), `chats folders list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-folders-list "Command reference: max chats folders list"), `messages scheduled`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-scheduled "Command reference: max messages scheduled"), `messages download`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-download "Command reference: max messages download"), `messages context`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-context "Command reference: max messages context"), `models audio list`[↗](/llms.mdx/docs/max/commands/content.md#max-models-audio-list "Command reference: max models audio list"), `recipients list`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients-list "Command reference: max recipients list"), `sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list"), `runs list`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-list "Command reference: max runs list"), `chats check`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats"), `chats events`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-events "Command reference: max chats events") and all bot lists. Previously there were three shapes, including `{events, more}`. Read `.items`. Unpaginated lists use page 1 and returned count as limit. `bot members list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") and `bot admins list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") also return `marker`; `user_id` becomes a string. `bot messages get`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages "Command reference: max bot messages") returns the message rather than a one-element array. `--jsonl` and human tables are unchanged. MCP matches; `page`, `limit` and `hasMore` are part of the shared list wrapper.**### Added [#added-6]- **`max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") and `max config show`[↗](/llms.mdx/docs/max/commands/content.md#max-config-show "Command reference: max config show") include bots** in all local profiles, marked personal, bot or both. `doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") shows bot token source, seen-chat count and paths; `doctor --online`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") identifies the bot through the API. Bot profiles now receive appropriate `max <имя> bot …` hints rather than `session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start"). - **MCP `max_status` and `max_bot_status`** report the server profile, token presence and enabled writes. Neither writes; `max_status` never logs into MAX. - **Tab completion understands bots**, suggesting their seen chats and all profile names, including bot profiles. - **Bot commands support diagnostics like personal commands.** `max <имя> bot … --trace` prints each request's operation, chat/message, HTTP status and duration. `--record` saves runs; failures save automatically. Read with `max runs list`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-list "Command reference: max runs list"), `max runs show`[↗](/llms.mdx/docs/max/commands/content.md#max-runs-show "Command reference: max runs show"). File uploads (`--file`) were not recorded until 0.18.0. - **Separate `personal` and `bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") settings**, each with `defaults` and `profiles`. `max config set --personal|--bot`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set") writes sections; `max config show --bot`[↗](/llms.mdx/docs/max/commands/content.md#max-config-show "Command reference: max config show") shows bot values and source keys such as `config file: bot.profiles.test`[↗](/llms.mdx/docs/max/commands/content.md#max-config "Command reference: max config"). More specific values win: section profile, profile, section defaults, global `defaults`. Old files retain behavior. See [Configuration](/llms.mdx/docs/max/configuration/content.md). - **Optional bot hourly limits:** `max <имя> config set --bot sendsPerHour 200`. Bots remain unlimited by default. - **`max config set defaultProfile <имя>`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set")** chooses the implicit profile, previously always `default`. - **Profile photos, custom contact names and blocking.** `max account update --photo <файл>`[↗](/llms.mdx/docs/max/commands/content.md#max-account-update "Command reference: max account update") changes your photo; `max contacts rename <кто> <имя> [фамилия]`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-rename "Command reference: max contacts rename") sets a name visible only to you; `max contacts block <кто>`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-block "Command reference: max contacts block") and `unblock` work even outside contacts. Safeguards match `account update`[↗](/llms.mdx/docs/max/commands/content.md#max-account-update "Command reference: max account update") and `contacts add`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-add "Command reference: max contacts add"). Renaming did not actually work in this version; fixed in 0.18.0. - **Channels:** `max chats create <название> --channel`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-create "Command reference: max chats create") creates a private channel. Invite with `max chats link show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-link-show "Command reference: max chats link show"); direct addition may be rejected by MAX. - **Admin read and invite-link rights:** `max chats admins add <чат> <кто> --can read,link`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-admins-add "Command reference: max chats admins add"). A bot without `read` cannot read group messages. - **Relative times** for `--since`, `--before`, `--after`: `30m`, `2h`, `1d`, as in `max review --since 1d`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review"), replacing the former exact-time requirement.**### Fixed [#fixed-7]- **Your chat changes appear immediately.** After `max chats update`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-update "Command reference: max chats update"), `chats settings`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats"), `chats link reset`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-link-reset "Command reference: max chats link reset"), `chats show`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show") and `chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list") previously showed old titles for minutes because MAX does not echo changes and `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") ignored the returned chat. It now applies it as it already did sent messages. - **`max export messages` no longer warns about missing history before 1970-01-01 after a complete `backup`.** - **Invalid `--limit` and `--page` errors show the original input**, not `NaN`. - **Reset invite links in `chats inspect`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-inspect "Command reference: max chats inspect") and `chats join`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-join "Command reference: max chats join") return not found** (`not_found`, code 6) instead of an opaque MAX opcode rejection. Update scripts expecting another code. - **`max config show`[↗](/llms.mdx/docs/max/commands/content.md#max-config-show "Command reference: max config show") and `max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") omit phantom `<имя>.moderation` profiles**, previously confused with moderation-rule files. - **Unknown subcommands name the unknown word, not the profile.** `max work bot auth status` now identifies `status`, not `work` as a profile-parsing issue. - **`max config show`[↗](/llms.mdx/docs/max/commands/content.md#max-config-show "Command reference: max config show") displays `transcribeModel`**, previously omitted.**### Removed [#removed]- **Join requests: `max chats requests list|accept|decline`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats"), `requests`, `consent.accept`, `consent.decline`.** MAX has public or invite-only groups without approval, so the commands promised nonexistent functionality. Old rule files remain readable; the next write removes obsolete fields. Calls to `chats requests`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") return unknown-command errors.## 0.16.0 — 27.09.2026 [#0160--27092026]**### Added [#added-7]- **Bot people and conversations:** `max <имя> bot people show <кто>` shows where someone posted and their direct chat; `bot messages search --from <кто>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search") finds posts by people; `bot messages between <кто> <кто>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-between "Command reference: max bot messages between") finds chats where everyone posted. All data comes from this computer's seen messages; `--all-bots` reads all bot copies. - **Bot group checks:** `max <имя> bot chats check <чат>` applies `bot chats rules show|set|unset`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-chats-rules "Command reference: max bot chats rules") to messages and members, using joins saved by `bot updates watch`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot"). Removed people cannot return through invites unless `--no-ban` is used; Bot API cannot undo the ban. Account ages are unavailable, so those rules do not run. - **Polls:** `max messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") displays questions, IDs in `[скобках]`, votes and your ✓. `max polls vote <чат> <сообщение> <вариант>…`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-vote "Command reference: max polls vote") votes, `--retract` withdraws, `max polls close`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-close "Command reference: max polls close") closes your poll, `max polls create`[↗](/llms.mdx/docs/max/commands/content.md#max-polls-create "Command reference: max polls create") creates one. MCP `max_polls_vote`, `max_polls_create` require `--allow-send`. Invalid closed polls, excess choices or disallowed revotes refuse locally. web.max.ru does not display polls; creation warns about it. - **`max <имя> bot mcp`** connects an agent to a bot, read-only by default in this release. Writes require `--allow-send`, `--allow-delete`, `--allow-moderate`, with `--confirm-send` for forms. Commands enforce recipients and logs; rule actions needing confirmation share one form. See [Bot MCP](/llms.mdx/docs/max/bot/content.md#%D0%B1%D0%BE%D1%82-%D0%B4%D0%BB%D1%8F-%D0%B0%D0%B3%D0%B5%D0%BD%D1%82%D0%B0-mcp).**### Changed — may break scripts [#changed--may-break-scripts-8]- **`max bot api get-updates`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api-get-updates "Command reference: max bot api get-updates") uses `--poll-timeout`** for its API `timeout`. Previously `--timeout` was consumed as the whole-command budget and never reached MAX. Update long-poll scripts.**### Fixed [#fixed-8]- **Automatically started `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") is replaced on the first newer-version command**, rather than rejecting new operations, such as voting, until `max server stop`[↗](/llms.mdx/docs/max/commands/content.md#max-server-stop "Command reference: max server stop"). - **A different build with the same version also replaces its server.** A manually started server rejects unfamiliar operations with a `max server stop`[↗](/llms.mdx/docs/max/commands/content.md#max-server-stop "Command reference: max server stop") hint. - **`max bot api get-updates --limit …`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api-get-updates "Command reference: max bot api get-updates") works**, rather than interpreting the API limit as a CLI configuration setting.## 0.15.0 — 27.09.2026 [#0150--27092026]**### Added [#added-8]- **`max chats check <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats")** checks messages and joins since the last run against `max chats rules`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-rules "Command reference: max chats rules"), then reports, deletes messages or removes members as allowed. Default is report-only; `--dry-run` only plans, at most 10 actions per check. Deletion/removal uses normal safeguards. Join-request actions were only planned here, then removed in 0.17.0 because MAX has none. See [Groups](/llms.mdx/docs/max/groups/content.md). - **Agent moderation:** `max mcp --allow-moderate`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") exposes `max_chats_check`; `max_chats_events`, `max_chats_members`, `max_chats_rules` are always available read-only. Without the flag, checks are absent. Required approvals use one form. - **Roles and invites:** `max chats members list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-members-list "Command reference: max chats members list") labels `owner`, `admin`, `member`; `max chats link show <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-link-show "Command reference: max chats link show") shows invites. - **Personal-account video and voice:** `max messages send <чат> --file ролик.mp4`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") sends in-chat video (`.mp4 .mov .webm .mkv`); `max messages send <чат> --voice заметка.ogg`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") sends voice with waveform and duration. Use `--as-file` for the old video-document behavior. Voice requires Ogg Opus; other formats receive an `ffmpeg` conversion hint. See [Personal account guide](/llms.mdx/docs/max/usage/content.md). - **Inline voice transcripts:** `max messages list <чат> --transcribe`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") and `max inbox --transcribe`[↗](/llms.mdx/docs/max/commands/content.md#max-inbox "Command reference: max inbox") transcribe locally, shown with 🎤 or JSON `transcript`. MCP `transcribe: true` works in `max_messages_list`, `max_inbox`. Existing transcripts show without a flag; new ones require a downloaded model. - **More bot commands:** `max <имя> bot messages send --file <путь>` attaches images, video, audio or files; `bot uploads put`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-uploads-put "Command reference: max bot uploads put") uploads only. `bot members list|add|remove`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot"), `bot admins list|add|remove`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") manage membership; `bot comments list|get|send|edit|delete`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-comments "Command reference: max bot comments") handles channel comments; `bot callbacks answer`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-callbacks-answer "Command reference: max bot callbacks answer") handles buttons; `bot commands list|set|clear`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-commands "Command reference: max bot commands") manages menus; `bot webhooks list|set|delete`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-webhooks "Command reference: max bot webhooks") manages webhooks. See [Bots](/llms.mdx/docs/max/bot/content.md). `webhooks set` rejects another configured address because MAX delivers to both instead of replacing one. - **Bot local storage:** read, sent and received messages are saved. `max <имя> bot messages list <чат> --offline` and `messages get --offline`[↗](/llms.mdx/docs/max/commands/content.md#max-messages "Command reference: max messages") read without a network; `bot messages search <текст>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search") searches. Deletions performed by the bot or observed through `updates watch` remove local messages. Storage contains message text. - **`max <имя> bot updates watch`** prints events until Ctrl-C and saves messages, resuming on the next run. It does not work with a webhook and consumes updates unavailable to other readers; use only when no other reader needs the bot. - **Bot people:** `max <имя> bot people show <кто>` reports chats and latest direct messages; `--refresh` refetches from MAX. `bot messages search --from <кто>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-search "Command reference: max bot messages search") searches one author; `bot messages between <кто> <кто> …`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-between "Command reference: max bot messages between") finds shared conversations. `--all-bots` searches all copies; people accept ID, `@username` or name fragment.**### Changed — may break scripts [#changed--may-break-scripts-9]- **`max bot messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-messages-list "Command reference: max bot messages list") is oldest first**, matching personal lists, instead of newest first. Bot-sent messages are marked own messages. Scripts reading the first row as newest must change.**### Fixed [#fixed-9]- **`max review --transcribe`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") closes MAX before recognition:** audio downloads first, then connection closure, then the model. - **`max bot api edit-my-commands`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api-edit-my-commands "Command reference: max bot api edit-my-commands"), `subscribe`, `unsubscribe`, `get-upload-url` work**, rather than failing with “an account change without a known action”. - **Bot sends to positive IDs without `user:` suggest `user:<номер>`**, since the destination is probably a person. - **[Bot examples](/llms.mdx/docs/max/bot/content.md) omit fabricated chat IDs** and explain how to get real ones.## 0.14.0 — 27.09.2026 [#0140--27092026]**### Added [#added-9]- **`max bot`[↗](/llms.mdx/docs/max/commands/content.md#max-bot "Command reference: max bot") uses the official Bot API.** `max bot auth set`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-auth-set "Command reference: max bot auth set") verifies and stores its token separately in the keyring. Profiles go first: `max рабочий bot me`. `max bot me`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-me "Command reference: max bot me") shows the bot; `max bot api <операция>`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api "Command reference: max bot api") calls any of 33 operations with parameter flags and JSON bodies, generated from the [official schema](https://github.com/leemour/max-cli/blob/v0.25.0/docs/dev/bot-api-coverage.md). IDs above 2^53 are strings; scripts must treat them accordingly. - **Convenient bot commands:** `max <имя> bot messages send <чат> <текст>` accepts chat IDs, `user:<номер>` or a known title; `edit`, `delete`, `list`, `get` are available. `max <имя> bot chats list` lists seen chats; `chats get|pin|unpin|leave|action`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") manages them. `max bot list`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-list "Command reference: max bot list") lists profiles with bot tokens. MAX has no bot-chat listing, so the CLI remembers seen chats itself. - **Bot recipients and logs:** `max <имя> bot recipients add|list|remove|off`, `max <имя> bot sends list`. Every write, including `bot api`[↗](/llms.mdx/docs/max/commands/content.md#max-bot-api "Command reference: max bot api"), checks recipients. No hourly bot limit existed until 0.17.0. See [Bots](/llms.mdx/docs/max/bot/content.md). - **Group moderation data:** `max review --unanswered [часы]`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") finds questions unanswered by you or admins; `max review --chat <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") reviews one chat. `max chats events <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-events "Command reference: max chats events") shows joins, departures, additions and removals. `max chats members list <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-members-list "Command reference: max chats members list") returns all group/channel members with registration and last-seen times. `max chats rules show|set|unset <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-rules "Command reference: max chats rules") manages rules in one local file like configuration.**### Fixed [#fixed-10]- **MAX disconnections report the close code and reason.**## 0.13.0 — 26.09.2026 [#0130--26092026]**### Added [#added-10]- **`max review`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review") gathers commitments:** all messages, including yours, in chats active since the prior review, or 3 days without `--since`. `--transcribe` processes audio; the response gives the next review boundary. Incomplete data is explicitly marked; do not treat it as complete ([Review guide](/llms.mdx/docs/max/usage/content.md#%D0%BE%D0%B1%D0%B7%D0%BE%D1%80-%D0%BA%D1%82%D0%BE-%D0%BA%D0%BE%D0%BC%D1%83-%D1%87%D1%82%D0%BE-%D0%B4%D0%BE%D0%BB%D0%B6%D0%B5%D0%BD)). - **MCP `max_review` and `/review`** organize what you owe, await and need to clarify, checking work groups before declaring overdue items and drafting reminders. Reminders require approval ([MCP prompts](/llms.mdx/docs/max/mcp/content.md#%D0%BA%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D1%8B-%D0%B8-%D1%87%D0%B0%D1%82%D1%8B-%D0%BF%D0%BE-)). - **`max mcp config`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp-config "Command reference: max mcp config") prints configuration for Claude Desktop, Cursor and other clients**, with absolute paths for Windows and applications missing terminal `PATH` ([Connection guide](/llms.mdx/docs/max/mcp/content.md#%D0%BF%D0%BE%D0%B4%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5)). - **`max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") checks installation:** runtime, installation path, visibility in a new terminal, keyring/SQLite loading and downloaded speech models. Missing `PATH` entries receive PowerShell or `export` fixes. If `max` itself is absent, use `npx @leemour/max-cli doctor` ([Troubleshooting](/llms.mdx/docs/max/troubleshooting/content.md#max-%D0%BD%D0%B5-%D0%BD%D0%B0%D1%85%D0%BE%D0%B4%D0%B8%D1%82%D1%81%D1%8F-%D0%BF%D0%BE%D1%81%D0%BB%D0%B5-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B8)). - **`max doctor --online`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") checks MAX connectivity:** one login, one chat and MCP startup, without sending. - **`max models audio download`[↗](/llms.mdx/docs/max/commands/content.md#max-models-audio-download "Command reference: max models audio download") checks the model after download.** Missing-model errors explain its language and alternative models with sizes.**### Changed — may break scripts [#changed--may-break-scripts-10]- **MCP `max_messages_attachment` becomes `max_messages_photo`.** Regrant client permission under the new name if previously saved. - **Profiles cannot be named `review`[↗](/llms.mdx/docs/max/commands/content.md#max-review "Command reference: max review")**, now a command; rename existing profiles with that name.**### Security [#security]- **Windows reports hide every spelling of the home path**, where some usernames previously remained visible.## 0.12.0 — 26.09.2026 [#0120--26092026]**### Added [#added-11]- **More MCP tools:** `max_inbox` for updates in one call, replies and formatting, reactions, and photos visible directly to agents ([Tools](/llms.mdx/docs/max/mcp/content.md#%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B)). - **Claude Code `/catch-up`, `/reply`, `/find` and chats through `@`** ([MCP prompts](/llms.mdx/docs/max/mcp/content.md#%D0%BA%D0%BE%D0%BC%D0%B0%D0%BD%D0%B4%D1%8B-%D0%B8-%D1%87%D0%B0%D1%82%D1%8B-%D0%BF%D0%BE-)).**### Fixed [#fixed-11]- **`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") works on Windows**, using a named pipe instead of a file. - **Long socket paths on macOS and Linux produce clear errors**, instead of `EINVAL`; long profile names or `MAX_STATE_DIR` can cause this.## 0.11.0 — 26.09.2026 [#0110--26092026]**### Added [#added-12]- **`max watch --events`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") includes edits, deletions and reactions**, with an `event` field. Without the flag, output is unchanged ([Live updates](/llms.mdx/docs/max/archive/content.md#%D0%BD%D0%BE%D0%B2%D1%8B%D0%B5-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D1%8F-%D1%81%D1%80%D0%B0%D0%B7%D1%83-max-serve-%D0%B8-max-watch)). - **Problem reports go to GitHub rather than email.** `max doctor report create`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor-report-create "Command reference: max doctor report create") prints a prepared issue link; attach its report file. Issues and attachments are public ([Reporting problems](/llms.mdx/docs/max/troubleshooting/content.md#%D0%BA%D0%B0%D0%BA-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B8%D1%82%D1%8C-%D0%BE-%D0%BF%D1%80%D0%BE%D0%B1%D0%BB%D0%B5%D0%BC%D0%B5)). - **Every failed command gets a run record**, including invalid flags, preflight checks and non-network commands (`models`[↗](/llms.mdx/docs/max/commands/content.md#max-models "Command reference: max models"), `server`[↗](/llms.mdx/docs/max/commands/content.md#max-server "Command reference: max server"), `watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch")), previously only failures reaching MAX. Only command words are recorded, not arguments or message text ([Diagnostics](/llms.mdx/docs/max/diagnostics/content.md)). - **`max backup messages --run` explains storage and export.** Messages are in local storage; `max export messages` creates a file. Its ready-made command appears at the end and in `export`. - **Background `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") enforces read-only, actions, recipients and hourly limits and logs sends.** `config set`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set") takes effect without restart. It does not start with `MAX_TOKEN`. - **`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") requests folders, banners, calls, stickers and reactions like web.max.ru**, and subsequent logins request only changes since the previous timestamp. This reduces differences from the web client. All requests read only; responses are neither shown nor saved. One-off commands omit them ([Network behavior](/llms.mdx/docs/max/security/content.md#%D1%87%D1%82%D0%BE-%D1%83%D1%85%D0%BE%D0%B4%D0%B8%D1%82-%D0%B2-%D1%81%D0%B5%D1%82%D1%8C)). - **The server skips malformed incoming MAX messages**, warns once and continues, instead of potentially stopping.**### Changed — may break scripts [#changed--may-break-scripts-11]- **Stronger agent safeguards:** * `max mcp --confirm-send`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") confirms every write, including edits, forwards, pins, read receipts and deletion. Approval works once for 5 minutes. * `sendsPerHour` includes edits, notified pins and each added person. Scheduled messages count in their send hour. Simultaneous sends can no longer both pass the last available slot. * Group creation and additions with a recipient list require every person's direct chat on that list. * `chats members add`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-members-add "Command reference: max chats members add") hides older history unless `--history`; `--hide-history` is removed. * `MAX_PROFILE_LOCK` fixes the profile. * `--file` protects hidden files/directories and `max` directories unless `--allow-any-file`. Hourly limits may be reached sooner. Remove `--hide-history` from scripts; intentional hidden-file sends need `--allow-any-file`.**### Fixed [#fixed-12]- **`max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") no longer labels edits or deletions as new messages**, despite MAX returning them in message-shaped events. - **Exact titles no longer silently win** over other partial matches. Both candidates are shown for ID selection, preventing irreversible wrong sends.**### Security [#security-1]- **Tokens from `MAX_TOKEN` stay there.** Rotated tokens are not saved to keyring/files; stderr reports this. `max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") identifies `credentials.json` when using file storage. - **`max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") masks phone numbers**, like `max account show`[↗](/llms.mdx/docs/max/commands/content.md#max-account-show "Command reference: max account show"). Ctrl-C at the token prompt returns `130`. - **The server never hands out tokens** to clients requesting login data; they check the keyring themselves. - **Network limits:** decompressed MAX frames are capped at 32 MiB. Connections and downloads have timeouts. `max messages download`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-download "Command reference: max messages download") requires HTTPS, rejects local-machine/network URLs even after redirects, and caps files at 4 GiB and transcription audio at 32 MiB. Message links are untrusted. - **Local storage permissions:** database, `-wal`, `-shm` files use `0600`; directories `0700`. Existing permissions are corrected on opening. Reports replace chat/message IDs with labels. - **Untrusted text uses one line with visible controls** in feeds, tables, candidates, Markdown and `messages download`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-download "Command reference: max messages download") paths. Filenames lose control and text-direction characters; only `http` and `https` become Markdown links. - **Completion inserts only IDs**, displaying names beside them because titles and `@имя` come from other people and must not become shell code. - **`max cache clear` without a profile respects the default and `MAX_PROFILE`.** - **Release hardening:** exact dependency versions, clean builds before packaging, no test helpers, and a dedicated publish step that does not install or execute dependencies.## 0.10.0 — 25.09.2026 [#0100--25092026]**### Added [#added-13]- **`max doctor report`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor-report "Command reference: max doctor report") and `max doctor report create`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor-report-create "Command reference: max doctor report create")** explain report contents or create a content-free file with next steps. This release used email; 0.11.0 moved to GitHub ([Reporting problems](/llms.mdx/docs/max/troubleshooting/content.md#%D0%BA%D0%B0%D0%BA-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B8%D1%82%D1%8C-%D0%BE-%D0%BF%D1%80%D0%BE%D0%B1%D0%BB%D0%B5%D0%BC%D0%B5)). - **`max backup messages <чат> --since <дата> | --last `** downloads earlier history. Without `--run`, it only estimates. With it, it pages backwards 30 messages at a time, up to 40 pages with pauses, resuming later ([History download](/llms.mdx/docs/max/archive/content.md#%D1%81%D0%BA%D0%B0%D1%87%D0%B0%D1%82%D1%8C-%D0%B8%D1%81%D1%82%D0%BE%D1%80%D0%B8%D1%8E)). - **`max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor") shows the emulated web-client version**, warning if checked over 60 days ago because MAX may reject old clients ([Troubleshooting](/llms.mdx/docs/max/troubleshooting/content.md)). - **`max server start|stop|status|restart`[↗](/llms.mdx/docs/max/commands/content.md#max-server "Command reference: max server")** manages the background server separately, like `max session`[↗](/llms.mdx/docs/max/commands/content.md#max-session "Command reference: max session"). `status` shows running state, start time, version and MAX connection, suggesting `restart` when outdated. `max serve --detach`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") and `--stop` still work here ([Server guide](/llms.mdx/docs/max/archive/content.md#%D0%BD%D0%BE%D0%B2%D1%8B%D0%B5-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D1%8F-%D1%81%D1%80%D0%B0%D0%B7%D1%83-max-serve-%D0%B8-max-watch)). - **History requests use the web client's five fields**, and login requests 15 chats like web.max.ru, fetching the rest separately. Previously it used an extra field and requested 40 chats. This reduces detectable differences; chat results are unchanged, and channel testing confirmed reads still send no read receipts. - **Device descriptions use this computer's timezone, language and OS**, instead of every installation claiming Chrome on Linux in Madrid. - **`max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") sends one hidden-tab-style service event** 20 seconds after login: chat list shown, with account ID and time, no content or titles. One-off commands do not send it ([Network behavior](/llms.mdx/docs/max/security/content.md#%D1%87%D1%82%D0%BE-%D1%83%D1%85%D0%BE%D0%B4%D0%B8%D1%82-%D0%B2-%D1%81%D0%B5%D1%82%D1%8C)). - **Folder titles longer than 20 characters are rejected locally**, instead of sending a request MAX would reject.**### Changed — may break scripts [#changed--may-break-scripts-12]- **Excessive-login rejections no longer trigger more attempts.** Code `8` pauses a profile for 1 minute, 5 minutes, 30 minutes, 1 hour, 6 hours, then 1 day. The background server stops on any login rejection, previously retrying indefinitely each minute. Scripts receive code `8` until the stated time; wait ([Troubleshooting](/llms.mdx/docs/max/troubleshooting/content.md)).**### Fixed [#fixed-13]- **An inaccessible keyring is distinguished from missing login.** Previously logged-in profiles with unreadable tokens, such as under cron, receive keyring guidance rather than another login hint, avoiding unnecessary new devices ([Recipes](/llms.mdx/docs/max/recipes/content.md)). - **Failed runs save without `--record`**, including MAX key (`login.token`), warning codes, crash location, runtime version and OS, never text. Background logs use timestamped JSON lines ([Diagnostics](/llms.mdx/docs/max/diagnostics/content.md)). - **`max chats read --until`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") marks only through its message**, rather than using current time and marking newer messages read. `messages list --mark-read`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") is fixed too; others may previously have seen receipts for unread messages.## 0.9.0 — 25.09.2026 [#090--25092026]**### Added [#added-14]- **MAX traffic matches the web client's address, binary frames, compression and updated device/browser versions**, replacing the old text-frame format. This is harder to distinguish and supports binary audio/video-note fields. Commands/output are unchanged; voice sending follows in later releases. Login still fetches full chat lists here, creating extra traffic. - **Automatically started `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") restarts after updating `max`.** Manually started servers remain old until `max serve --stop`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") and a restart.## 0.8.0 — 25.09.2026 [#080--25092026]**### Added [#added-15]- **`max messages transcribe <чат> `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-transcribe "Command reference: max messages transcribe")** recognizes voice locally without uploading it. `max models audio list`[↗](/llms.mdx/docs/max/commands/content.md#max-models-audio-list "Command reference: max models audio list") shows language support; `max models audio download `[↗](/llms.mdx/docs/max/commands/content.md#max-models-audio-download "Command reference: max models audio download") downloads and checksum-verifies. MCP: `max_messages_transcribe` ([Voice transcription](/llms.mdx/docs/max/usage/content.md#%D0%B3%D0%BE%D0%BB%D0%BE%D1%81%D0%BE%D0%B2%D1%8B%D0%B5-%D0%B2-%D1%82%D0%B5%D0%BA%D1%81%D1%82)). Download is explicit and one-time; saved transcripts avoid both network and model on repeats. - **One MAX connection per profile**, shared by commands, `max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp"), `max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") through `max serve`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve"), reducing logins and possible session termination. `max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") stops, logs in and restarts it ([Server guide](/llms.mdx/docs/max/archive/content.md#%D0%BD%D0%BE%D0%B2%D1%8B%D0%B5-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D1%8F-%D1%81%D1%80%D0%B0%D0%B7%D1%83-max-serve-%D0%B8-max-watch)). - **`max serve --detach`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") starts in the background and returns once connected; `max serve --stop`[↗](/llms.mdx/docs/max/commands/content.md#max-serve "Command reference: max serve") stops it.** Manual servers stop only with Ctrl-C or `--stop`; `max session end`[↗](/llms.mdx/docs/max/commands/content.md#max-session-end "Command reference: max session end") leaves them running. - **`allow` profile permissions:** `max work config set allow send,reaction` permits sends/reactions only. Twelve names range from `send` to `sessions`. Without a list all remain allowed. Rejections return `5` before connecting, with a permission-setting command. MCP hides forbidden tools ([Permissions](/llms.mdx/docs/max/usage/content.md#%D1%87%D1%82%D0%BE-%D0%BF%D1%80%D0%BE%D1%84%D0%B8%D0%BB%D1%8E-%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE)). - **`max messages send … --at <время>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send")** schedules on MAX's server, even with the computer off. Accepts `2026-09-25T09:00` locally or `30m`, `2h`, `1d`. `max messages scheduled <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-scheduled "Command reference: max messages scheduled") lists the queue; MCP uses `at` in `max_messages_send` and `max_messages_scheduled`. Cancellation is app-only ([Scheduled sends](/llms.mdx/docs/max/usage/content.md#%D0%BE%D1%82%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D1%82%D1%8C-%D0%BF%D0%BE%D0%B7%D0%B6%D0%B5)). - **`max chats read <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats") and `max messages list … --mark-read`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list")** send explicit visible read receipts. MCP needs `max mcp --allow-mark-read`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp"); normal reads remain invisible ([Reading](/llms.mdx/docs/max/usage/content.md#%D1%87%D1%82%D0%B5%D0%BD%D0%B8%D0%B5)). - **`max export messages <чат> --format jsonl|md`** exports local JSONL or Markdown with `--since`, `--output`, without querying MAX. Missing ranges are reported on stderr; output files are owner-only ([Export](/llms.mdx/docs/max/archive/content.md#%D0%B2%D1%8B%D0%B3%D1%80%D1%83%D0%B7%D0%B8%D1%82%D1%8C-%D0%B2-%D1%84%D0%B0%D0%B9%D0%BB)). - **`max messages delete <чат> --allow-dangerous`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-delete "Command reference: max messages delete")** deletes up to 10 messages, locally by default or for everyone with `--for-everyone`. MCP `max mcp --allow-delete`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") deletes only for you. Permission is mandatory; each deletion counts toward `sendsPerHour` ([Deletion](/llms.mdx/docs/max/usage/content.md#%D1%83%D0%B4%D0%B0%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5)).**### Fixed [#fixed-14]- **Upgrades preserve read history through schema migration**, instead of clearing it on schema changes. This release changes the schema and preserves messages; chats/people are refreshed on login. - **After server login rejection, commands wait 10 minutes before starting another server**, rather than repeatedly triggering rejected logins. `max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") clears the wait. - **`max watch`[↗](/llms.mdx/docs/max/commands/content.md#max-watch "Command reference: max watch") sees messages sent by `max` itself**, previously missing because MAX does not echo to the sending connection. - **Concurrent commands preserve local login data.** Previously two of three runs reported “the local record did not take this login”, losing chats, members and sync state. Writes now wait their turn.**### Security [#security-2]- **Error text cannot control the terminal.** Controls display as `\x1b`, extending 0.7.0's protections because errors may quote user input or MAX responses.## 0.7.0 — 24.09.2026 [#070--24092026]**### Added [#added-16]- **`max reactions remove <чат> `[↗](/llms.mdx/docs/max/commands/content.md#max-reactions-remove "Command reference: max reactions remove")** removes your reaction. - **Groups and channels under `max chats`[↗](/llms.mdx/docs/max/commands/content.md#max-chats "Command reference: max chats"):** inspect invites, join, leave, create, add/remove members/admins, rename, change settings and reset invites. Join requests appeared here but were removed in 0.17.0 because MAX has none. Changes are visible and pass send safeguards ([Group guide](/llms.mdx/docs/max/usage/content.md#%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D1%8B-%D0%B8-%D0%BA%D0%B0%D0%BD%D0%B0%D0%BB%D1%8B)). - **`max update` uses the installation package manager**; `--check` only checks. Terminal users receive daily version hints, never agents/scripts. Disable with `updateCheck: false` in `defaults` ([Updates](/llms.mdx/docs/max/installation/content.md#%D0%BE%D0%B1%D0%BD%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5-%D0%B8-%D1%83%D0%B4%D0%B0%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5)). - **Tab completion for zsh, bash, fish and PowerShell:** `source <(max complete zsh)`, offering commands, flags, values and local chats/people without connecting ([Completion](/llms.mdx/docs/max/commands/content.md#max-complete)). - **`max mcp`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp") exposes the same profile to MCP clients**, including Claude Desktop and Cursor ([MCP guide](/llms.mdx/docs/max/mcp/content.md)). Read-only unless `--allow-send`; sends use the same checks as `max messages send`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send"). - **`max mcp --allow-send --confirm-send`[↗](/llms.mdx/docs/max/commands/content.md#max-mcp "Command reference: max mcp")** shows destination title/ID and text before each send. Nothing goes without approval; clients without forms fail ([Confirmation](/llms.mdx/docs/max/mcp/content.md#%D0%BF%D0%BE%D0%B4%D1%82%D0%B2%D0%B5%D1%80%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5-%D1%84%D0%BE%D1%80%D0%BC%D0%BE%D0%B9-%D0%BE%D1%82-%D1%81%D0%B0%D0%BC%D0%BE%D0%B3%D0%BE-%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0)). - **`max messages send … --file <путь>`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send")** sends photos/files; several photos use one message in this release.**### Security [#security-3]- **Untrusted content cannot control terminals.** Messages, names, titles, filenames or reactions containing controls previously could erase and overwrite output. They now display as `\x1b` in feeds, tables, errors and completion. JSON remains unchanged, already escaping them.## 0.6.0 — 24.09.2026 [#060--24092026]**### Added [#added-17]- **`max commands --json`[↗](/llms.mdx/docs/max/commands/content.md#max-commands "Command reference: max commands")** describes all commands, arguments, flags and exit codes in one response, with `mutates: true` for MAX changes. Agents avoid per-command `--help`; it works without login and with broken configuration. - **`max messages send … --reply-to `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send")** replies to a message. - **`max messages send … --markdown`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") (or `--md`)** formats `**жирный**`, `_курсив_`, `~~зачёркнутый~~` and `` `код` ``. Without a flag, text stays literal. - **`max reactions add <чат> <эмодзи>`[↗](/llms.mdx/docs/max/commands/content.md#max-reactions-add "Command reference: max reactions add")** sets a reaction, replacing yours. - **`messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list"), `show`, `context` display reactions**, such as `👍 3 🔥 1 (you: 🔥)`, or JSON `reactions`[↗](/llms.mdx/docs/max/commands/content.md#max-reactions "Command reference: max reactions"). One extra read request per page; offline reactions are `null` because not stored. - **Send logs and optional recipients:** `max sends list`[↗](/llms.mdx/docs/max/commands/content.md#max-sends-list "Command reference: max sends list") logs attempts without content; `max recipients add|remove|list|off`[↗](/llms.mdx/docs/max/commands/content.md#max-recipients "Command reference: max recipients") restricts chats, rejecting code `7`. `readOnly` rejects `5`. See [Security](/llms.mdx/docs/max/security/content.md) for scope and limitations. - **`max session start qr | qr-chrome | sms | token`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start")** logs in without copying browser tokens. `qr` renders in the terminal, or browser if narrow; `qr-chrome` and `sms` open web.max.ru in separate Chrome, Chromium, Edge or Brave windows. Without a method, import manually or by pipe as before.**### Changed — may break scripts [#changed--may-break-scripts-13]- **Default hourly sends are limited to 30 (`sendsPerHour`).** `max messages send`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send") returns `8` beyond that, previously unlimited. Scripts intentionally sending more must raise the setting.## 0.5.0 — 24.09.2026 [#050--24092026]**### Added [#added-18]- **`max messages download <чат> [--output <каталог>]`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-download "Command reference: max messages download")** saves photos, files, video and audio without overwriting existing files. - **`max config set <настройка> <значение>`[↗](/llms.mdx/docs/max/commands/content.md#max-config-set "Command reference: max config set") and `max config unset <настройка>`[↗](/llms.mdx/docs/max/commands/content.md#max-config-unset "Command reference: max config unset")** edit configuration, with `--defaults` for all profiles. Global `defaults` apply where a profile has no override. - **`max chats list --unread`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list")** filters unread chats. - **`max messages list <чат> --after `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list")** reads forwards after a message or time, with a `--after ` continuation hint. - **`max chats show <чат>`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-show "Command reference: max chats show")** shows a chat/members; **`max contacts show <человек>`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-show "Command reference: max contacts show")** accepts ID, @username or name fragment and shows shared chats. Ambiguity lists candidates instead of guessing. - New read operations in this release neither send nor mark read.**### Fixed [#fixed-15]- **`--offline` works.** Previously commands ignored it: reads contacted MAX, and `max --offline messages send` **sent messages**. Now reads use storage while sends/downloads refuse. `--offline messages send` on 0.4.0 or earlier did go through. - **Configuration errors explain unknown fields, valid names and accepted values**, replacing validation-library errors. - **Run-log failures (`--record`) no longer crash commands.** A stderr warning, even with `--quiet`, leaves the normal result and exit code intact.**### Security [#security-4]- **GitHub Actions publishes with npm provenance**, allowing verification that the package was built from this repository.## 0.4.0 — 23.09.2026 [#040--23092026]**### Added [#added-19]- **`max messages show <чат> `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-show "Command reference: max messages show")** reads one message; **`max messages context <чат> `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-context "Command reference: max messages context")** uses `--before`, `--after` for context, marking `◀` or JSON `"anchor": true`. Missing messages return not found instead of neighbors. - **`max skill show`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show")** prints installed agent instructions: `max skill show > ~/.claude/skills/max-cli/SKILL.md`[↗](/llms.mdx/docs/max/commands/content.md#max-skill-show "Command reference: max skill show"). - **`max config show`[↗](/llms.mdx/docs/max/commands/content.md#max-config-show "Command reference: max config show")** reports effective profile and source, configuration path/existence, all profiles including state-only ones, and every setting's flag/environment/file/default source. `MAX_CONFIG_DIR` and related overrides warn about alternate keyring entries. - **Piped text:** `echo "текст" | max messages send <чат>` reads stdin when no text argument is supplied, avoiding `ps`/history exposure and supporting newlines. - **`--timeout <срок>`** limits the whole connection/login/request sequence, not a single response. - **`max doctor`[↗](/llms.mdx/docs/max/commands/content.md#max-doctor "Command reference: max doctor")** reports token source without its value, login count/time, logged-in profiles, supported/cache schemas and keyring entry without contacting MAX. It works during failures; missing sessions are data, not errors.**### Changed — may break scripts [#changed--may-break-scripts-14]- **List `--query` becomes `--search`**, introduced in 0.3.0 but omitted from its original notes. Update scripts to avoid errors.**### Fixed [#fixed-16]- **`messages list --before `[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list")** derives time from the ID without requiring an earlier read. - **Group members use names instead of IDs**, fetched once and saved, including reply/forward authors; previously only contacts had names. - **Releases finish tagging after publication**, fixing two failures by bypassing npm cache and waiting up to three minutes.## 0.3.0 — 22.09.2026 [#030--22092026]**### Added [#added-20]- **Conversation feeds:** day separators, `время автор` and aligned, terminal-width text. `вы` means your messages, unnamed authors use IDs. `↳` and `↪` show replies/forwards received in full and saved locally. - **`-v`, `-vv`** add message, sender, chat IDs and attachment URLs, then all known fields. - **`--jsonl`** provides one JSON object per line for streaming and `jq`. - **Attachment links:** `📎 photo`, `📎 photo ×3 1 2 3`, `📎 файл.pdf · 24 MB`; JSON includes `url`, `width`, `height`, `title`. Photo URLs open without login, so recipients can access them. - **`senderColors: true`** gives each author a color; off by default.**### Changed — may break scripts [#changed--may-break-scripts-15]- **`-v` is output detail; version becomes `max -V`.** **`--trace`** replaces former `--verbose` request tracing. Scripts using `max -v` for the version must use `-V`; update tracing calls accordingly. - **List `--query` becomes `--search`**, originally omitted from these notes. - **Local cache upgrades to schema 4 and rebuilds on first run.** Read history is not preserved in this release; read it again.**### Fixed [#fixed-17]- **Ambiguous chat names return candidates with IDs**, including JSON `candidates`. - **Cache warnings name the schema and next steps**, rather than `Error`. - **`messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list") continuation hints use `--before `**, not nonexistent `--page`.## 0.2.0 — 22.09.2026 [#020--22092026]**### Added [#added-21]- **`max messages send --silent`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send")** requests sends without notifications. Its actual effect was not observed in this release because doing so required messaging a real person. - **First login exchanges the token:** MAX returns a session token, replacing the imported browser token in the keyring once.**### Fixed [#fixed-18]- **`max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") checks before saving**, preventing typos from replacing valid tokens. - **Profiles stay tied to their account.** A different account's token is rejected with an explanation rather than running commands as someone else. - **Unknown-send-outcome hints name a real command**, not nonexistent `max send`. - **Login messages are retained**, previously discarded due to an incorrectly described response shape.## 0.1.0 — 21.09.2026 [#010--21092026]The first shareable version.**### Added [#added-22]- **Seven commands against real MAX:** `session start|end`[↗](/llms.mdx/docs/max/commands/content.md#max-session "Command reference: max session"), `account show`[↗](/llms.mdx/docs/max/commands/content.md#max-account-show "Command reference: max account show"), `chats list`[↗](/llms.mdx/docs/max/commands/content.md#max-chats-list "Command reference: max chats list"), `contacts list`[↗](/llms.mdx/docs/max/commands/content.md#max-contacts-list "Command reference: max contacts list"), `messages list`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-list "Command reference: max messages list"), `messages send`[↗](/llms.mdx/docs/max/commands/content.md#max-messages-send "Command reference: max messages send"). - **Profile first:** `max personal chats list`; accounts have separate tokens, state and local copies. `MAX_PROFILE` selects the same profile. - **Tokens live in the OS keyring**, not files or arguments. Phone login is not yet available; `max session start`[↗](/llms.mdx/docs/max/commands/content.md#max-session-start "Command reference: max session start") imports an official-client token. - **Machine output:** `--json` emits exactly one JSON value on stdout, also automatic without terminal stdout. Errors go to stderr with stdout empty. Branch on exit codes in the [Command reference](/llms.mdx/docs/max/commands/content.md), sourced from `docs/commands.md`. - **Content-free diagnostics:** `--verbose` displays request events; `--record` saves them for 30 days; `max runs list|show|path`[↗](/llms.mdx/docs/max/commands/content.md#max-runs "Command reference: max runs") reads records. Nothing is saved by default in this release. - **Local storage:** read data is saved; `--offline` answers without connecting; `max cache clear` clears it. - **Configuration in `~/.config/max-cli/config.json`**, precedence flag → environment → file → default. Unknown fields produce named errors, never silently ignored defaults. - **Two runtimes:** Node 22+ and Bun 1.3+, both running the built command in CI. - **Reading never marks read.** History and read receipts are separate protocol operations; the latter is never sent in this release, verified by tests. - **Sending reports uncertainty honestly:** missing responses return `outcome_unknown`, code `14`, rather than success or failure. Retry only with the same `--cid` to avoid duplicates. - **Personal-account MAX protocol is unofficial and reverse-engineered**, separate from Bot API. Unannounced changes produce stderr warnings instead of silent failure. - **Not yet supported:** phone login, attachments, reactions, edits, groups, stories or calls; text only. Personal-account mass mailings are not planned. # Command reference (/en/docs/max/commands) Documentation version: v0.25.0 Every command, option and exit code. This reference is **generated from the program itself**, so it describes the released interface.Command syntax:```sh max [профиль] [опции] <команда> <действие> [аргументы] ```**The first word is a profile name** unless it matches a command name: `max personal chats list` reads chats for `personal`, while `max chats list` uses the default profile. The `MAX_PROFILE` environment variable selects the same profile; without it, the profile is `default`.⚠ Command and option descriptions below match `max --help` exactly. They come from the program itself, ensuring that help and this reference stay consistent.**## Global options [#global-options]Apply to every command.| Option | Purpose | | ---------------------- | ------------------------------------------------------------------------------- | | `-V, --version` | output the version number. | | `-v, --verbose` | more detail in what is shown: -v ids, -vv everything we know. Default: `0`. | | `--json` | machine-readable output: one JSON value on stdout, nothing else. | | `--jsonl` | machine-readable output: one JSON object per line, for streaming and jq. | | `--quiet` | diagnostics off. | | `--trace` | one line per request on stderr: ids and timings, never message content. | | `--timeout ` | give up on the whole command after this — 30s, 2m, 500ms. | | `--offline` | answer from what was recorded and never connect; fails if nothing was. | | `--yes` | go ahead without the question an ask level puts before a write. | | `--record` | keep this run under `max runs` — ids and timings, never message content. | | `--no-record` | do not keep it, whatever the configuration says. | | `--serve` | start `max serve` in the background if it is not running (the default). | | `--no-serve` | do not start it; log in on this command's own connection unless one is running. |## `max session` [#max-session]the stored MAX session for this profile### `max session start` [#max-session-start]log this profile in to MAX```sh max session start [method] ```| Argument | | Meaning | | -------- | -------- | ----------------------------------------------------------------------------------------------------------- | | `method` | optional | token (pasted or piped), qr, qr-chrome or sms. One of: `token`, `qr`, `qr-chrome`, `sms`. Default: `token`. |### `max session end` [#max-session-end]forget the stored session for this profile```sh max session end ```## `max setup` [#max-setup]set up your personal MAX account and connect your agent**Changes data in MAX.**```sh max setup [options] ```| Option | Purpose | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `--agent ` | install the skill for this agent; asks at a terminal, otherwise none. One of: `none`, `codex`, `cursor`, `claude`, `gemini`, `all`. | | `--method ` | how to log in when there is no session. One of: `token`, `qr`, `qr-chrome`, `sms`. Default: `qr`. |## `max account` [#max-account]the account this profile is logged in as### `max account show` [#max-account-show]who this profile is logged in as; the phone number shows its last four digits```sh max account show [options] ```| Option | Purpose | | -------------- | ----------------------------- | | `--show-phone` | print the whole phone number. |### `max account update` [#max-account-update]change the name, the description or the photo everyone sees on your profile**Changes data in MAX.**```sh max account update [options] ```| Option | Purpose | | ---------------------- | ------------------------------------ | | `--first-name ` | your first name. | | `--last-name ` | your last name. | | `--description ` | about you. | | `--photo ` | a new profile photo — an image file. |### `max account sessions` [#max-account-sessions]where else this account is logged in — not `max session`, which is this tool's own login#### `max account sessions list` [#max-account-sessions-list]every device and app logged in to this account; nothing is ended```sh max account sessions list ```#### `max account sessions end` [#max-account-sessions-end]log out every other device, your phone included; this one stays**Changes data in MAX.**```sh max account sessions end [options] ```| Option | Purpose | | ---------- | --------------------------- | | `--others` | every session but this one. |## `max chats` [#max-chats]the chats this account is in### `max chats list` [#max-chats-list]chats, newest first, archived ones included```sh max chats list [options] ```| Option | Purpose | | ----------------- | ----------------------------------------------------------- | | `--limit ` | how many to show. | | `--page ` | which page, starting at 1. | | `--all` | every row, no paging. | | `--search ` | only chats whose name contains this; at least 3 characters. | | `--kind ` | only chats of this kind: dialog, group, channel, saved. | | `--unread` | only chats with unread messages. |### `max chats show` [#max-chats-show]one chat: its kind, unread count, last message time and who is in it```sh max chats show ```| Argument | | Meaning | | -------- | -------- | ------------------------------------- | | `chat` | required | a chat: its id, or part of its title. |### `max chats events` [#max-chats-events]who joined, left, was added or removed, and by whom — from the chat's service messages```sh max chats events [options] ```| Argument | | Meaning | | -------- | -------- | ------------------------------------- | | `chat` | required | a chat: its id, or part of its title. || Option | Purpose | | --------------------- | -------------------------------------------------------------------------- | | `--since-time