mattermost-cli 0.0.3__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/PKG-INFO +50 -15
  2. mattermost_cli-0.0.4/README.md +112 -0
  3. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/docs/01-guide/01-commands.md +115 -67
  4. mattermost_cli-0.0.4/docs/01-guide/02-json-output.md +235 -0
  5. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/docs/01-guide/04-tips.md +8 -8
  6. mattermost_cli-0.0.4/docs/index.md +89 -0
  7. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/docs/quickstart.md +7 -0
  8. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/cli.py +1 -1
  9. mattermost_cli-0.0.4/mmchat/commands/files.py +52 -0
  10. mattermost_cli-0.0.4/mmchat/downloads.py +62 -0
  11. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/formatters.py +24 -5
  12. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/skills/mattermost/SKILL.md +13 -0
  13. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/skills/mattermost/references/commands.md +16 -0
  14. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/tests/test_client.py +32 -0
  15. mattermost_cli-0.0.4/tests/test_downloads.py +57 -0
  16. mattermost_cli-0.0.3/README.md +0 -77
  17. mattermost_cli-0.0.3/docs/01-guide/02-json-output.md +0 -135
  18. mattermost_cli-0.0.3/docs/index.md +0 -72
  19. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/.github/workflows/docs.yml +0 -0
  20. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/.github/workflows/publish.yml +0 -0
  21. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/.gitignore +0 -0
  22. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/AGENTS.md +0 -0
  23. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/LICENSE +0 -0
  24. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/docs/01-guide/03-authentication.md +0 -0
  25. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/docs/config.toml +0 -0
  26. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/__init__.py +0 -0
  27. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/client.py +0 -0
  28. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/__init__.py +0 -0
  29. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/auth.py +0 -0
  30. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/channels.py +0 -0
  31. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/messages.py +0 -0
  32. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/overview.py +0 -0
  33. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/people.py +0 -0
  34. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/commands/search.py +0 -0
  35. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/config.py +0 -0
  36. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/helpers.py +0 -0
  37. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/resolve.py +0 -0
  38. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/mmchat/time_utils.py +0 -0
  39. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/pyproject.toml +0 -0
  40. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/skills/mattermost/references/scenarios.md +0 -0
  41. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/skills/mattermost/references/setup.md +0 -0
  42. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/skills/mattermost/references/workflows.md +0 -0
  43. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/tests/__init__.py +0 -0
  44. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/tests/test_config.py +0 -0
  45. {mattermost_cli-0.0.3 → mattermost_cli-0.0.4}/tests/test_time_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mattermost-cli
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: Mattermost CLI for humans and agents
5
5
  Project-URL: Homepage, https://github.com/rhnvrm/mattermost-cli
6
6
  Project-URL: Repository, https://github.com/rhnvrm/mattermost-cli
@@ -39,17 +39,16 @@ uvx --from mattermost-cli mm --help
39
39
 
40
40
  # Or install globally
41
41
  pip install mattermost-cli
42
- mm --help
43
42
  ```
44
43
 
45
44
  ## Setup
46
45
 
47
46
  ```bash
48
47
  # Interactive login (password + MFA)
49
- mm login
48
+ mm login --url https://chat.example.com
50
49
 
51
50
  # Or with a Personal Access Token
52
- mm login --token <your-pat>
51
+ mm login --url https://chat.example.com --token <your-pat>
53
52
 
54
53
  # Verify
55
54
  mm whoami
@@ -58,23 +57,59 @@ mm whoami
58
57
  ## Usage
59
58
 
