communication
Discourse CLI for CI
Use the Discourse CLI for CI with headless JSON commands, schema discovery, credentials, and permission controls.
8 functions 5 read 3 write API key auth
Discourse CLI for CI
Run integration calls from CI jobs with JSON output, explicit credentials, and predictable exit status.
Use this shape when a pipeline needs to read or update an external service. The Discourse CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Discourse CLI for CI
kosmokrator integrations:configure discourse --set api_key="$DISCOURSE_API_KEY" --set api_username="$DISCOURSE_API_USERNAME" --set hostname="$DISCOURSE_HOSTNAME" --enable --read allow --write ask --json
kosmo integrations:call discourse.discourse_list_topics '{"page":1}' --json Discovery Before Execution
Agents and scripts can inspect Discourse docs and schemas before choosing a function.
kosmo integrations:docs discourse --json
kosmo integrations:docs discourse.discourse_list_topics --json
kosmo integrations:schema discourse.discourse_list_topics --json
kosmo integrations:search "Discourse" --json
kosmo integrations:list --json Useful Discourse CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
discourse.discourse_list_topics | Read | page | List the latest topics from the Discourse forum. Returns topic titles, categories, and activity metadata. |
discourse.discourse_get_topic | Read | topic_id | Get a single Discourse topic by ID, including its posts, author, and metadata. |
discourse.discourse_create_topic | Write | title, raw, category, tags | Create a new topic in a Discourse category. Requires a title, body content (Markdown), and category ID. |
discourse.discourse_update_topic | Write | topic_id, title, category | Update an existing Discourse topic's title or move it to a different category. |
discourse.discourse_list_categories | Read | none | List all categories on the Discourse forum. Returns category names, IDs, descriptions, and parent relationships. |
discourse.discourse_get_category | Read | category_id | Get a single Discourse category by ID, including its recent topics and metadata. |
discourse.discourse_create_post | Write | topic_id, raw | Reply to an existing Discourse topic with a new post. Provide the topic ID and body content in Markdown. |
discourse.discourse_get_current_user | Read | none | Get the currently authenticated Discourse user profile. Useful for verifying API credentials and identifying the user context. |
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.