# MAX messenger CLI group and channel admin commands (/en/docs/max/commands-admin)

This reference covers group administration commands. Use it to look up member, invitation, permission, moderation, forum topic and statistics options before making a change.

Members, invitations, permissions, moderation, forum topics and statistics for groups and channels. Changes require the relevant permissions.

## 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; --json=id,text keeps only those fields. |
| `--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. |
| `--debug` | on a failure, its whole record — cause and stack — in place of the short line. |
| `--timeout <duration>` | give up on the whole command after this — 30s, 2m, 500ms. |
| `--offline` | answer from what was recorded and never connect; fails if nothing was. |
| `--no-input` | never prompt or open interactive login; piped input remains available. |
| `--max-input-bytes <bytes>` | maximum buffered input bytes (default: 16777216). |
| `--max-output-bytes <bytes>` | maximum machine output bytes (default: 4194304; 0 disables). |
| `--brief` | found messages as reference, title, time, sender and excerpt only. |
| `--full` | found messages with their whole text and every provider field. |
| `--compact` | one line per item for an agent: reference first, text last, paging and next steps as # lines. |
| `--dry-run` | preview parsed arguments and permissions before running the action. |
| `--yes` | go ahead without the question an ask level puts before a write. |
| `--record` | keep this run under `max runs`, with the command as typed and secrets hidden; record_input false leaves the typed words out. |
| `--no-record` | do not keep this run, even if it fails. |
| `--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. |

## Commands [#commands]

### `max chats create` [#max-chats-create]

create a group or a channel; the people added are told

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats create <title> [person] [options]
```

| Argument | | Meaning |
|---|---|---|
| `title` | required | the group's name. |
| `person` | optional | people to add: an id, or part of a name. |

| Option | Purpose |
|---|---|
| `--channel` | a private channel instead of a group; people join it by its link. |

**Returns:** chat group change — operation_id, chat, requested; every field: max commands info chats create

**Example:** `max personal chats create "Book club" "Alex Example"`

### `max chats members` [#max-chats-members]

who is in a group

#### `max chats members list` [#max-chats-members-list]

everyone in a group, a page at a time, with their role and when they were last seen

```sh
max chats members list <chat> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `query` | optional | field:value terms; this list filters by none yet. |

| Option | Purpose |
|---|---|
| `--limit <n>` | how many to show. |
| `--page <n>` | which page, starting at 1. |
| `--all` | every row, no paging. |

**Returns:** member — id, name, username, role, last_seen_at, registered_at, joined_at, invited_by, and 7 more; every field: max commands info chats members list

**Next usually:** `max contacts show <person>`, `max contacts notes list <person> [query]`, `max contacts notes show <person> <id>`

**Example:** `max personal chats members list "Book club"`

#### `max chats members check` [#max-chats-members-check]

members that look like bots, each with its reasons — read from the member list and the local store; never one request per person, and it removes nobody

```sh
max chats members check <chat> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--max-pages <pages>` | at most this many pages of 200 members, a pause between them (default: 10). |
| `--deep <n>` | also check the top n in full — profile, photos and everything they wrote — one person a second; the public ban lists cover Telegram only, so nothing is sent. |

**Returns:** member — id, name, username, role, last_seen_at, registered_at, joined_at, invited_by, and 7 more; every field: max commands info chats members check

**Next usually:** `max contacts show <person>`, `max contacts notes list <person> [query]`, `max contacts notes show <person> <id>`

**Example:** `max personal chats members check "Book club"`

#### `max chats members history` [#max-chats-members-history]

who joined, who left and whose profile changed, oldest first — what chats members fetch recorded in the local store; never asks the messenger

