Telegram and MAX CLI settings and profiles
Find the settings file, view and change a value, choose a profile or bot, and set what the tool may do.
Save settings for the command-line tools so you do not repeat the same options on every run, such as how many results to show. Learn where your settings are stored, how to check and change them, and where each messenger lists every available setting. The defaults work for most people; change a setting when you keep repeating the same option or want different values for different accounts.
Two terms help here. The settings file (config.json) keeps these values on your computer. A profile is a named configuration for an account or bot connection, such as work, with its own values; values under defaults apply to every profile. Login data is never stored in this file, and what your agent may do is set in Permissions.
On this page:
- Where the file is
- Check and change a setting
- Which value wins?
- An example
- All settings for Telegram and MAX
- Profiles and bots
- Permissions
Where the file is
The tool creates the file with common defaults the first time a command reads settings, and keeps an existing file as it is.
| System | Telegram | MAX |
|---|---|---|
| Linux | ~/.config/tg-cli/config.json | ~/.config/max-cli/config.json |
| macOS | ~/.config/tg-cli/config.json | ~/.config/max-cli/config.json |
| Windows | %APPDATA%\tg-cli\Config\config.json | %APPDATA%\max-cli\Config\config.json |
config show prints the actual path, which differs if your computer uses a custom directory. In PowerShell, type tg.cmd or max.cmd.
Check and change a setting
tg config show
tg personal config set limit 50
tg work config set limit 10
tg config set sends_per_hour 10 --defaults
tg personal config unset limitconfig show lists every setting with its value and where that value came from. config set saves a value for the current profile, for a named profile such as work, or with --defaults for every profile. It checks the value before writing, so a typo is refused instead of saved. config unset removes a value so the default applies again. For MAX, write max instead of tg. You can also edit the file by hand.
Which value wins?
A command option such as --limit 5 (a flag) changes only that run. It wins over an environment variable, then the profile's value in the file, then defaults, then the built-in value. Some settings have no option or environment variable; each messenger's reference says which ones exist.
An example
{
"defaults": { "limit": 20, "sends_per_hour": 30 },
"profiles": { "work": { "limit": 50 } }
}tg work chats list shows 50 results, other profiles show 20, and --limit 5 shows five for one command.
A fuller example with profiles, bots and permissions
{
"defaults": { "limit": 20, "keep_runs_for_days": 14, "update_check": true },
"profiles": {
"personal": { "limit": 50, "color": true },
"work": { "limit": 10, "record": true, "permissions": { "messages": "readonly" } }
},
"personal": { "defaults": { "sends_per_hour": 30 } },
"bot": { "profiles": { "shop": { "sends_per_hour": 200 } } }
}defaultsapply to every profile;profiles.<name>to one profile.personalapplies only to commands for your own account;botonly totg <name> bot …andmax <name> bot …commands.workkeeps a record of every run and may only read messages.
All settings for Telegram and MAX
The two tools share most settings, such as limit, sends_per_hour, record and permissions. Some exist in only one of them: for example, proxy in Telegram and serve in MAX. WireCat Desktop shows the runs that record keeps: Search logs in WireCat Desktop. Each messenger documents its own settings:
- Telegram: Telegram configuration guide · every Telegram setting, default and environment variable.
- MAX: MAX configuration guide · every MAX setting, default and environment variable.
The other tools have their own settings files: Zoom, Google Drive, Notion, Yandex Disk, Google Calendar, Mail, Bitrix24, amoCRM, Attio, HubSpot, Asterisk, WordPress, Linear and Memo.
Profiles and bots
Use profiles when you have multiple accounts, a bot or different access settings for your agents. A profile is a named configuration for one account or bot connection on this computer, with its own login and permissions. This page shows how to choose the right one and distinguish a bot command from a personal-account command.
Choose a profile
Put the profile before the command:
tg work config show
drive personal syncName the profile in every command and agent request: tg work …, or TG_PROFILE=work for a whole
session (tg reads TG_PROFILE and max reads MAX_PROFILE; zm uses the account.profile setting; memo and drive read no profile variable, so name the profile in the command). No profile is ever picked for you. A command
that needs one and names none stops with an error that lists the profiles on this computer. A setting under profiles.work applies to that
profile; defaults supplies values it has not set.
Profiles are not separate operating-system users: an agent with unrestricted file access
can still reach other data on that computer.
Switch to a bot
Use bot after the profile name:
tg support bot api get-me --json
max support bot api get-my-info --jsonThese commands require an already connected bot profile. The bot's account and rights come from the messenger, not from your personal account. Bots explains setup and examples.
For login, use the Telegram or MAX guide, or connect Google Drive.
Permissions
Choose which actions your agent may perform: reading messages, sending replies or changing a group. This page helps you set access for the chosen account or bot and check limits before a real task. Permissions belong to a profile, a named set of settings for an account or bot; Profiles explains choosing one.
Choose an access level
| Level | What happens |
|---|---|
deny | The action is refused, including reading. |
readonly | Reading works; changes are refused. |
ask | In a terminal, a change waits for your confirmation. Over MCP it runs without a question. |
allow | The action can run without another question. |
A refusal tells you to check the requested action and settings. It does not mean your account connection is broken. Do not ask an agent to remove a restriction just to finish a task.
Allow one action
tg work config set permissions.messages.send ask
max work config set permissions.messages.send askReplace work with your profile. For a default that allows reading messages and refuses changes:
tg work config set permissions.messages readonly
max work config set permissions.messages readonlyMore specific keys win. A saved permissions.messages.send ask still permits sending; set it
to readonly to refuse sends. Check other exceptions with config show.
This controls messages. Other actions, such as reactions or chat administration, have their own permission keys. Use the complete read-only profile examples in Telegram’s permission reference or MAX’s permission reference.
Permissions for a bot
Bot permissions and limits belong to the bot section. To ask before sends in the terminal:
tg support config set permissions.bot.messages.send ask --bot
max support config set permissions.bot.messages.send ask --bot
tg support config set sends_per_hour 30 --bot
max support config set sends_per_hour 30 --botRestrict recipients and repeated sends
A recipient list limits which chats the profile may send to. An hourly send limit helps stop a loop. These checks remain active when a particular command is allowed. Read the Telegram security guide or MAX security guide for the commands to manage these controls.
A temporary change for an MCP server
Add --permission messages.send=deny to the server startup command to refuse sending for that
process. Saved settings stay the same. The flag only tightens: an override that would loosen the profile's
level is refused at startup, so to allow more, change the profile's permissions. Over MCP, the server asks nothing at the ask level, and the agent writes and deletes at once. Only your AI app
may show its own confirmation. To keep the agent from changing data, give the profile readonly or deny, for
example tg work config set permissions.messages readonly. Browser setup explains the full connection.
Lock a whole run to reading
Each tool also reads a variable in its environment that refuses changes for the whole run, whatever the saved permissions allow. A refused change exits with code 5. Set it for an agent that should only read.
| Tool | Variable | What it refuses |
|---|---|---|
| tg, max | TG_READ_ONLY=1, MAX_READ_ONLY=1 | Sending and other changes; the agent can still read and prepare reply text. |
| Zoom | ZM_READ_ONLY=1 | Changes to Zoom, the login, settings and what you added; reading and syncing from Zoom still run. |
| Google Drive | DRIVE_READ_ONLY (any value except 0 or empty) | Every change, on this computer or in Google, as --read-only does. |
| Google Calendar | GCAL_READ_ONLY (any value except 0 or empty) | Every change to Google Calendar and to the settings; reading and gcal sync still run. |
| Memo | MEMO_READ_ONLY (any value except 0) | Every change; reading, memo sync and a scheduled agent's tasks link still run. memo mcp serve keeps writing commands discoverable but refuses them. |
Limits and detailed rules
An agent that can edit configuration files or run unrestricted terminal commands may be able to change these settings. Read Security before giving that access. For nested permissions and exact command keys, see Telegram or MAX.