mattermost-cli
Original:🇺🇸 English
Translated
This skill should be used when the user asks to "check my mattermost messages", "fetch DMs", "what did X say", "check messages from coworker", "read mattermost", "search mattermost for X", "check my mentions", "any unread messages", "watch a channel", "monitor chat", "what's new on mattermost", "find messages about X", "check channel history", "follow up on that mattermost thread", or mentions mattermost conversations, chat history, unread messages, or finding tasks mentioned in chat. Also use when the user needs context from team communication, wants to find action items from conversations, or needs to monitor a channel for updates in real-time.
11installs
Added on
NPX Install
npx skill4agent add ardasevinc/mattermost-cli mattermost-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Mattermost CLI
Read-only CLI for fetching Mattermost messages. Output is automatically redacted for safe LLM processing.
When to Invoke Immediately
Trigger this skill when the user:
- Asks to check/read/fetch Mattermost messages, DMs, or channels
- Wants to see what someone said ("what did alice say about X")
- Needs to find tasks or action items from chat
- Asks to search for something in Mattermost
- Wants to check their mentions or unread messages
- Needs to monitor a channel or DM in real-time
- References a conversation or thread from Mattermost
When to Suggest (Don't Auto-Invoke)
Offer to use this skill when:
- User mentions a task "from chat" without specifying Mattermost
- User is looking for context that might be in messages
- You need message history to understand a task better
- User seems unaware of recent team discussions that might be relevant
Say: "want me to check your Mattermost messages for context?" — don't auto-invoke.
Prerequisites
The CLI must be installed and configured:
mmbash
mm channels # test if workingIf it fails, configure credentials using one of:
- Config file: then edit
mm config --init~/.config/mattermost-cli/config.toml - Environment variables: and
MM_URLMM_TOKEN - CLI flags: and
--url--token
Commands
List Channels
bash
mm channels # all channels, sorted by last activity
mm channels --type dm # DMs only
mm channels --type public # public channels only
mm channels --type private # private channels only
mm channels --type group # group channels onlyFetch Direct Messages
bash
mm dms # all DMs, last 7 days
mm dms -u <username> # from specific user
mm dms -u alice -u bob # multiple users
mm dms --since 24h # last 24 hours
mm dms --since 30d --limit 100 # more history
mm dms -c <channel-id> # specific DM channel by IDmm dms --limitFetch Channel Messages
bash
mm channel general # last 7 days from #general
mm channel dev-ops --team myteam # specify team if multi-team
mm channel general --since 24h # last 24 hours
mm channel general --limit 200 # more messagesSearch Messages
bash
mm search "deployment" # search across all channels
mm search "from:alice bug" # Mattermost search syntax
mm search "in:general after:2026-01-01" # channel + date filters
mm search "deployment" --team myteam # scope to team
mm search "deployment" --limit 20 # limit resultsCheck Mentions
bash
mm mentions # messages mentioning you
mm mentions --since 24h # recent mentions
mm mentions --channel general # mentions in specific channel
mm mentions --team myteam # scope to teamMention detection uses your username plus any aliases configured in in the config file.
mention_namesUnread Summary
bash
mm unread # list channels with unread counts
mm unread --peek 5 # also fetch 5 messages per unread channel
mm unread --team myteam # scope to teamChannels are sorted by mentions first, then by unread count.
Watch (Real-Time)
bash
mm watch general # live-stream channel messages
mm watch general --team myteam # specify team
mm watch --dm alice # live-stream DMs with a userWebSocket-based, streams new messages as they arrive. Ctrl+C to stop.
Fetch a Thread
bash
mm thread <postId> # fetch root post + all repliesManage Configuration
bash
mm config # show config status
mm config --init # create config file template
mm config --path # print config file pathQuick Reference
| Task | Command |
|---|---|
| Recent DMs | |
| DMs from specific person | |
| All channels list | |
| Channel history | |
| Search messages | |
| Check mentions | |
| Unread summary | |
| Unread with preview | |
| Watch channel live | |
| Watch DM live | |
| Specific thread | |
| JSON for processing | |
| Setup config | |
Global Options
These apply to all commands:
| Flag | Effect |
|---|---|
| JSON output (default: pretty terminal) |
| Disable ANSI colors |
| Relative timestamps ("2 days ago") |
| Absolute timestamps |
| Enable secret redaction (default) |
| Disable secret redaction |
| Show thread structure (default) |
| Flatten thread replies |
Output Formats
| Context | Format | Use Case |
|---|---|---|
| Terminal (TTY) | Pretty | Reading directly — colors, grouping, thread indentation |
| Piped / non-TTY | Markdown | Passing to other tools or LLMs |
| JSON | Parsing, analysis, programmatic access |
Under AI agents, relative time is auto-enabled ("2 days ago" instead of "29 Jan 2026"). Override with .
--no-relativeSecurity
All secrets are automatically redacted before output:
- API keys and tokens (AWS, GitHub, GitLab, Slack, OpenAI, Anthropic, Stripe, etc.)
- JWTs and Bearer/Basic auth headers
- Connection strings (postgres://, mongodb://)
- Private keys, passwords, credentials in config snippets
Masking preserves context: →
ghp_abc123xyz789secretghp_...cretOutput is safe to include in context or pass to other LLMs. Disable with if needed.
--no-redactConfiguration
Credentials resolve in this order (first wins):
- CLI flags (,
--url)--token - Environment variables (,
MM_URL)MM_TOKEN - Config file ()
~/.config/mattermost-cli/config.toml
Config file format:
toml
url = "https://mattermost.example.com"
token = "your-personal-access-token"
redact = true
mention_names = ["Arda", "arda.sevinc"] # aliases for mm mentionsError Handling
| Error | Cause | Solution |
|---|---|---|
| "Mattermost URL required" | Not configured | |
| "Mattermost token required" | Not configured | Edit config or set |
| "Could not find DM channel" | User doesn't exist or no DM history | Check username spelling |
| "Could not find channel" | Channel name wrong or no access | Verify name and team |
| "Multiple teams found" | Multi-team user without | Add |
| Connection errors | Network/server issues | Verify URL is correct and accessible |
| WebSocket auth failure | Invalid token for watch mode | Regenerate access token |
When NOT to Use
- User is asking about Slack, Discord, or other chat platforms
- User wants to send messages (this tool is read-only)
- User needs webhook or bot integrations
Example Workflows
"What did Alice say about the deployment?"
bash
mm dms -u alice --since 7dScan output for deployment-related content.
"Check my recent messages for any tasks"
bash
mm dms --since 24hReview output for action items, requests, or TODOs.
"Any mentions I missed?"
bash
mm mentions --since 24hCatch up on messages that tagged you.
"What's happening in the dev channel?"
bash
mm channel dev --since 24hOr for ongoing monitoring:
bash
mm watch dev"Find that discussion about the API migration"
bash
mm search "API migration""Quick catch-up on everything unread"
bash
mm unread --peek 3Shows unread channels with mention counts and previews 3 messages from each.
"Get full context from a thread someone linked"
bash
mm thread abc123def456