```sh
max chats members history <chat> [query]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

**Returns:** chat event — chat_id, time, type, people, message_id, by, title, before; every field: max commands info chats members history

**Example:** `max personal chats members history "Book club"`

#### `max chats members fetch` [#max-chats-members-fetch]

read a group's whole member list into the local store's member history: who joined, who left, daily counts and profile changes; someone is recorded as gone only when every member was read

**Changes something only on this computer.**

```sh
max chats members fetch <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--track` | also fetch it daily while serve runs; chats tracking lists and edits those chats. |
| `--max-pages <pages>` | at most this many pages of 200 members, a pause between them (default: 10). |

**Returns:** chat members fetch — chat_id, joined, gone, changed, read, participants, complete, more, and 1 more; every field: max commands info chats members fetch

**Example:** `max personal chats members fetch "Book club"`

#### `max chats members add` [#max-chats-members-add]

add people; they are told

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats members add <chat> <person> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | required | an id, or part of a name. |

| Option | Purpose |
|---|---|
| `--history` | the people added also see the messages from before they came. |

**Returns:** chat members change — operation_id, chat_id, added, not_added, removed; every field: max commands info chats members add

**Example:** `max personal chats members add "Book club" "Alex Example"`

#### `max chats members remove` [#max-chats-members-remove]

remove people; their messages stay

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats members remove <chat> <person>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | required | an id, or part of a name. |

**Returns:** chat members change — operation_id, chat_id, added, not_added, removed; every field: max commands info chats members remove

**Example:** `max personal chats members remove "Book club" "Alex Example"`

### `max chats admins` [#max-chats-admins]

give or take back a member's admin rights

#### `max chats admins add` [#max-chats-admins-add]

make a member an admin with these rights

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats admins add <chat> <person> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | required | an id, or part of a name. |

| Option | Purpose |
|---|---|
| `--can <rights>` | what they may do, comma-separated: read, members, admins, info, pin, link, post, edit, delete. |

**Returns:** chat admin change — operation_id, chat_id, person_id, rights; every field: max commands info chats admins add

**Example:** `max personal chats admins add "Book club" "Alex Example" --can info`

#### `max chats admins remove` [#max-chats-admins-remove]

take an admin's rights back; they stay a member

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats admins remove <chat> <person>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | required | an id, or part of a name. |

**Returns:** chat admin change — operation_id, chat_id, person_id, rights; every field: max commands info chats admins remove

**Example:** `max personal chats admins remove "Book club" "Alex Example"`

### `max chats update` [#max-chats-update]

rename a group or channel, change its description, or turn one of its settings on or off

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats update <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--title <title>` | the new name. |
| `--description <text>` | the new description. |
| `--photo <file>` | a new photo for it — an image file. |
| `--all-can-pin <on\|off>` | every member may pin messages. |
| `--only-admins-add <on\|off>` | only admins may add members. |
| `--only-admins-call <on\|off>` | only admins may start a call. |
| `--only-owner-edits-info <on\|off>` | only the owner may change the name and photo. |
| `--members-see-link <on\|off>` | members may see the invite link. |

**Returns:** chat group change — operation_id, chat, requested; every field: max commands info chats update

**Example:** `max personal chats update "Book club" --title "Reading group"`

### `max chats links` [#max-chats-links]

a group's invite link

#### `max chats links show` [#max-chats-links-show]

the invite link, if you may see it

