A minimal CLI tool for Slack API operations
npm install slack-axA minimal CLI tool for Slack API operations.
``bash`
npm install -g slack-ax
`bashUsing the config command (stored in ~/.config/slack-ax/config.json)
slack-ax config set-token "xoxb-your-token-here"
$3
`bash
slack-ax config show
`$3
`bash
slack-ax config clear
`Usage
$3
`bash
slack-ax send "Hello, world!" "#general"
slack-ax send "Hello, world!" "C1234567890" # Using channel ID
`$3
Note: Search requires a user token (
xoxp-), not a bot token.`bash
slack-ax search "#general" "bug fix"
`$3
`bash
slack-ax edit "#general" "1234567890.123456" "Updated message text"
`$3
`bash
slack-ax delete "#general" "1234567890.123456"
`Required Slack Scopes
Your Slack token needs the following scopes:
-
chat:write - Send, edit, and delete messages
- search:read - Search messagesToken Types
| Token Type | Commands |
|------------|----------|
| Bot (
xoxb-) | send, edit, delete |
| User (xoxp-) | send, edit, delete, search |The
search` command only works with user tokens due to Slack API limitations.MIT