Skip to main content

Slackbot Agent CLI

Manage and run Slack bots from the command line.

Commands

Start Bot

# Start Slack bot with webhook mode
praisonai-ts slack start \
  --bot-token $SLACK_BOT_TOKEN \
  --signing-secret $SLACK_SIGNING_SECRET \
  --port 3000

# Start with Socket Mode
praisonai-ts slack start \
  --bot-token $SLACK_BOT_TOKEN \
  --app-token $SLACK_APP_TOKEN \
  --socket-mode

Configure Bot

# Set bot instructions
praisonai-ts slack config \
  --instructions "You are a helpful assistant" \
  --model gpt-4o

# Add tools
praisonai-ts slack config \
  --tools search,calculator

Test Bot

# Send test message
praisonai-ts slack test \
  --message "Hello, bot!" \
  --channel C1234567890

Options

OptionTypeDefaultDescription
--bot-tokenstringenvSlack bot token
--signing-secretstringenvSigning secret
--app-tokenstringenvApp token for socket mode
--socket-modebooleanfalseEnable socket mode
--portnumber3000HTTP server port
--instructionsstring-Agent instructions
--modelstringgpt-4oModel to use

Environment Variables

VariableRequiredDescription
SLACK_BOT_TOKENYesBot token (xoxb-…)
SLACK_SIGNING_SECRETWebhookSigning secret
SLACK_APP_TOKENSocketApp token (xapp-…)
OPENAI_API_KEYYesFor the agent

Examples

Development Mode

# Run in socket mode for local development
SLACK_BOT_TOKEN=xoxb-... \
SLACK_APP_TOKEN=xapp-... \
praisonai-ts slack start --socket-mode

Production Mode

# Run with webhook mode
praisonai-ts slack start \
  --port 3000 \
  --instructions "You are a helpful Slack assistant"
  • praisonai-ts slack logs - View bot logs
  • praisonai-ts slack stats - View usage statistics