slack-ax
v1.2.0
Published
A minimal CLI tool for Slack API operations
Maintainers
Readme
slack-ax
A minimal CLI tool for Slack API operations.
Installation
npm install -g slack-axConfiguration
Set your Slack API token
# Using the config command (stored in ~/.config/slack-ax/config.json)
slack-ax config set-token "xoxb-your-token-here"
# Or using an environment variable
export SLACK_TOKEN="xoxb-your-token-here"View configuration
slack-ax config showClear stored token
slack-ax config clearUsage
Send a message
slack-ax send "Hello, world!" "#general"
slack-ax send "Hello, world!" "C1234567890" # Using channel IDSearch messages
Note: Search requires a user token (xoxp-), not a bot token.
slack-ax search "#general" "bug fix"Edit a message
slack-ax edit "#general" "1234567890.123456" "Updated message text"Delete a message
slack-ax delete "#general" "1234567890.123456"Required Slack Scopes
Your Slack token needs the following scopes:
chat:write- Send, edit, and delete messagessearch:read- Search messages
Token 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.
License
MIT
