mattermost-cli 0.0.2__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 (46) hide show
  1. mattermost_cli-0.0.4/.github/workflows/docs.yml +20 -0
  2. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/.gitignore +0 -1
  3. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/PKG-INFO +53 -17
  4. mattermost_cli-0.0.4/README.md +112 -0
  5. mattermost_cli-0.0.4/docs/01-guide/01-commands.md +195 -0
  6. mattermost_cli-0.0.4/docs/01-guide/02-json-output.md +235 -0
  7. mattermost_cli-0.0.4/docs/01-guide/03-authentication.md +99 -0
  8. mattermost_cli-0.0.4/docs/01-guide/04-tips.md +135 -0
  9. mattermost_cli-0.0.4/docs/config.toml +14 -0
  10. mattermost_cli-0.0.4/docs/index.md +89 -0
  11. mattermost_cli-0.0.4/docs/quickstart.md +124 -0
  12. mattermost_cli-0.0.4/mmchat/__init__.py +7 -0
  13. mattermost_cli-0.0.4/mmchat/cli.py +56 -0
  14. mattermost_cli-0.0.4/mmchat/commands/__init__.py +1 -0
  15. mattermost_cli-0.0.4/mmchat/commands/auth.py +168 -0
  16. mattermost_cli-0.0.4/mmchat/commands/channels.py +156 -0
  17. mattermost_cli-0.0.4/mmchat/commands/files.py +52 -0
  18. mattermost_cli-0.0.4/mmchat/commands/messages.py +174 -0
  19. mattermost_cli-0.0.4/mmchat/commands/overview.py +139 -0
  20. mattermost_cli-0.0.4/mmchat/commands/people.py +171 -0
  21. mattermost_cli-0.0.4/mmchat/commands/search.py +134 -0
  22. mattermost_cli-0.0.4/mmchat/downloads.py +62 -0
  23. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/mmchat/formatters.py +115 -43
  24. mattermost_cli-0.0.4/mmchat/helpers.py +197 -0
  25. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/pyproject.toml +1 -2
  26. mattermost_cli-0.0.4/skills/mattermost/SKILL.md +141 -0
  27. mattermost_cli-0.0.4/skills/mattermost/references/commands.md +165 -0
  28. mattermost_cli-0.0.4/skills/mattermost/references/scenarios.md +161 -0
  29. mattermost_cli-0.0.4/skills/mattermost/references/setup.md +121 -0
  30. mattermost_cli-0.0.4/skills/mattermost/references/workflows.md +141 -0
  31. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/tests/test_client.py +32 -0
  32. mattermost_cli-0.0.4/tests/test_downloads.py +57 -0
  33. mattermost_cli-0.0.2/README.md +0 -76
  34. mattermost_cli-0.0.2/mmchat/__init__.py +0 -6
  35. mattermost_cli-0.0.2/mmchat/_version.py +0 -34
  36. mattermost_cli-0.0.2/mmchat/cli.py +0 -673
  37. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/.github/workflows/publish.yml +0 -0
  38. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/AGENTS.md +0 -0
  39. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/LICENSE +0 -0
  40. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/mmchat/client.py +0 -0
  41. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/mmchat/config.py +0 -0
  42. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/mmchat/resolve.py +0 -0
  43. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/mmchat/time_utils.py +0 -0
  44. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/tests/__init__.py +0 -0
  45. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/tests/test_config.py +0 -0
  46. {mattermost_cli-0.0.2 → mattermost_cli-0.0.4}/tests/test_time_utils.py +0 -0
@@ -0,0 +1,20 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ paths:
7
+ - 'docs/**'
8
+ - '.github/workflows/docs.yml'
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+ pages: write
14
+ id-token: write
15
+
16
+ jobs:
17
+ docs:
18
+ uses: oddship/moat/.github/workflows/build-docs.yml@main
19
+ with:
20
+ docs_dir: docs
@@ -10,4 +10,3 @@ build/
10
10
  venv/
11
11
  .tox/
12
12
  .pytest_cache/
13
- _version.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mattermost-cli
3
- Version: 0.0.2
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
@@ -34,10 +34,10 @@ Mattermost CLI for humans and agents.
34
34
  ## Install
35
35
 
36
36
  ```bash
37
- # via uvx (recommended)
38
- uvx mattermost-cli --help
37
+ # Run directly (no install)
38
+ uvx --from mattermost-cli mm --help
39
39
 
40
- # or pip
40
+ # Or install globally
41
41
  pip install mattermost-cli
42
42
  ```
