productivity
Slack CLI for Cron Jobs
Use the Slack CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.
25 functions 13 read 12 write API token auth
Slack CLI for Cron Jobs
Schedule repeatable integration workflows from cron while keeping credentials in KosmoKrator config.
Use the headless CLI from cron when an operation should run without an interactive agent session. The Slack CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Slack CLI for Cron Jobs
kosmokrator integrations:configure slack --set bot_token="$SLACK_BOT_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call slack.slack_send_message '{"channel":"example_channel","text":"example_text","blocks":"example_blocks","thread_ts":"example_thread_ts","reply_broadcast":true,"unfurl_links":true,"markdown":true}' --json Discovery Before Execution
Agents and scripts can inspect Slack docs and schemas before choosing a function.
kosmo integrations:docs slack --json
kosmo integrations:docs slack.slack_send_message --json
kosmo integrations:schema slack.slack_send_message --json
kosmo integrations:search "Slack" --json
kosmo integrations:list --json Useful Slack CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
slack.slack_send_message | Write | channel, text, blocks, thread_ts, reply_broadcast, unfurl_links, markdown | Send a message to a Slack channel or DM. Supports text, blocks, and thread replies. |
slack.slack_update_message | Write | channel, ts, text, blocks | Update an existing Slack message. |
slack.slack_delete_message | Write | channel, ts | Delete a message from a Slack channel. |
slack.slack_get_message | Read | channel, ts, thread_ts | Get a specific message by its timestamp. Optionally fetch a message within a thread. |
slack.slack_search_messages | Read | query, count, page, sort, sort_dir | Search for messages across all Slack channels and DMs. |
slack.slack_get_permalink | Read | channel, message_ts | Get a permalink URL for a specific Slack message. |
slack.slack_get_channel_history | Read | channel, limit, oldest, latest, cursor | Get message history for a Slack channel. Supports pagination with cursors. |
slack.slack_get_thread_replies | Read | channel, ts, limit, cursor | Get all replies in a Slack message thread. |
slack.slack_list_channels | Read | types, exclude_archived, limit, cursor | List all Slack channels the bot has access to. |
slack.slack_get_channel | Read | channel | Get detailed information about a Slack channel. |
slack.slack_create_channel | Write | name, is_private | Create a new Slack channel. |
slack.slack_set_topic | Write | channel, topic | Set the topic for a Slack channel. |
slack.slack_set_purpose | Write | channel, purpose | Set the purpose for a Slack channel. |
slack.slack_archive_channel | Write | channel | Archive a Slack channel. |
slack.slack_invite_to_channel | Write | channel, users | Invite one or more users to a Slack channel. |
slack.slack_upload_file | Write | channel, content, filename, title, initial_comment, thread_ts | Upload a file to Slack using the modern external upload flow. The file content is posted to a channel or as a thread reply. |
slack.slack_list_files | Read | channel, user, types, count, page | List files in Slack, optionally filtered by channel, user, or file type. |
slack.slack_get_file | Read | file | Get detailed information about a Slack file. |
slack.slack_list_users | Read | limit, cursor, include_locale | List all users in the Slack workspace. |
slack.slack_get_user | Read | user | Get detailed information about a Slack user by their user ID. |
slack.slack_find_user_by_email | Read | Look up a Slack user by their email address. | |
slack.slack_add_reaction | Write | channel, name, timestamp | Add an emoji reaction to a Slack message. |
slack.slack_remove_reaction | Write | channel, name, timestamp | Remove an emoji reaction from a Slack message. |
slack.slack_list_usergroups | Read | include_count, include_disabled, include_users | List all usergroups in the Slack workspace. |
slack.slack_update_usergroup_members | Write | usergroup, users | Update the members of a Slack usergroup. |
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.