Slack CLI for AI Agents

Use Composio Universal CLI with Slack. Send reminder to marketing channel at 10am, add reaction to latest team message, and more using natural language, with authentication handled for you.

Slack logoSlack
Oauth2

Slack is a channel-based messaging platform for teams and organizations. It helps people collaborate in real time, share files, and connect all their tools in one place.

165 Tools9 Triggers

Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.

With Composio's Universal CLI, your coding agents can talk to over 2000+ SaaS applications. With Slack, agents can send and search messages, manage channels, share files, set reminders, and organize user groups, and more — all without worrying about authentication.

This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Slack automation.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate Slack with

What is Universal CLI and why use it?

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:

  • Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
  • Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
  • Tool discovery: Search, inspect, and execute 20,000+ tools across 2000+ apps from one interface.
  • Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
  • Type generation: Generate typed schemas for autocomplete and type safety in your projects.

Prerequisites

Install the Composio CLI, authenticate, and initialize your project:

bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login

During login you'll be redirected to sign in page, finish the complete flow and you're all set.

Composio CLI authentication flow

Connecting Slack to Coding Agents via Universal CLI

Once it is installed, it's essentially done. Claude Code, Codex, OpenCode, OpenClaw, or any other agent will be able to access the CLI. A few steps to give agents access to your apps.

  1. Launch your Coding Agent — Claude Code, Codex, OpenCode, anything you prefer.
  2. Prompt it to "Authenticate with Slack"
  3. Complete the authentication and authorization flow and your Slack integration is all set.
  4. Start asking anything you want.

Universal CLI Commands for Slack

You can also manually execute CLI commands to interact with your Slack.

Connect your Slack account

Link your Slack account and verify the connection:

bash
# Connect your Slack account (opens OAuth flow)
composio connected-accounts link slack

# Verify the connection
composio connected-accounts list --toolkits slack

Discover Slack tools

Search and inspect available Slack tools:

bash
# List all available Slack tools
composio tools list --toolkit slack

# Search for Slack tools by action
composio tools search "slack"

# Inspect a tool's input schema
composio tools info SLACK_SEND_EPHEMERAL_MESSAGE

Common Slack Actions

Send ephemeral message — Sends an ephemeral message visible only to the specified `user` in a channel; other channel members cannot see it

bash
composio tools execute SLACK_SEND_EPHEMERAL_MESSAGE \
  --user "U0BPQUNTA" \
  --channel "C1234567890"