60
59
  ```bash
61
- # List channels
62
- mm channels
60
+ # Get oriented (mentions + unread + active channels in one call)
61
+ mm overview
63
62
 
64
- # Show unread messages
65
- mm unread
66
-
67
- # Read messages from a channel
63
+ # Read messages
68
64
  mm messages general
69
65
  mm messages general --since 1h
70
- mm messages @username # DM with a user
66
+ mm messages general --threads # thread index view
67
+ mm messages @alice # DM with a user
71
68
 
72
- # Read a thread
73
- mm thread <post-id>
69
+ # Threads
70
+ mm thread <post-id> # root + last 9 replies
71
+ mm thread <post-id> --limit 0 # full thread
74
72
 
75
- # Search
73
+ # Search and mentions
76
74
  mm search "deployment issue"
77
- mm mentions
75
+ mm mentions # @-mentions in last 24h
76
+
77
+ # Download files by file ID
78
+ mm download abc123def456ghi789jkl012
79
+ mm download abc123... def456... --output downloads/
80
+
81
+ # Channel info
82
+ mm channel general # purpose, members, pinned count
83
+ mm channels --since 6h # recently active channels
84
+ mm unread # channels with unread messages
85
+ mm pinned general # pinned posts
86
+ mm members general # who's in the channel
87
+
88
+ # People
89
+ mm user @alice # profile, status, timezone
90
+ ```
91
+
92
+ ## JSON Output
93
+
94
+ All commands output JSON by default. Key fields:
95
+
96
+ - **`thread_id`** on every post - pass to `mm thread`
97
+ - **`ref`** on channel entries - pass to `mm messages`
98
+ - **`files[].id`** on posts with attachments - pass to `mm download`
99
+ - **`is_bot`** / **`bot_name`** - webhook/bot posts flagged automatically
100
+ - **`root`** on reply-mentions - the original message being replied to
101
+ - **`reactions`** - emoji counts like `{"+1": 3}`
102
+
103
+ Webhook posts automatically extract alert content from Slack-format attachments.
104
+
105
+ Add `--human` for readable markdown output instead.
106
+
107
+ ## Agent Skill
108
+
109
+ Install as a coding agent skill:
110
+
111
+ ```bash
112
+ npx skills add rhnvrm/mattermost-cli
78
113
  ```
79
114
 
80
115
  ## Options
@@ -0,0 +1,112 @@
1
+ # mattermost-cli
2
+
3
+ Mattermost CLI for humans and agents.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # Run directly (no install)
9
+ uvx --from mattermost-cli mm --help
10
+
11
+ # Or install globally
12
+ pip install mattermost-cli
13
+ ```
14
+
15
+ ## Setup
16
+
17
+ ```bash
18
+ # Interactive login (password + MFA)
19
+ mm login --url https://chat.example.com
20
+
21
+ # Or with a Personal Access Token
22
+ mm login --url https://chat.example.com --token <your-pat>
23
+
24
+ # Verify
25
+ mm whoami
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```bash
31
+ # Get oriented (mentions + unread + active channels in one call)
32
+ mm overview
33
+
34
+ # Read messages
35
+ mm messages general
36
+ mm messages general --since 1h
37
+ mm messages general --threads # thread index view
38
+ mm messages @alice # DM with a user
39
+
40
+ # Threads
41
+ mm thread <post-id> # root + last 9 replies
42
+ mm thread <post-id> --limit 0 # full thread
43
+
44
+ # Search and mentions
45
+ mm search "deployment issue"
46
+ mm mentions # @-mentions in last 24h
47
+
48
+ # Download files by file ID
49
+ mm download abc123def456ghi789jkl012
50
+ mm download abc123... def456... --output downloads/
51
+
52
+ # Channel info
53
+ mm channel general # purpose, members, pinned count
54
+ mm channels --since 6h # recently active channels
55
+ mm unread # channels with unread messages
56
+ mm pinned general # pinned posts
57
+ mm members general # who's in the channel
58
+
59
+ # People
60
+ mm user @alice # profile, status, timezone
61
+ ```
62
+
63
+ ## JSON Output
64
+
65
+ All commands output JSON by default. Key fields:
66
+
67
+ - **`thread_id`** on every post - pass to `mm thread`
68
+ - **`ref`** on channel entries - pass to `mm messages`
69
+ - **`files[].id`** on posts with attachments - pass to `mm download`
70
+ - **`is_bot`** / **`bot_name`** - webhook/bot posts flagged automatically
71
+ - **`root`** on reply-mentions - the original message being replied to
72
+ - **`reactions`** - emoji counts like `{"+1": 3}`
73
+
74
+ Webhook posts automatically extract alert content from Slack-format attachments.
75
+
76
+ Add `--human` for readable markdown output instead.
77
+
78
+ ## Agent Skill
79
+
80
+ Install as a coding agent skill:
81
+
82
+ ```bash
83
+ npx skills add rhnvrm/mattermost-cli
84
+ ```
85
+
86
+ ## Options
87
+
88
+ ```
89
+ --human Human-readable markdown output (default is JSON)
90
+ --team Filter to a specific team
91
+ --debug Enable debug output
92
+ ```
93
+
94
+ ## Auth
95
+
96
+ Two methods supported:
97
+
98
+ **Password + MFA** (primary): `mm login` prompts interactively. Session token
99
+ is stored locally - password is never saved to disk. When the session expires,
100
+ run `mm login` again.
101
+
102
+ **Personal Access Token** (optional): `mm login --token <pat>`. Requires admin
103
+ to enable PATs on the Mattermost server. Tokens don't expire.
104
+
105
+ Credentials stored at `~/.config/mm/config.json` (token only, 600 permissions).
106
+
107
+ Environment variables override config: `MATTERMOST_URL`, `MATTERMOST_TOKEN`,
108
+ `MATTERMOST_TEAM`.
109
+
110
+ ## License
111
+
112
+ MIT
@@ -7,75 +7,17 @@ description: Complete command reference
7
7
 
