communication
Mattermost CLI for Headless Automation
Use the Mattermost CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write Bearer token auth
Mattermost CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Mattermost CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Mattermost CLI for Headless Automation
kosmokrator integrations:configure mattermost --set access_token="$MATTERMOST_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call mattermost.mattermost_list_channels '{"page":1,"per_page":1}' --json Discovery Before Execution
Agents and scripts can inspect Mattermost docs and schemas before choosing a function.
kosmo integrations:docs mattermost --json
kosmo integrations:docs mattermost.mattermost_list_channels --json
kosmo integrations:schema mattermost.mattermost_list_channels --json
kosmo integrations:search "Mattermost" --json
kosmo integrations:list --json Useful Mattermost CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
mattermost.mattermost_list_channels | Read | page, per_page | List channels the current user belongs to in Mattermost. Returns channel IDs, names, types, and team associations. Use this to discover available channels before posting messages or reading posts. |
mattermost.mattermost_get_channel | Read | channel_id | Get details of a specific Mattermost channel by ID. Returns channel name, display name, type, header, purpose, and member counts. |
mattermost.mattermost_create_post | Write | channel_id, message | Post a message to a Mattermost channel. Provide the channel_id and the message text. Returns the created post with its ID and timestamp. |
mattermost.mattermost_list_posts | Read | channel_id, page, per_page | List posts in a Mattermost channel. Returns post IDs, messages, author info, and timestamps. Use page and per_page for pagination. |
mattermost.mattermost_get_post | Read | post_id | Get a specific Mattermost post by ID. Returns the full post including message content, author, channel, and timestamps. |
mattermost.mattermost_list_teams | Read | page, per_page | List teams the current user belongs to in Mattermost. Returns team IDs, names, display names, and types. Use this to discover available teams before working with channels. |
mattermost.mattermost_get_current_user | Read | none | Get the profile of the currently authenticated Mattermost user. Returns username, email, display name, roles, and locale. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.