```sh
max chats links show <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

**Returns:** chat invite — chat_id, title, link; every field: max commands info chats links show

**Example:** `max personal chats links show "Book club"`

#### `max chats links reset` [#max-chats-links-reset]

replace the invite link; the old one stops working

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats links reset <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

**Returns:** chat group change — operation_id, chat, requested; every field: max commands info chats links reset

**Example:** `max personal chats links reset "Book club"`

### `max chats requests` [#max-chats-requests]

requests to join a MAX channel needing approval

#### `max chats requests list` [#max-chats-requests-list]

pending requests to join a MAX channel needing approval; admins only; requestedAt is null

```sh
max chats requests list <chat> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--limit <n>` | how many to show. |
| `--page <n>` | which page, starting at 1. |

**Returns:** join request — person_id, name, username, requested_at, about; every field: max commands info chats requests list

**Example:** `max personal chats requests list "Book club"`

#### `max chats requests confirm` [#max-chats-requests-confirm]

let them in; the group sees them join

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats requests confirm <chat> [person] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | optional | who asked: an id from `chats requests list`. |

| Option | Purpose |
|---|---|
| `--all` | every pending request, counted against the hourly limit first. |

**Returns:** chat request change — operation_id, chat_id, person_id, accepted, already, counted; every field: max commands info chats requests confirm

**Example:** `max personal chats requests confirm "Book club" "Alex Example"`

#### `max chats requests reject` [#max-chats-requests-reject]

turn the request away

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats requests reject <chat> [person] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |
| `person` | optional | who asked: an id from `chats requests list`. |

| Option | Purpose |
|---|---|
| `--all` | every pending request, counted against the hourly limit first. |

**Returns:** chat request change — operation_id, chat_id, person_id, accepted, already, counted; every field: max commands info chats requests reject

**Example:** `max personal chats requests reject "Book club" "Alex Example"`

### `max chats moderate` [#max-chats-moderate]

judge a group's new messages and members by its rules, and act as they allow

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats moderate <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--since-time <time>` | judge what came after this ISO 8601 time, or 2h / 1d ago; the saved point stays. |
| `--dry-run` | judge and plan; do nothing. |
| `--allow-dangerous` | yes to every action whose level in the group's rules is ask. |
| `--max-actions <n>` | at most this many actions in one run; 10 if not given. |

**Returns:** chat moderation — chat_id, rows; every field: max commands info chats moderate

**Example:** `max personal chats moderate "Book club" --dry-run`

### `max chats delete` [#max-chats-delete]

delete a chat from this account; the others in it keep it and its messages

**Changes something outside this computer: in MAX or in an external service.**

```sh
max chats delete <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--allow-dangerous` | go ahead without the question an ask level puts before a deletion. |

**Returns:** chat removal — operation_id, chat_id; every field: max commands info chats delete

**Example:** `max personal chats delete "Book club"`

## `max stats` [#max-stats]

statistics about messages, chats and their authors

### `max stats messages` [#max-stats-messages]

message statistics from the local store

#### `max stats messages show` [#max-stats-messages-show]

how many stored messages match, by chat, sender, day or hour — the local store only; optionally fetches new messages with --sync-first