8
8
  All commands output JSON by default. Add `--human` before any command for markdown output. Add `--team <name>` to filter to a specific team.
9
9
 
10
- ## mm login
11
-
12
- Authenticate with your Mattermost server.
13
-
14
- ```bash
15
- mm login # Interactive: password + MFA
16
- mm login --token <pat> # Personal Access Token
17
- ```
18
-
19
- Password login prompts for server URL, username, password, and (if enabled) MFA token. The session token is stored -- your password is never written to disk.
20
-
21
- When the session expires, run `mm login` again.
22
-
23
- ## mm logout
24
-
25
- Revoke the current session and clear stored credentials.
26
-
27
- ```bash
28
- mm logout
29
- ```
30
-
31
- ## mm whoami
10
+ ## mm overview
32
11
 
33
- Show current user info and validate that auth is working.
12
+ Get oriented in one call. Returns mentions, unread channels, and recently active channels.
34
13
 
35
14
  ```bash
36
- mm whoami
15
+ mm overview # Last 6 hours (default)
16
+ mm overview --since 1d # Last 24 hours
17
+ mm overview --since 0 # No time filter
37
18
  ```
38
19
 
39
- Returns your user ID, username, display name, email, and list of teams.
40
-
41
- ## mm unread
42
-
43
- Show channels with unread messages.
44
-
45
- ```bash
46
- mm unread
47
- mm unread --team Engineering
48
- ```
49
-
50
- Returns channels sorted by mention count (descending), then unread count.
51
-
52
- Each entry includes:
53
-
54
- | Field | Description |
55
- |-------|-------------|
56
- | `channel_id` | Internal channel ID |
57
- | `channel` | Display name |
58
- | `ref` | Use this with `mm messages <ref>` |
59
- | `type` | Public, Private, DM, or Group DM |
60
- | `unread` | Number of unread messages |
61
- | `mentions` | Number of @mentions |
62
- | `team` | Team name |
63
- | `last_post_at` | Timestamp of last post |
64
-
65
- The `ref` field is important: for named channels it's the channel name (e.g. `general`), for DMs and group DMs it's the channel ID (since their display names aren't addressable). Always use `ref` when passing a channel to other commands.
66
-
67
- ## mm mentions
68
-
69
- Show posts that @mention you.
70
-
71
- ```bash
72
- mm mentions # Last 24 hours (default)
73
- mm mentions --since 2h # Last 2 hours
74
- mm mentions --since 0 # All time
75
- mm mentions --limit 10 # Max 10 results
76
- ```
77
-
78
- Results are grouped by channel in `--human` mode.
20
+ This is the best starting point - it replaces separate calls to `mm mentions`, `mm unread`, and `mm channels --since`.
79
21
 
80
22
  ## mm messages
81
23
 
@@ -88,9 +30,12 @@ mm messages abc123def456... # By channel ID (for group DMs)
88
30
  mm messages general --limit 10 # Last 10 messages
89
31
  mm messages general --since 2h # Messages from last 2 hours
90
32
  mm messages general --since today # Messages from today
33
+ mm messages general --threads # Thread index view
91
34
  ```
92
35
 
93
- For group DMs, use the `ref` field from `mm unread` or `mm channels` since group DM display names (e.g. "alice, bob, carol") aren't addressable.
36
+ The `--threads` flag groups messages by thread and shows root message + reply count + last reply. Useful for busy channels where flat messages are hard to follow.
37
+
38
+ For group DMs, use the `ref` field from `mm overview` or `mm channels` since group DM display names aren't addressable.
94
39
 
95
40
  ## mm thread
96
41
 
@@ -105,7 +50,29 @@ mm thread abc123def456... --since 1h # Root + replies from last hour
105
50
 
106
51
  The root message is always included regardless of `--limit` or `--since` so you have context.
107
52
 
108
- The post ID can be any post in the thread -- root or reply. The CLI resolves it to the full thread automatically.
53
+ The post ID can be any post in the thread (root or reply). The CLI resolves it to the full thread automatically.
54
+
55
+ ## mm download
56
+
57
+ Download one or more attached files by file ID.
58
+
59
+ ```bash
60
+ mm download abc123def456ghi789jkl012
61
+ mm download abc123... def456... --output downloads/
62
+ ```
63
+
64
+ Use the `files[].id` field from `mm messages`, `mm thread`, `mm mentions`, `mm pinned`, or `mm search` JSON output.
65
+
66
+ ## mm mentions
67
+
68
+ Show posts that @mention you. Reply-mentions include a `root` field with the original message being replied to.
69
+
70
+ ```bash
71
+ mm mentions # Last 24 hours (default)
72
+ mm mentions --since 2h # Last 2 hours
73
+ mm mentions --since 0 # All time
74
+ mm mentions --limit 10 # Max 10 results
75
+ ```
109
76
 
110
77
  ## mm search
111
78
 
@@ -121,6 +88,17 @@ mm search "before:2026-03-01 incident" # Date filters
121
88
 
122
89
  Supports all [Mattermost search modifiers](https://docs.mattermost.com/collaborate/search-for-messages.html): `from:`, `in:`, `before:`, `after:`, `on:`, etc.
123
90
 
91
+ ## mm channel
92
+
93
+ Show info about a single channel.
94
+
95
+ ```bash
96
+ mm channel general
97
+ mm channel @alice # DM info
98
+ ```
99
+
100
+ Returns purpose, header, member count, pinned post count, last post time, and creation date.
101
+
124
102
  ## mm channels
125
103
 
126
104
  List all channels you belong to.
@@ -130,11 +108,81 @@ mm channels # All channels
130
108
  mm channels --type public # Only public channels
131
109
  mm channels --type dm # Only DMs
132
110
  mm channels --type group # Only group DMs
133
- mm channels --type private # Only private channels
111
+ mm channels --since 6h # Channels with recent activity
134
112
  ```
135
113
 
136
114
  Each entry includes a `ref` field for use with `mm messages`.
137
115
 
116
+ ## mm unread
117
+
118
+ Show channels with unread messages. Muted channels are hidden by default.
119
+
120
+ ```bash
121
+ mm unread
122
+ mm unread --include-muted
123
+ ```
124
+
125
+ Returns channels sorted by mention count (descending), then unread count.
126
+
127
+ ## mm pinned
128
+
129
+ Show pinned posts in a channel.
130
+
131
+ ```bash
132
+ mm pinned general
133
+ mm pinned general --limit 5
134
+ ```
135
+
136
+ Pinned posts are the channel's institutional memory - decisions, links, and important context.
137
+
138
+ ## mm members
139
+
140
+ List members of a channel with online status.
141
+
142
+ ```bash
143
+ mm members general
144
+ ```
145
+
146
+ Sorted by status (online first). Shows username, display name, position, and status.
147
+
148
+ ## mm user
149
+
150
+ Show user profile and status.
151
+
152
+ ```bash
153
+ mm user @alice
154
+ mm user alice # @ prefix is optional
155
+ ```
156
+
157
+ Returns name, position, email, status (online/away/offline/dnd), and timezone.
158
+
159
+ ## mm login
160
+
161
+ Authenticate with your Mattermost server.
162
+
163
+ ```bash
164
+ mm login --url https://chat.example.com # Interactive: password + MFA
165
+ mm login --url https://chat.example.com --token <pat> # Personal Access Token
166
+ ```
167
+
168
+ Password login prompts for username, password, and (if enabled) MFA token. The session token is stored - your password is never written to disk.
169
+
170
+ ## mm logout
171
+
172
+ Revoke the current session and clear stored credentials.
173
+
174
+ ```bash
175
+ mm logout
176
+ ```
177
+
178
+ ## mm whoami
179
+
180
+ Show current user info and validate that auth is working.
181
+
182
+ ```bash
183
+ mm whoami
184
+ ```
185
+
138
186
  ## Global options
139
187
 
140
188
  These go before the command name:
@@ -0,0 +1,235 @@
1
+ ---
2
+ title: JSON Output
3
+ description: Output format reference for programmatic use
4
+ ---
5
+
6
+ # JSON Output
7
+
8
+ All commands output JSON by default. This page documents the shape of each output.
9
+
10
+ ## Posts (messages, mentions, thread, search, pinned)
11
+
12
+ Every post has these fields:
13
+
14
+ ```json
15
+ {
16
+ "id": "ixtrtzkhk7fs9cayrz44uq5bgy",
17
+ "thread_id": "ixtrtzkhk7fs9cayrz44uq5bgy",
18
+ "is_reply": false,
19
+ "author": "@alice",
20
+ "message": "Can you check the deployment config?",
21
+ "created_at": "2026-03-05T06:52:30Z",
22
+ "channel": "engineering",
23
+ "channel_id": "eqdx3n8zo3yqzyf46sobm14uwa",
24
+ "file_count": 1
25
+ }
26
+ ```
27
+
28
+ | Field | Type | Description |
29
+ |-------|------|-------------|
30
+ | `id` | string | Post ID |
31
+ | `thread_id` | string | Root post ID if reply, own ID if root. Pass to `mm thread`. |
32
+ | `is_reply` | boolean | Whether this post is a reply in a thread |
33
+ | `author` | string | @username of the author |
34
+ | `message` | string | Post text content |
35
+ | `created_at` | string | ISO 8601 timestamp (UTC) |
36
+ | `channel` | string | Channel display name |
37
+ | `channel_id` | string | Channel ID |
38
+ | `file_count` | integer | Number of file attachments |
39
+
40
+ ### Conditional fields
41
+
42
+ These appear only when relevant:
43
+
44
+ | Field | When | Description |
45
+ |-------|------|-------------|
46
+ | `reply_count` | Root posts with replies | Number of replies in the thread |
47
+ | `files` | Posts with file metadata | Array of `{"id": "...", "name": "...", "size": 12345, "mime_type": "..."}` |
48
+ | `team` | Search and mentions output | Team display name |
49
+ | `is_bot` | Webhook/bot posts | Always `true` when present |
50
+ | `bot_name` | Webhook posts with a display name | The webhook's username (e.g. `"alertmatter"`) |
51
+ | `reactions` | Posts with emoji reactions | Object mapping emoji names to counts: `{"+1": 3}` |
52
+ | `root` | Reply-mentions in `mm mentions` | The original message: `{"author": "@bob", "message": "...", "created_at": "..."}` |
53
+
54
+ ### Bot detection
55
+
56
+ Posts from webhooks and bots are automatically flagged:
57
+
58
+ ```json
59
+ {
60
+ "author": "@webhook-user",
61
+ "is_bot": true,
62
+ "bot_name": "alertmatter",
63
+ "message": "FIRING: Host out of disk space..."
64
+ }
65
+ ```
66
+
67
+ When a webhook post has an empty `message` but includes Slack-format attachments (common for alert systems), the CLI extracts the alert text automatically. Without this, bot posts in alert channels would appear as empty messages.
68
+
69
+ ### Downloading files
70
+
71
+ When a post includes attachments, each file entry includes a stable `id` you can pass to `mm download`.
72
+
73
+ ```json
74
+ {
75
+ "id": "ixtrtzkhk7fs9cayrz44uq5bgy",
76
+ "file_count": 1,
77
+ "files": [
78
+ {
79
+ "id": "abc123def456ghi789jkl012",
80
+ "name": "incident-report.pdf",
81
+ "size": 48213,
82
+ "mime_type": "application/pdf",
83
+ "extension": "pdf"
84
+ }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ `mm download` returns one record per saved file:
90
+
91
+ ```json
92
+ [
93
+ {
94
+ "file_id": "abc123def456ghi789jkl012",
95
+ "name": "incident-report.pdf",
96
+ "size": 48213,
97
+ "mime_type": "application/pdf",
98
+ "saved_to": "downloads/incident-report.pdf"
99
+ }
100
+ ]
101
+ ```
102
+
103
+ ## Overview (overview command)
104
+
105
+ ```json
106
+ {
107
+ "since": "6h",
108
+ "mentions": [...],
109
+ "unread": [...],
110
+ "active_channels": [...]
111
+ }
112
+ ```
113
+
114
+ | Section | Contents |
115
+ |---------|----------|
116
+ | `mentions` | Posts that @-mention you (same shape as mentions command, with `root` on replies) |
117
+ | `unread` | Channels with unread messages: `{channel, ref, type, unread, last_post_at}` |
118
+ | `active_channels` | Channels with recent posts: `{channel, ref, type, last_post_at}` |
119
+
120
+ ## Thread index (messages --threads)
121
+
122
+ ```json
123
+ [
124
+ {
125
+ "thread_id": "4tcdn8818bym8cnmjnmej7hxiy",
126
+ "root_author": "@alice",
127
+ "root_message": "Pushed a new build with the following changes...",
128
+ "root_created_at": "2026-02-09T06:38:47Z",
129
+ "reply_count": 66,
130
+ "channel": "engineering",
131
+ "last_reply_author": "@bob",
132
+ "last_reply_message": "Deployed and verified",
133
+ "last_reply_at": "2026-03-05T07:44:45Z"
134
+ }
135
+ ]
136
+ ```
137
+
138
+ ## Channels (channels command)
139
+
140
+ ```json
141
+ {
142
+ "id": "eqdx3n8zo3yqzyf46sobm14uwa",
143
+ "name": "engineering",
144
+ "ref": "engineering",
145
+ "type": "Public",
146
+ "team": "Engineering",
147
+ "purpose": "Engineering discussion",
148
+ "header": "On-call: @alice"
149
+ }
150
+ ```
151
+
152
+ ## Channel info (channel command)
153
+
154
+ ```json
155
+ {
156
+ "id": "zq9mowj6ojr8tftad1oyrbgmre",
157
+ "name": "engineering",
158
+ "type": "Public",
159
+ "purpose": "Engineering discussion",
160
+ "header": "On-call: @alice",
161
+ "last_post_at": "2026-03-05T07:44:45Z",
162
+ "created_at": "2023-08-08T04:12:05Z",
163
+ "pinned_count": 11,
164
+ "member_count": 61
165
+ }
166
+ ```
167
+
168
+ ## Unread (unread command)
169
+
170
+ ```json
171
+ {
172
+ "channel_id": "km4f6k31ibbpteg9875fpxb5gw",
173
+ "channel": "alice, bob, carol",
174
+ "ref": "km4f6k31ibbpteg9875fpxb5gw",
175
+ "type": "Group DM",
176
+ "unread": 5,
177
+ "mentions": 3,
178
+ "team": "Engineering",
179
+ "last_post_at": "2026-03-05T06:52:30Z"
180
+ }
181
+ ```
182
+
183
+ ## User (user command)
184
+
185
+ ```json
186
+ {
187
+ "user_id": "w1gabcy35tnt5m5wscocbgampo",
188
+ "username": "alice",
189
+ "display_name": "Alice Smith",
190
+ "email": "alice@example.com",
191
+ "position": "Staff Engineer",
192
+ "status": "online",
193
+ "timezone": "Asia/Kolkata"
194
+ }
195
+ ```
196
+
197
+ ## Members (members command)
198
+
199
+ ```json
200
+ {
201
+ "user_id": "w1gabcy35tnt5m5wscocbgampo",
202
+ "username": "alice",
203
+ "display_name": "Alice Smith",
204
+ "status": "online",
205
+ "position": "Staff Engineer"
206
+ }
207
+ ```
208
+
209
+ Sorted by status: online first, then away, dnd, offline.
210
+
211
+ ## The ref field
212
+
213
+ The `ref` field appears in `overview`, `channels`, and `unread` output. It's the exact string to pass to `mm messages`:
214
+
215
+ - For named channels: the channel name (e.g. `general`)
216
+ - For DMs and group DMs: the channel ID (since display names like `"alice, bob"` aren't addressable)
217
+
218
+ ```bash
219
+ # From overview output: {"channel": "alice, bob", "ref": "km4f6k31ibb..."}
220
+ mm messages km4f6k31ibb... # Works (using ref)
221
+ mm messages "alice, bob" # Fails (display name not addressable)
222
+ ```
223
+
224
+ ## Timestamps
225
+
226
+ All timestamps are ISO 8601 in UTC: `2026-03-05T06:52:30Z`
227
+
228
+ ## Type labels
229
+
230
+ | API | Label |
231
+ |-----|-------|
232
+ | `O` | Public |
233
+ | `P` | Private |
234
+ | `D` | DM |
235
+ | `G` | Group DM |
@@ -25,21 +25,21 @@ Use `--since 0` to disable the time filter (all results).
25
25
  A quick way to catch up:
26
26
 
27
27
  ```bash
28
- # 1. What needs attention?
29
- mm mentions
28
+ # 1. Get the full picture in one call
29
+ mm overview --since 12h
30
30
 
31
- # 2. Check thread sizes before diving in
32
- # (look at reply_count to decide if you need --limit)
31
+ # 2. Read mentions (root context tells you what each is about)
32
+ mm mentions --since 12h
33
33
 
34
34
  # 3. Read threads that matter
35
35
  mm thread <thread_id>
36
36
  mm thread <thread_id> --limit 5 # Big thread? Just the recent end
37
37
 
38
- # 4. Scan unread channels
39
- mm unread
38
+ # 4. Scan busy channels with thread view
39
+ mm messages <ref> --threads --since 12h
40
40
 
41
- # 5. Read messages in busy channels
42
- mm messages <ref> --since today
41
+ # 5. Dive into specific threads from the index
42
+ mm messages <ref> --since 12h # Or flat view for quiet channels
43
43
  ```
44
44
 
45
45
  ## Piping with jq