OpenCLI Online

Slack

Slack CLI

Slack workspace apps—Bolt-style flows, bot tokens, and channel messaging from the terminal.

TypeLink
Slack APIhttps://api.slack.com/
Create / manage Slack appshttps://api.slack.com/apps
Auth & OAuth overviewhttps://api.slack.com/authentication
Web API methodshttps://api.slack.com/methods
Rate limitshttps://api.slack.com/docs/rate-limits

Lists all opencli slack subcommands; request bodies follow Slack method docs, CLI entry points follow this page.

Overview

opencli slack targets teams with a Slack App: token setup, chat.postMessage helpers, and shortcuts to common admin APIs—useful alongside other OpenCLI modules in “one pipeline, many chat tools” setups.

Prerequisites

ItemNotes
Slack App + Bot UserCreate and install to workspace
Bot User OAuth TokenUsually starts with xoxb-
OAuth scopese.g. chat:write, channels:read, …
Node.js 20+For global opencli

Install

npm install -g @opencli/cli@latest
opencli slack --help

Configure bot token

Never commit xoxb- tokens to source control.

export SLACK_BOT_TOKEN=xoxb-your-token-here

OpenCLI reads SLACK_BOT_TOKEN; some versions also support encrypted local config via opencli slack config.

Interactive example

opencli slack config set bot_token --prompt

Paste at prompt; input is hidden.


Command reference (full)

opencli slack --help

config

CommandDescription
opencli slack config set bot_token --promptInteractive xoxb- entry
opencli slack config set bot_token --value <token>Non-interactive (watch shell history)
opencli slack config set bot_token --from-env <ENV>Read from environment
opencli slack config get bot_tokenRead (masked by default)
opencli slack config pathConfig file path

chat

CommandDescription
opencli slack chat post --channel <Cxx or #name> --text <text> [--thread-ts <ts>]chat.postMessage
opencli slack chat update --channel <Cxx> --ts <message ts> --text <text>Update message
opencli slack chat post --channel C01234567 --text "OpenCLI: production deploy done ✅"

files

CommandDescription
opencli slack files upload --channel <Cxx> --file <path> [--title <t>] [--thread-ts <ts>]Upload file
opencli slack files upload --channel C01234567 --file ./build.log --title "Build log"

channels

CommandDescription
opencli slack channels list [--types public_channel,private_channel,...]Conversations visible to the bot
opencli slack channels info --channel <Cxx>Channel metadata

users

CommandDescription
opencli slack users lookup --email <mail>Resolve email → user id
opencli slack users info --user <Uxx>User info

conversations

CommandDescription
opencli slack conversations open --users <U1,U2,...>Open or create DM

api (arbitrary Web API)

CommandDescription
opencli slack api call --method <methods.name> [--body '<json>'] [--query k=v]Direct call, e.g. chat.postMessage, users.list
opencli slack api call --method chat.postMessage --body '{"channel":"C01234567","text":"hi"}'

socket (optional)

CommandDescription
opencli slack socket dev [--app-token <xapp->]Local Socket Mode tunnel (per implementation)

Socket Mode vs HTTP events

  • HTTP / webhooks: needs public Request URL in the Slack app.
  • Socket Mode: great for local dev; needs xapp- app-level token. Some builds expose opencli slack socket dev—confirm with opencli slack --help.

Troubleshooting

SymptomFix
not_in_channelInvite the bot or use a channel it can access
invalid_authToken expired or wrong token type
rate_limitedApply backoff per Slack tiers