43
43
 
@@ -45,10 +45,10 @@ pip install mattermost-cli
45
45
 
46
46
  ```bash
47
47
  # Interactive login (password + MFA)
48
- mm login
48
+ mm login --url https://chat.example.com
49
49
 
50
50
  # Or with a Personal Access Token
51
- mm login --token <your-pat>
51
+ mm login --url https://chat.example.com --token <your-pat>
52
52
 
53
53
  # Verify
54
54
  mm whoami
@@ -57,23 +57,59 @@ mm whoami
57
57
  ## Usage
58
58
 
59
59
  ```bash
60
- # List channels
61
- mm channels
60
+ # Get oriented (mentions + unread + active channels in one call)
61
+ mm overview
62
62
 
63
- # Show unread messages
64
- mm unread
65
-
66
- # Read messages from a channel
63
+ # Read messages
67
64
  mm messages general
68
65
  mm messages general --since 1h
69
- mm messages @username # DM with a user
66
+ mm messages general --threads # thread index view
67
+ mm messages @alice # DM with a user
70
68
 
71
- # Read a thread
72
- mm thread <post-id>
69
+ # Threads
70
+ mm thread <post-id> # root + last 9 replies
71
+ mm thread <post-id> --limit 0 # full thread
73
72
 
74
- # Search
73
+ # Search and mentions
75
74
  mm search "deployment issue"
76
- 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
77
113
  ```
78
114
 
79
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
@@ -0,0 +1,195 @@
1
+ ---
2
+ title: Commands
3
+ description: Complete command reference
4
+ ---
5
+
6
+ # Commands
7
+
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
+
10
+ ## mm overview
11
+
12
+ Get oriented in one call. Returns mentions, unread channels, and recently active channels.
13
+
14
+ ```bash
15
+ mm overview # Last 6 hours (default)
16
+ mm overview --since 1d # Last 24 hours
17
+ mm overview --since 0 # No time filter
18
+ ```
19
+
20
+ This is the best starting point - it replaces separate calls to `mm mentions`, `mm unread`, and `mm channels --since`.
21
+
22
+ ## mm messages
23
+
24
+ Read messages from a channel.
25
+
26
+ ```bash
27
+ mm messages general # By channel name
28
+ mm messages @alice # DM with a user
29
+ mm messages abc123def456... # By channel ID (for group DMs)
30
+ mm messages general --limit 10 # Last 10 messages
31
+ mm messages general --since 2h # Messages from last 2 hours
32
+ mm messages general --since today # Messages from today
33
+ mm messages general --threads # Thread index view
34
+ ```
35
+
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.
39
+
40
+ ## mm thread
41
+
42
+ Read a thread by any post ID in that thread.
43
+
44
+ ```bash
45
+ mm thread abc123def456... # Root + last 9 replies (default)
46
+ mm thread abc123def456... --limit 0 # Full thread
47
+ mm thread abc123def456... --limit 5 # Root + last 4 replies
48
+ mm thread abc123def456... --since 1h # Root + replies from last hour
49
+ ```
50
+
51
+ The root message is always included regardless of `--limit` or `--since` so you have context.
52
+
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
+ ```
76
+
77
+ ## mm search
78
+
79
+ Search messages across all teams.
80
+
81
+ ```bash
82
+ mm search "deployment issue"
83
+ mm search "deployment issue" --limit 10
84
+ mm search "from:alice" # Mattermost search modifiers
85
+ mm search "in:engineering deployment" # Search in a specific channel
86
+ mm search "before:2026-03-01 incident" # Date filters
87
+ ```
88
+
89
+ Supports all [Mattermost search modifiers](https://docs.mattermost.com/collaborate/search-for-messages.html): `from:`, `in:`, `before:`, `after:`, `on:`, etc.
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
+
102
+ ## mm channels
103
+
104
+ List all channels you belong to.
105
+
106
+ ```bash
107
+ mm channels # All channels
108
+ mm channels --type public # Only public channels
109
+ mm channels --type dm # Only DMs
110
+ mm channels --type group # Only group DMs
111
+ mm channels --since 6h # Channels with recent activity
112
+ ```
113
+
114
+ Each entry includes a `ref` field for use with `mm messages`.
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
+
186
+ ## Global options
187
+
188
+ These go before the command name:
189
+
190
+ ```bash
191
+ mm --human mentions # Markdown output
192
+ mm --team Engineering unread # Filter to one team
193
+ mm --debug messages general # Debug logging
194
+ mm --version # Show version
195
+ ```
@@ -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 |