Automate Slack messaging, channels, and search with Block Kit. Use when sending scheduled messages, syncing channels, monitoring chats, notifying teams.
Send messages to Slack channels via Incoming Webhooks. Supports direct messaging, channel notifications, message templates with variable substitution, scheduled messages, formatting helpers, and full send history with export.
Requirements
- bash 4.0+
curl (for HTTP requests to Slack)
python3 (for JSON handling — typically pre-installed)
Name it (e.g., "Automator") and select your workspace
In the left sidebar, click Incoming Webhooks
Toggle Activate Incoming Webhooks to On
Click Add New Webhook to Workspace
Select the channel to post to and click Allow
Copy the webhook URL (starts with https://hooks.slack.com/services/...)
Setup
Configure the webhook URL before sending messages:
CODEBLOCK0
Verify connectivity:
CODEBLOCK1
Commands
connect <webhook_url>
Save a Slack Incoming Webhook URL to local configuration. The URL is stored in ~/.slack-automator/config.json.
CODEBLOCK2
send <message>
Send a plain text message to Slack via the configured webhook.
CODEBLOCK3
notify <channel> <message>
Send a message to a specific Slack channel. The channel name will be prefixed with # if not already present.
CODEBLOCK4
schedule add <time> <message>
Add a scheduled message. Time can be in HH:MM format (converted to daily cron) or a full cron expression. Schedules are saved to ~/.slack-automator/schedule.json.
CODEBLOCK5
Note: Schedules are saved locally. To actually trigger them, set up a cron job that runs slack-automator send with the scheduled messages.
schedule list
Display all scheduled messages with their IDs, cron expressions, and status.
CODEBLOCK6
schedule remove <id>
Remove a scheduled message by its ID.
CODEBLOCK7
template list
List all saved message templates.
CODEBLOCK8
template save <name> <message>
Save a reusable message template. Use {{variable}} placeholders for dynamic values.
CODEBLOCK9
template use <name> [var=value ...]
Send a message using a saved template. Variables in {{var}} are replaced with provided var=value pairs.
CODEBLOCK10
webhook test
Send a test message to verify webhook connectivity. The test message includes a timestamp.
CODEBLOCK11
webhook info
Show the current webhook configuration. The URL is partially masked for security.
CODEBLOCK12
format <style> <message>
Format a message using Slack's mrkdwn syntax and optionally send it. Available styles:
Style
Slack Syntax
Example Output
INLINECODE21
INLINECODE22
text
INLINECODE23
_text_ | text |
| code | `text | text |
| codeblock | `text` | code block |
| quote | > text | quoted text |
| strike | ~text~ | ~~text~~ |
| list | • item | bulleted list |
CODEBLOCK13 const x = 42; CODEBLOCK14
### history
Show the 20 most recent messages from the send history, including timestamps, actions, status, and channels.
CODEBLOCK15
### stats
Show usage statistics including message counts, success rate, action breakdown, and date range.
CODEBLOCK16
### export
Export message history to a file. Supported formats: json, csv, txt.
CODEBLOCK17
### config [key] [value]
View or set configuration values. Available keys: webhookurl, defaultchannel, username, icon_emoji.
CODEBLOCK18
### help
Print usage information and the list of all available commands.
CODEBLOCK19
### version
Print the current version string.
CODEBLOCK20
## Data Storage
All data is stored in ~/.slack-automator/:
| File | Purpose |
|-----------------------|--------------------------------|
| config.json | Webhook URL and settings |
| history.json | Complete message send history |
| schedule.json | Scheduled messages |
| templates/ | Saved message templates (.txt`) |
Examples
Quick Start
CODEBLOCK21
CI/CD Integration
CODEBLOCK22
Monitoring Alerts
CODEBLOCK23
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com