```sh
max stats messages show [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query, as for search messages; none counts every stored message; with --saved, more words AND-ed to it. |

| Option | Purpose |
|---|---|
| `--sync-first` | first fetch new messages within the chat, time and message bounds. |
| `--max-chats <n>` | refresh at most this many chats (default: 5). |
| `--sync-time <duration>` | stop fetching after this long (default: 30s). |
| `--max-messages <n>` | fetch at most this many messages total (default: 500). |
| `--by <group>` | count by chat, sender, day or hour (default: chat). |
| `--chat <chat>` | only this chat — the same as chat: in the query; a chat: its id, or part of its title. |
| `--source <accounts>` | every account of this messenger held in the store; personal, bots or all — the same as in: in the query. |
| `--limit <n>` | how many rows. |
| `--timezone <zone>` | the IANA timezone for calendar days and hours. |
| `--exact` | bare words and quotes match their exact form only, as exact:word does; text: still matches every form. |
| `--saved <name\|id>` | count what a saved search or an earlier run matches; options typed here replace its own. |

**Returns:** message counts — by, total, rows; every field: max commands info stats messages show

**Example:** `max personal stats messages show --chat "Book club" --by day`

#### `max stats messages counters` [#max-stats-messages-counters]

per-counter observations and bounded remote refresh

#### `max stats messages counters show` [#max-stats-messages-counters-show]

show saved counter values and their observation freshness

```sh
max stats messages counters show [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | strict Lucene query over stored messages. |

| Option | Purpose |
|---|---|
| `--chat <chat>` | only this chat; a chat: its id, or part of its title. |
| `--source <accounts>` | held accounts of this messenger; refresh uses the active account. |
| `--exact` | bare words match exact forms. |
| `--timezone <zone>` | IANA timezone for query dates. |
| `--selection <json>` | pinned counter-targets selection from counters show; conflicts with query and scope. |
| `--counters <names>` | distinct views,reactions,comments fields; all three by default. |
| `--limit <n>` | messages, 1–100; 20 by default. |
| `--max-age <duration>` | maximum fresh observation age; 24h by default. |

**Returns:** counters — cutoff, max_age_ms, selection, rows; every field: max commands info stats messages counters show

**Example:** `max personal stats messages counters show --chat "Book club" --limit 10`

#### `max stats messages counters sync` [#max-stats-messages-counters-sync]

read authoritative counters for bounded messages and update their local observations

**Changes something only on this computer.**

```sh
max stats messages counters sync [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | strict Lucene query over stored messages. |

| Option | Purpose |
|---|---|
| `--chat <chat>` | only this chat; a chat: its id, or part of its title. |
| `--source <accounts>` | held accounts of this messenger; refresh uses the active account. |
| `--exact` | bare words match exact forms. |
| `--timezone <zone>` | IANA timezone for query dates. |
| `--selection <json>` | pinned counter-targets selection from counters show; conflicts with query and scope. |
| `--counters <names>` | distinct views,reactions,comments fields; all three by default. |
| `--limit <n>` | messages, 1–100; 20 by default. |
| `--max-messages <n>` | maximum messages to refresh, 1–100. |
| `--sync-time <duration>` | remote refresh budget; 30s by default, maximum 5m. |
| `--dry-run` | preview exact stored targets and counter capabilities without connecting. |

**Returns:** counter refresh — dry_run, targets, counters, supported, unsupported, max_messages, time_ms, results, and 2 more; every field: max commands info stats messages counters sync

**Example:** `max personal stats messages counters sync --chat "Book club" --dry-run`

#### `max stats messages unanswered` [#max-stats-messages-unanswered]

oldest detected questions without an observed qualifying explicit reply

```sh
max stats messages unanswered [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query; none selects every stored message. |

| Option | Purpose |
|---|---|
| `--source <accounts>` | every held account of this messenger; personal, bots or all. |
| `--saved <name\|id>` | run a saved report of this kind; typed report options replace stored options. |
| `--timezone <zone>` | the IANA timezone for calendar date boundaries. |
| `--limit <n>` | report rows, 1–100; 20 if not given. |
| `--answerer <person>` | stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more. |

**Returns:** admin report — report, cutoff, total, summary, quality, rows; every field: max commands info stats messages unanswered

**Example:** `max personal stats messages unanswered chat:"Project room"`

#### `max stats messages discussion` [#max-stats-messages-discussion]

viewed posts with little recorded discussion

```sh
max stats messages discussion [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query; none selects every stored message. |

| Option | Purpose |
|---|---|
| `--source <accounts>` | every held account of this messenger; personal, bots or all. |
| `--saved <name\|id>` | run a saved report of this kind; typed report options replace stored options. |
| `--timezone <zone>` | the IANA timezone for calendar date boundaries. |
| `--limit <n>` | report rows, 1–100; 20 if not given. |

**Returns:** admin report — report, cutoff, total, summary, quality, rows; every field: max commands info stats messages discussion

**Example:** `max personal stats messages discussion chat:"Book club"`

#### `max stats messages responses` [#max-stats-messages-responses]

how long the owner took to answer (--who me), or the other side took to answer the owner (--who others), in one-to-one chats — the local store only. Several messages in a row followed by one answer count as one reply, timed from the first unanswered message; the day of a row is the day of the reply

```sh
max stats messages responses [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | date:, chat:, kind: and muted: terms, AND-ed — date>=30d, date:[60d TO 30d], muted:false; none reads all time. |

| Option | Purpose |
|---|---|
| `--who <side>` | whose replies: the owner's or the other side's. One of: `me`, `others`. |
| `--by <group>` | one row per calendar day of the reply, or none. One of: `day`, `total`. |
| `--timezone <zone>` | the IANA timezone for calendar days and date: bounds. |
| `--source <accounts>` | every account of this messenger held in the store; personal, bots or all. |

**Returns:** response times — who, replies, median_ms, p90_ms, mean_ms, buckets, rows; every field: max commands info stats messages responses

**Example:** `max personal stats messages responses --who me --by day --timezone Europe/Madrid -- date>=30d`

#### `max stats messages waiting` [#max-stats-messages-waiting]

how many chats wait on the owner — the local store only: a one-to-one chat whose newest message is a question, or a group whose newest message mentions the owner or replies to them. Muted or archived one-to-one chats are left out, as inbox leaves them out; date: bounds the newest message's time

```sh
max stats messages waiting [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | date:, chat:, kind: and muted: terms, AND-ed — date>=30d, date:[60d TO 30d], muted:false; none reads all time. |

| Option | Purpose |
|---|---|
| `--timezone <zone>` | the IANA timezone for date: bounds. |
| `--source <accounts>` | every account of this messenger held in the store; personal, bots or all. |

**Returns:** waiting chats — chats, messages, oldest_at, by_kind; every field: max commands info stats messages waiting

**Example:** `max personal stats messages waiting kind:private`

#### `max stats messages top` [#max-stats-messages-top]

rank stored messages by a measure or explainable score; counters are snapshots with per-field observation freshness

```sh
max stats messages top [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query; none selects every stored message. |

| Option | Purpose |
|---|---|
| `--sync-first` | first fetch new messages within the chat, time and message bounds. |
| `--max-chats <n>` | refresh at most this many chats (default: 5). |
| `--sync-time <duration>` | stop fetching after this long (default: 30s). |
| `--max-messages <n>` | fetch at most this many messages total (default: 500). |
| `--measure <name>` | the ranking metric; not with score or weights. One of: `views`, `reactions`, `forwards`, `comments`, `replies`, `thread-size`. |
| `--score <preset>` | helpful/active for authors; engaging for either target. One of: `helpful`, `active`, `engaging`. |
| `--weights <json>` | the complete component weights; replaces preset weights. |
| `--source <accounts>` | every held account of this messenger; personal, bots or all. |
| `--timezone <zone>` | the IANA timezone for dates and active days. |
| `--limit <n>` | ranked rows, 1–100. |
| `--saved <name\|id>` | run a saved query or ranking run; typed options replace stored options. |

**Returns:** ranking — target, measure, order, preset, weights, min_messages, message_kind, total, and 7 more; every field: max commands info stats messages top

**Example:** `max personal stats messages top chat:"Book club" --limit 10`

#### `max stats messages evidence` [#max-stats-messages-evidence]

bounded messages, answer pairs or retention members from an exact drilldown selection

```sh
max stats messages evidence <message> [options]
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | the canonical message locator, or retention cohort reference, from drilldown. |

| Option | Purpose |
|---|---|
| `--selection <json>` | the resolved ranking selection returned in drilldown. |
| `--component <name>` | the exposed ranking component. |
| `--limit <n>` | evidence rows, 1–100; 20 if not given. |
| `--cursor <cursor>` | continue the same component and stored-evidence fingerprint. |

**Returns:** evidence — message, contribution, related, counters, person_ref, joined_at, cohort, checkpoints, and 2 more; every field: max commands info stats messages evidence

**Example:** `max personal stats messages evidence "$message" --selection "$selection" --component reactions`

### `max stats contacts` [#max-stats-contacts]

statistics about human authors

#### `max stats contacts responses` [#max-stats-contacts-responses]

counts and median/p90 latency for selected human answering identities

```sh
max stats contacts responses [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query; none selects every stored message. |

| Option | Purpose |
|---|---|
| `--source <accounts>` | every held account of this messenger; personal, bots or all. |
| `--saved <name\|id>` | run a saved report of this kind; typed report options replace stored options. |
| `--timezone <zone>` | the IANA timezone for calendar date boundaries. |
| `--limit <n>` | report rows, 1–100; 20 if not given. |
| `--answerer <person>` | stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more. |

**Returns:** admin report — report, cutoff, total, summary, quality, rows; every field: max commands info stats contacts responses

**Example:** `max personal stats contacts responses chat:"Project room"`

#### `max stats contacts top` [#max-stats-contacts-top]

rank the human authors of stored messages by a measure or explainable score; counters are snapshots with per-field observation freshness

```sh
max stats contacts top [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | a strict Lucene query; none selects every stored message. |

| Option | Purpose |
|---|---|
| `--sync-first` | first fetch new messages within the chat, time and message bounds. |
| `--max-chats <n>` | refresh at most this many chats (default: 5). |
| `--sync-time <duration>` | stop fetching after this long (default: 30s). |
| `--max-messages <n>` | fetch at most this many messages total (default: 500). |
| `--measure <name>` | the ranking metric; not with score or weights. One of: `messages`, `words`, `reactions`, `replies`, `answers`, `answer-time`, `threads`, `active-days`. |
| `--score <preset>` | helpful/active for authors; engaging for either target. One of: `helpful`, `active`, `engaging`. |
| `--weights <json>` | the complete component weights; replaces preset weights. |
| `--source <accounts>` | every held account of this messenger; personal, bots or all. |
| `--timezone <zone>` | the IANA timezone for dates and active days. |
| `--limit <n>` | ranked rows, 1–100. |
| `--saved <name\|id>` | run a saved query or ranking run; typed options replace stored options. |

**Returns:** ranking — target, measure, order, preset, weights, min_messages, message_kind, total, and 7 more; every field: max commands info stats contacts top

**Example:** `max personal stats contacts top chat:"Book club" --limit 10`

#### `max stats contacts evidence` [#max-stats-contacts-evidence]

bounded messages, answer pairs or retention members from an exact drilldown selection

```sh
max stats contacts evidence <person> [options]
```

| Argument | | Meaning |
|---|---|---|
| `person` | required | the exact native person id from the ranking row. |

| Option | Purpose |
|---|---|
| `--selection <json>` | the resolved ranking selection returned in drilldown. |
| `--component <name>` | the exposed ranking component. |
| `--limit <n>` | evidence rows, 1–100; 20 if not given. |
| `--cursor <cursor>` | continue the same component and stored-evidence fingerprint. |

**Returns:** evidence — message, contribution, related, counters, person_ref, joined_at, cohort, checkpoints, and 2 more; every field: max commands info stats contacts evidence

**Example:** `max personal stats contacts evidence 101 --selection "$selection" --component messages`

### `max stats chats` [#max-stats-chats]

statistics about one chat

#### `max stats chats show` [#max-stats-chats-show]

a group's or channel's numbers for a period: messages, active members, replies, reactions, questions answered, joins and leaves — counted from the local store; joins and leaves are asked of the messenger

```sh
max stats chats show <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--since-time <time>` | ISO 8601, or 2h / 1d ago; 7 days ago if not given. |
| `--by <group>` | also one row per calendar day or week (weeks start on Monday). |
| `--timezone <zone>` | the IANA timezone for calendar days. |

**Returns:** chat stats — chat, since, until, complete, completeness, messages, senders, replies, and 10 more; every field: max commands info stats chats show

**Example:** `max personal stats chats show "Book club"`

#### `max stats chats newcomers` [#max-stats-chats-newcomers]

known-join members and their help within a join window

```sh
max stats chats newcomers <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--since-time <time>` | from this ISO 8601 time, or 2h / 1d ago; 30d ago if not given. |
| `--until-time <time>` | through this ISO 8601 time, or 2h / 1d ago. |
| `--within <duration>` | the help window after a known newcomer join. |
| `--saved <name\|id>` | run a saved report of this kind; typed report options replace stored options. |
| `--timezone <zone>` | the IANA timezone for calendar date boundaries. |
| `--limit <n>` | report rows, 1–100; 20 if not given. |
| `--answerer <person>` | stored name, alias, @username, ID or person:provider/account/id; ambiguous names require a choice; repeat for more. |

**Returns:** admin report — report, cutoff, total, summary, quality, rows; every field: max commands info stats chats newcomers

**Example:** `max personal stats chats newcomers "Book club"`

#### `max stats chats retention` [#max-stats-chats-retention]

joining cohorts and observed checkpoint membership from saved roster observations

```sh
max stats chats retention <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--since-time <time>` | joining period starts at ISO 8601 or a relative time; last 90 days by default. |
| `--until-time <time>` | joining period ends at this time; now by default. |
| `--checkpoints <durations>` | up to 10 increasing joining ages, comma separated; 1d,7d,30d by default. |
| `--within <duration>` | activity and early departure window after joining; 7d by default. |
| `--by <group>` | group joining dates by calendar day or Monday week. One of: `day`, `week`. |
| `--timezone <zone>` | IANA timezone for joining cohorts. |
| `--limit <n>` | cohorts and member evidence, 1–100. |

**Returns:** retention — chat_ref, cutoff, since, until, checkpoints_ms, within_ms, by, timezone, and 5 more; every field: max commands info stats chats retention

**Example:** `max personal stats chats retention "Book club"`

### `max stats tasks` [#max-stats-tasks]

task statistics

#### `max stats tasks show` [#max-stats-tasks-show]

tasks per chat, meeting or project: open now, and opened and closed in the period (created: in the query), with the median time to close and the mean age of the open ones

```sh
max stats tasks show [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--by <group>` | chat (default) or meeting: this account's tasks; project: the owner's project tasks, every project. |
| `--chat <chat>` | only this chat; a chat: its id, or part of its title. |
| `--type <type>` | only this type: question, request, mention or promise. |
| `--timezone <zone>` | the IANA timezone for calendar days in the period, such as created>=today. |

**Returns:** task — ref, id, title, kind, state, created_at, key, description, and 26 more; every field: max commands info stats tasks show

**Next usually:** `max tasks show <task>`, `max tasks related <task>`, `max tasks update <task>`

**Example:** `max personal stats tasks show --chat "Project room"`

### `max stats charts` [#max-stats-charts]

a chart's data from a chat's statistics, and optionally a dark SVG or PNG image

**Changes something only on this computer.**

```sh
max stats charts <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat: its id, or part of its title. |

| Option | Purpose |
|---|---|
| `--chart-kind <messages\|active\|membership>` | what to draw: messages, active authors, or joins and leaves. Default: `messages`. |
| `--by <group>` | one point per calendar day or week (weeks start on Monday). Default: `day`. |
| `--since-time <time>` | ISO 8601, or 2h / 1d ago; 7 days ago if not given. |
| `--timezone <zone>` | the IANA timezone for calendar days. |
| `--output <file>` | write a dark image to a new .svg or .png file. |

**Returns:** chart — version, kind, title, x, series, unit, timezone, partial, and 2 more; every field: max commands info stats charts

**Example:** `max personal stats charts "Book club" --output ./activity.svg`

## Exit codes [#exit-codes]

Scripts should branch on the code, not the message: wording may change, codes remain stable.

| Code | Meaning |
|---|---|
| `0` | Success |
| `2` | `validation_error` |
| `3` | `configuration_error` |
| `4` | `authentication_error` |
| `5` | `permission_error` |
| `6` | `not_found` |
| `7` | `confirmation_required` |
| `8` | `rate_limited` |
| `9` | `timeout` |
| `10` | `network_error` |
| `11` | `provider_error` |
| `12` | `provider_unavailable` |
| `13` | `invalid_response` |
| `14` | `outcome_unknown` |
| `15` | `conflict` |
| `130` | `cancelled` |
| `1` | Any other error |

`0`, and only `0`, means the operation succeeded. `14` — `outcome_unknown` — means the message **may** have been sent: its outcome is neither confirmed nor failed. Retry only with the same `--operation-id`.
