communication
Matrix CLI for Coding Agents
Use the Matrix CLI for coding agents with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 5 read 2 write Bearer token auth
Matrix CLI for Coding Agents
Let coding agents discover schemas and execute integration functions through CLI commands or MCP.
Use this pattern when another coding agent needs exact commands and schema discovery. The Matrix CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Matrix CLI for Coding Agents
kosmokrator integrations:configure matrix --set access_token="$MATRIX_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call matrix.matrix_list_rooms '{"limit":1,"from":"example_from"}' --json Discovery Before Execution
Agents and scripts can inspect Matrix docs and schemas before choosing a function.
kosmo integrations:docs matrix --json
kosmo integrations:docs matrix.matrix_list_rooms --json
kosmo integrations:schema matrix.matrix_list_rooms --json
kosmo integrations:search "Matrix" --json
kosmo integrations:list --json Useful Matrix CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
matrix.matrix_list_rooms | Read | limit, from | List rooms the authenticated user has joined on Matrix. Returns room IDs, names, and aliases. |
matrix.matrix_get_room | Read | room_id | Get details of a specific Matrix room, including name, topic, members, and aliases. |
matrix.matrix_create_room | Write | name, topic, visibility, preset | Create a new room on the Matrix homeserver. Returns the newly created room ID. |
matrix.matrix_send_message | Write | room_id, body, msgtype, txn_id | Send a text message to a Matrix room. Uses a unique transaction ID to prevent duplicate messages. |
matrix.matrix_list_members | Read | room_id, limit | List members of a Matrix room. Returns user IDs, display names, and avatar URLs. |
matrix.matrix_get_profile | Read | user_id | Get a Matrix user's profile information, including display name and avatar URL. |
matrix.matrix_get_current_user | Read | none | Get the currently authenticated Matrix user's information, including user ID and device ID. |
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.