Share a me message in a channel — Sends a 'me message' (e

bash
composio tools execute SLACK_SEND_ME_MESSAGE \
  --text "is preparing for a meeting." \
  --channel "C1234567890"

Send message — Posts a message to a Slack channel, DM, or private group

bash
composio tools execute SLACK_SEND_MESSAGE \
  --channel "C1234567890"

Fetch conversation history — Fetches a chronological list of messages and events from a specified Slack conversation, accessible by the authenticated user/bot, with options for pagination and time range filtering

bash
composio tools execute SLACK_FETCH_CONVERSATION_HISTORY \
  --channel "C1234567890"

Fetch item reactions — Fetches reactions for a Slack message, file, or file comment

bash
composio tools execute SLACK_FETCH_ITEM_REACTIONS \
  --file "F1234567890" \
  --full "<boolean>" \
  --channel "C1234567890" \
  --timestamp "1234567890.123456"

Retrieve conversation replies — Retrieves replies to a specific parent message in a Slack conversation, using the channel ID and the parent message's timestamp (`ts`)

bash
composio tools execute SLACK_FETCH_MESSAGE_THREAD_FROM_A_CONVERSATION \
  --ts "1234567890.123456" \
  --channel "C0123456789"

Fetch team info — Fetches comprehensive metadata about the current Slack team, or a specified team if the provided ID is accessible

bash
composio tools execute SLACK_FETCH_TEAM_INFO \
  --team "T12345678" \
  --domain "myworkspace"

Fetch bot user information — Fetches information for a specified, existing Slack bot user; will not work for regular user accounts or other integration types

bash
composio tools execute SLACK_GET_BOT_USER \
  --bot "B0123456789" \
  --team_id "T1234567890"

Set up Slack Triggers

Listen for events in real time using triggers:

New Channel Created Trigger — Triggered when a new channel is created in Slack

bash
# Find your connected account ID
composio connected-accounts list --toolkits slack

# Create a trigger
composio triggers create SLACK_CHANNEL_CREATED \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits slack --table

Channel Message Received — Triggered when a message is posted in a Slack channel (public, private, or multi-party IM)

bash
# Find your connected account ID
composio connected-accounts list --toolkits slack

# Create a trigger
composio triggers create SLACK_CHANNEL_MESSAGE_RECEIVED \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{
  "channel_id": "<string>",
  "channel_type": "<string>",
  "is_bot_message": "<boolean>"
}'

# Listen for trigger events in real time
composio triggers listen --toolkits slack --table

Direct Message Received — Triggered when a new direct message (DM) is sent to a user in Slack

bash
# Find your connected account ID
composio connected-accounts list --toolkits slack

# Create a trigger
composio triggers create SLACK_DIRECT_MESSAGE_RECEIVED \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{
  "is_thread_reply": "<boolean>"
}'

# Listen for trigger events in real time
composio triggers listen --toolkits slack --table

Generate Type Definitions

Generate typed schemas for Slack tools to get autocomplete and type safety in your project:

bash
# Auto-detect language
composio generate --toolkits slack

# TypeScript
composio ts generate --toolkits slack

# Python
composio py generate --toolkits slack

Tips & Tricks

  • Always inspect a tool's input schema before executing: composio tools info <TOOL_NAME>
  • Pipe output with jq for better readability: composio tools execute TOOL_NAME -d '{}' | jq
  • Set COMPOSIO_API_KEY as an environment variable for CI/CD pipelines
  • Use composio dev logs tools to inspect execution logs and debug issues

Next Steps

  • Try asking your coding agent to perform various Slack operations
  • Explore cross-app workflows by connecting more toolkits
  • Set up triggers for real-time automation
  • Use composio generate for typed schemas in your projects
TOOLS & TRIGGERS

Supported Tools and Triggers

Every Slack action and event your agent gets out of the box.

Add call participants

Registers new participants added to a Slack call.

Add channel bookmark

Adds a link bookmark to a Slack channel and returns the created bookmark.

Add emoji

Adds a custom emoji to a Slack workspace given a unique name and an image URL; subject to workspace emoji limits.

Add an emoji alias

Adds an alias for an existing custom emoji in a Slack Enterprise Grid organization.

Add Enterprise user to workspace

Adds an Enterprise user to a workspace.

Add reaction to message

Adds a specified emoji reaction to a Slack message identified by channel and timestamp.

Add a remote file

Adds a reference to an external file (e.g., Google Drive, Dropbox) to Slack for discovery and sharing, requiring a unique `external_id` and an `external_url` accessible by Slack.

Add a star to an item

Adds a star to a Slack channel, file, file comment, or message for the authenticated user.

Search for channels in Enterprise organization

Tool to search for public or private channels in an Enterprise organization.

Test Slack API connection

Tool to check API calling code by testing connectivity and authentication to the Slack API.

Archive a Slack conversation

Archives a Slack conversation by its ID, rendering it read-only and hidden while retaining history, ideal for cleaning up inactive channels; be aware that some channels (like #general or certain DMs) cannot be archived and this may impact connected integrations.

Real-time search

Search Slack messages, files, channels, and users via the Real-time Search API, with content-type and conversation filters and pagination.

Check search capabilities

Check if semantic (AI-powered) search is available on the Slack workspace.

Close conversation channel

Closes a Slack direct message (DM) or multi-person direct message (MPDM) channel, removing it from the user's sidebar without deleting history; this action affects only the calling user's view.

Complete external file upload

Finalize uploaded file IDs once and optionally share the files.

Convert public channel to private

Convert a public Slack channel to private using the Admin API.

Create a reminder

Creates a Slack reminder with specified text and time; time accepts Unix timestamps, seconds from now, or natural language (e.g., 'in 15 minutes', 'every Thursday at 2pm').

Create Slack Canvas

Creates a new Slack Canvas with the specified title and optional content.

Create channel

Initiates a public or private channel-based conversation in a Slack workspace.

Create a channel-based conversation

Creates a new public or private Slack channel with a unique name; the channel can be org-wide, or team-specific if `team_id` is given (required if `org_wide` is false or not provided).

Create Enterprise team

Tool to create an Enterprise team in Slack.

Create Slack List

Creates a new Slack List via `slackLists.create`.

Create Slack List item

Creates a new item (row) in a Slack List via `slackLists.items.create`.

Create a Slack user group

Creates a new User Group (often referred to as a subteam) in a Slack workspace.

Customize URL unfurl

Customizes URL unfurls in a posted Slack message or message composer using custom preview content or Work Object metadata.

Delete Slack Canvas

Deletes a Slack Canvas permanently and irreversibly; always confirm with the user before calling.

Delete a public or private channel

Permanently and irreversibly deletes a specified public or private channel, including all its messages and files, within a Slack Enterprise Grid organization.

Delete a file by ID

Permanently deletes an existing file from a Slack workspace using its unique file ID; this action is irreversible and also removes any associated comments or shares.

Delete file comment

Deletes a specific comment from a file in Slack; this action is irreversible.

Delete multiple Slack List items

Deletes several items (rows) from a Slack List in one call via `slackLists.items.deleteMultiple`.

Delete a Slack reminder

Deletes an existing Slack reminder, typically when it is no longer relevant or a task is completed; this operation is irreversible.

Delete a message from a chat

Deletes a message, identified by its channel ID and timestamp, from a Slack channel, private group, or direct message conversation; the authenticated user or bot must be the original poster.

Delete scheduled chat message

Deletes a pending, unsent scheduled message from the specified Slack channel, identified by its `scheduled_message_id`.

Delete Slack List access

Revokes sharing access on a Slack List via `slackLists.access.delete`.

Delete Slack List item

Deletes an item (row) from a Slack List via `slackLists.items.delete`.

Delete user profile photo

Deletes the Slack profile photo for the user identified by the token, reverting them to the default avatar; this action is irreversible and succeeds even if no custom photo was set.

Disable a Slack user group

Disables a specified, currently enabled Slack User Group by its unique ID, effectively archiving it by setting its 'date_delete' timestamp; the group is not permanently deleted and can be re-enabled.

Download Slack file

Tool to download Slack file content and convert it to a publicly accessible URL.

Edit Slack Canvas

Edits a Slack Canvas with granular control over content placement.

Share file public url

Enables public sharing for an existing Slack file by generating a publicly accessible URL; this action does not create new files.

Enable a user group

Enables a disabled User Group in Slack using its ID, reactivating it for mentions and permissions; this action only changes the enabled status and cannot create new groups or modify other properties.

End a call

Ends an ongoing Slack call, identified by its ID (obtained from `calls.add`), optionally specifying the call's duration.

End DND session

Ends the authenticated user's current Do Not Disturb (DND) session in Slack, affecting only DND status and making them available; if DND is not active, Slack acknowledges the request without changing status.

End snooze

Ends the current user's snooze mode immediately.

Fetch conversation history

Fetches a chronological list of messages and events from a specified Slack conversation, accessible by the authenticated user/bot, with options for pagination and time range filtering.

Fetch item reactions

Fetches reactions for a Slack message, file, or file comment.

Retrieve conversation replies

Retrieves replies to a specific parent message in a Slack conversation, using the channel ID and the parent message's timestamp (`ts`).

Fetch team info

Fetches comprehensive metadata about the current Slack team, or a specified team if the provided ID is accessible.

Find channels

Finds Slack channels and conversations visible to the authenticated user by name, topic or purpose, with partial or exact matching.

Lookup users by email

Retrieves the Slack user object for an active user by their registered email address; requires the users:read.email OAuth scope.

Find users

Find Slack users by ID, email, name, display name, or other text.

Get Audit Action Types

Tool to retrieve information about action types available in the Slack Audit Logs API.

Get Audit Schemas

Tool to retrieve object schema information from the Slack Audit Logs API.

Fetch bot user information

Fetches information for a specified, existing Slack bot user; will not work for regular user accounts or other integration types.

Retrieve call information

Retrieves a point-in-time snapshot of a specific Slack call's information.

Get channel conversation preferences

Retrieves conversation preferences (e.g., who can post, who can thread) for a specified channel, primarily for use within Slack Enterprise Grid environments.

Get reminder information

Retrieves detailed information for an existing Slack reminder specified by its ID; this is a read-only operation.

Get remote file

Retrieve information about a remote file added to Slack via the files.remote API.

Get Slack List item

Fetches a single item (row) from a Slack List via `slackLists.items.info`.

Retrieve team profile details

Retrieves all profile field definitions for a Slack team, optionally filtered by visibility, to understand the team's profile structure.

Get unread messages from user

Retrieves unread direct messages from a specified user in the authenticated user's DM conversation, checking message history after the last-read timestamp.

Get team DND status

Retrieves current Do Not Disturb status for specified Slack users, up to 50 per request.

Retrieve user presence

Retrieves a Slack user's current real-time presence (e.g., 'active', 'away') to determine their availability, noting this action does not provide historical data or status reasons.

Get workspace connections for channel

Tool to get all workspaces a channel is connected to within an Enterprise org.

Fetch workspace settings information

Retrieves detailed settings for a specific Slack workspace, primarily for administrators in an Enterprise Grid organization to view or audit workspace configurations.

Invite users to a Slack channel

Invites users to an existing Slack channel using their Slack user IDs.

Invite users to channel

Invites users to a specified Slack channel; this action is restricted to Enterprise Grid workspaces and requires the authenticated user to be a member of the target channel.

Invite user to workspace

Invites a user to a Slack workspace and specified channels by email; use `resend=True` to re-process an existing invitation for a user not yet signed up.

Join conversation by channel id

Joins an existing Slack conversation (public channel, private channel, or multi-person direct message) by its ID, if the authenticated user has permission.

Leave conversation channel

Leaves a Slack conversation given its channel ID; fails if leaving as the last member of a private channel or if used on a Slack Connect channel.

List approved apps

Tool to list approved apps for an Enterprise Grid organization or workspace.

List app requests

Tool to list pending app installation requests for a team/workspace.

List admin emoji

List custom emoji across an Enterprise Grid organization.

List all channels

Lists conversations available to the authenticated user, with filters for conversation type and archived status.

List all users

Retrieves a paginated list of all users with profile details, status, and team memberships in a Slack workspace; data may not be real-time.

List approved workspace invite requests

List all approved workspace invite requests with pagination support.

List authorized teams

Obtains a paginated list of workspaces your org-wide app has been approved for.

List available workspaces

Lists a page of Slack workspaces authorized for the connection that also appear in the target user's visible Enterprise Grid memberships.

List channel bookmarks

Lists the bookmarks saved in a Slack channel.

List conversations

Lists a page of Slack conversations for a specified user or the authenticated user, with filters for conversation type and archived status.

List team custom emojis

Retrieves all custom emojis for the Slack workspace (image URLs or aliases), not standard Unicode emojis; does not include usage statistics or creation dates.

List denied workspace invite requests

Lists a page of denied workspace invitation requests for review or audit, including available details about who denied them.

List Enterprise teams

List all teams (workspaces) in a Slack Enterprise Grid organization with pagination support.

List Slack files

Lists files and their metadata within a Slack workspace, filterable by user, channel, timestamp, or type; returns metadata only, not file content.

List IDP groups linked to channel

Lists IDP groups that have restricted access to a private Slack channel.

List pending workspace invite requests

Lists pending Slack workspace invite requests, optionally filtered by workspace and paginated.

List pinned items in a channel

Retrieves all messages and files pinned to a specified channel; the caller must have access to this channel.

List reminders

Lists all reminders with their details for the authenticated Slack user; returns an empty array if no reminders exist (valid state, not an error).

List remote files

Retrieve information about a team's remote files.

List Restricted Apps

Tool to list restricted apps for an org or workspace.

List scheduled messages

Retrieves a list of pending (not yet delivered) messages scheduled in a specific Slack channel, or across all accessible channels if no channel ID is provided, optionally filtered by time and paginated.

List Slack List items

Lists the rows (items) in a Slack List via `slackLists.items.list`.

List starred items

Lists items starred by a user.

List unread channel messages

Lists a page of unread main-timeline messages in a Slack channel for the authenticated user, using the last read position or zero if unavailable.

List all users in a user group

Retrieves a list of all user IDs within a specified Slack user group, with an option to include users from disabled groups.

List user groups

Lists user groups in a Slack workspace, including user-created and default groups, with options to include disabled groups, user IDs, and member counts.

List user reactions

Lists all reactions added by a specific user to messages, files, or file comments in Slack, useful for engagement analysis when the item content itself is not required.

List workspace admins

Tool to list all admins on a given Slack workspace.

List workspace owners

Tool to list all owners on a given Slack workspace.

List admin users

Retrieves a paginated list of users in an Enterprise Slack organization, optionally filtered to a workspace, activity status or guests.

Lookup Canvas Sections

Looks up section IDs in a Slack Canvas for use with targeted edit operations.

Open DM

Opens or resumes a Slack direct message or multi-person direct message using user IDs or an existing conversation ID.

Pin an item to a channel

Pins a message to a specified Slack channel; the message must not already be pinned.

Read Audit Logs

Reads Slack Enterprise audit logs with filters and pagination.

Remove call participants

Registers participants removed from a Slack call.

Remove emoji

Tool to remove a custom emoji across an Enterprise Grid organization.

Remove reaction from item

Removes an emoji reaction from a message, file, or file comment in Slack.

Remove remote file

Removes the Slack reference to an external file (which must have been previously added via the remote files API), specified by either its `external_id` or `file` ID (one of which is required), without deleting the actual external file.

Remove a star from an item

Removes a star from a previously starred Slack item (message, file, file comment, channel, group, or DM), requiring identification via `file`, `file_comment`, `channel` (for channel/group/DM), or both `channel` and `timestamp` (for a message).

Remove user from conversation

Removes a specified user from a Slack conversation (channel); the caller must have permissions to remove users and cannot remove themselves using this action.

Remove user from workspace

Tool to remove a user from a Slack workspace.

Rename a conversation

Renames a Slack channel, automatically adjusting the new name to meet naming conventions (e.g., converting to lowercase), which may affect integrations using the old name.

Rename an emoji

Renames an existing custom emoji in a Slack workspace, updating all its instances.

Reserve Slack file upload

Reserve a temporary Slack upload URL without uploading bytes.

Reset user sessions

Resets a user's Slack sessions to force re-authentication, with optional filters to expire only mobile or only web sessions.

Restrict app installation

Restrict an app for installation on a workspace.

Retrieve a user's identity details

Retrieves the authenticated user's and their team's identity, with details varying based on OAuth scopes (e.g., `identity.basic`, `identity.email`, `identity.avatar`).

Retrieve conversation information

Retrieves metadata for a Slack conversation by ID, including name, purpose and creation date, with options for member count and locale.

Get conversation members

Retrieves a paginated list of active member IDs (not names, emails, or presence) for a specified Slack public channel, private channel, DM, or MPIM.

Retrieve user DND status

Retrieves a Slack user's current Do Not Disturb (DND) status to determine their availability before interaction; any specified user ID must be a valid Slack user ID.

Retrieve detailed file information

Retrieves detailed metadata and paginated comments for a specific Slack file ID; does not download file content.

Retrieve detailed user information

Retrieves comprehensive information for a valid Slack user ID, excluding message history and channel memberships.

Retrieve message permalink

Retrieves a permalink URL for a specific message in a Slack channel or conversation; the permalink respects Slack's privacy settings.

Retrieve user profile information

Retrieves profile information for a specified Slack user (defaults to the authenticated user if `user` ID is omitted); a provided `user` ID must be valid.

Revoke a file's public url

Revokes public or external sharing access for a Slack file by its file ID.

Start RTM session

Starts a Real Time Messaging session and returns a WebSocket URL.

Schedule message

Schedules a message to a Slack channel, DM, or private group for a future time, up to 120 days in advance.

Get SCIM service provider configuration

Tool to retrieve SCIM service provider configuration from Slack.

Search all content

Tool to search all messages and files.

Search Slack files

Search files visible to the connected Slack user by text and modifiers.

Search messages

Workspace‑wide Slack message search with date ranges and filters.

Send ephemeral message

Sends an ephemeral message visible only to the specified `user` in a channel; other channel members cannot see it.

Share a me message in a channel

Sends a 'me message' (e.g., '/me is typing') to a Slack channel, where it's displayed as a third-person user action; messages are plain text and the channel must exist and be accessible.

Send message

Posts a message to a Slack channel, DM, or private group.

Set admin user

Sets an existing regular user or owner as an admin in a Slack workspace.

Set canvas access

Change access for channels or users a Slack canvas is already shared with.

Set conversation preferences

Sets the posting permissions for a public or private channel in Slack.

Set a conversation's purpose

Sets the purpose (a short description of its topic/goal, displayed in the header) for a Slack conversation; the calling user must be a member.

Set default channels

Tool to set the default channels of a workspace.

Set DND duration

Turns on Do Not Disturb mode for the current user, or changes its duration.

Set profile photo

This method allows the user to set their profile image.

Set conversation read cursor

Marks a message, specified by its timestamp (`ts`), as the most recently read for the authenticated user in the given `channel`, provided the user is a member of the channel and the message exists within it.

Set Slack List access

Grants or sets sharing access on a Slack List via `slackLists.access.set`.

Set conversation topic

Sets or updates the topic for a specified Slack conversation.

Set user presence

Manually sets a user's Slack presence, overriding automatic detection; this setting persists across connections but can be overridden by user actions or Slack's auto-away (e.g., after 10 mins of inactivity).

Set Slack user profile information

Updates a Slack user's profile, setting either individual fields or multiple fields via a JSON object.

Set workspace description

Set the description of a given workspace.

Set workspace icon

Sets the icon of a workspace.

Set workspace name

Set the name of a given Slack workspace.

Set workspace owner

Set an existing guest, regular user, or admin user to be a workspace owner.

Set workspaces for channel

Set the workspaces in an Enterprise grid org that connect to a channel.

Share a remote file in channels

Shares a remote file, which must already be registered with Slack, into specified Slack channels or direct message conversations.

Start call

Registers a new call in Slack using `calls.add` for third-party call integration; `created_by` is required if not using a user-specific token.

Test authentication

Checks authentication and tells you who you are.

Unarchive channel

Reverses conversation archival.

Unpin message from channel

Unpins a message, identified by its timestamp, from a specified channel if the message is currently pinned there; this operation is destructive.

Update call information

Updates the title, join URL, or desktop app join URL for an existing Slack call identified by its ID.

Update an existing remote file

Updates metadata or content details for an existing remote file in Slack; this action cannot upload new files or change the fundamental file type.

Update a Slack message

Updates a Slack message by timestamp.

Update Slack List

Updates a Slack List's metadata via `slackLists.update`.

Update Slack List item

Updates one or more cells in an EXISTING Slack List row via `slackLists.items.update`.

Update Slack user group

Updates an existing Slack User Group, which must be specified by an existing `usergroup` ID, with new optional details such as its name, description, handle, or default channels.

Update user group members

Replaces the members of an existing Slack User Group with a complete list of user IDs.

Upload or create a file in Slack

Upload files, images, screenshots, documents, or any media to Slack channels or threads.

Who Am I

Return the identity (user + workspace) of the connected Slack account.

FAQ

Frequently asked questions

Start with Slack.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Slack tool your agent needs.Free to start.

Start building