| version | 4.0.0 |
| name | slack-automator |
| description | Automate Slack messaging, channels, and search with Block Kit. Use when sending scheduled messages, syncing channels, monitoring chats, notifying teams. |
| author | BytesAgain |
| homepage | https://bytesagain.com |
| source | https://github.com/bytesagain/ai-skills |
slack-automator
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)
- Slack Incoming Webhook URL — see setup below
How to Get a Slack Webhook URL
- Go to [[Technical Reference]]([Technical Reference])
- Click Create New App → From scratch
- 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 `[Technical Reference])
Setup
Configure the webhook URL before sending messages:
scripts/script.sh connect [Technical Reference]
Verify connectivity:
scripts/script.sh webhook test
Commands
connect <webhook_url>
Save a Slack Incoming Webhook URL to local configuration. The URL is stored in ~/.slack-automator/config.json.
scripts/script.sh connect [Technical Reference]
send <message>
Send a plain text message to Slack via the configured webhook.
scripts/script.sh send "Hello from Slack Automator!"
scripts/script.sh send "🚀 Deployment complete — v2.1.0 is live!"
scripts/script.sh send Build succeeded, all 142 tests passing.
notify <channel> <message>
Send a message to a specific Slack channel. The channel name will be prefixed with # if not already present.
scripts/script.sh notify alerts "⚠️ Server CPU at 95%!"
scripts/script.sh notify "#deployments" "v3.0.2 deployed to production"
scripts/script.sh notify general "Standup in 5 minutes!"
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.
scripts/script.sh schedule add 09:00 "Good morning, team! ☀️"
scripts/script.sh schedule add "0 18 * * 5" "Happy Friday! 🎉"
scripts/script.sh schedule add "0 * * * *" "Hourly status check"
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.
scripts/script.sh schedule list
schedule remove <id>
Remove a scheduled message by its ID.
scripts/script.sh schedule remove 1710820900
template list
List all saved message templates.
scripts/script.sh template list
template save <name> <message>
Save a reusable message template. Use {{variable}} placeholders for dynamic values.
scripts/script.sh template save deploy "🚀 Deployed *{{service}}* to production ({{version}})."
scripts/script.sh template save alert "⚠️ {{level}}: {{message}}"
scripts/script.sh template save welcome "👋 Welcome to the team, {{name}}!"
template use <name> [var=value ...]
Send a message using a saved template. Variables in {{var}} are replaced with provided var=value pairs.
scripts/script.sh template use deploy service=api-server version=v2.1.0
scripts/script.sh template use alert level=HIGH message="Database connection timeout"
scripts/script.sh template use welcome name=Alice
webhook test
Send a test message to verify webhook connectivity. The test message includes a timestamp.
scripts/script.sh webhook test
webhook info
Show the current webhook configuration. The URL is partially masked for security.
scripts/script.sh webhook info
format <style> <message>
Format a message using Slack's mrkdwn syntax and optionally send it. Available styles:
| Style | Slack Syntax | Example Output |
|---|
bold | *text* | text |
italic | _text_ | text |
code | `text` | text |
codeblock | ```text``` | code block |
quote | > text | quoted text |
strike | ~text~ | text |
list | • item | bulleted list |
scripts/script.sh format bold "Important announcement"
scripts/script.sh format codeblock "const x = 42;"
scripts/script.sh format list "Task 1, Task 2, Task 3"
history
Show the 20 most recent messages from the send history, including timestamps, actions, status, and channels.
scripts/script.sh history
stats
Show usage statistics including message counts, success rate, action breakdown, and date range.
scripts/script.sh stats
export <format>
Export message history to a file. Supported formats: json, csv, txt.
scripts/script.sh export json
scripts/script.sh export csv
scripts/script.sh export txt
config [key] [value]
View or set configuration values. Available keys: webhook_url, default_channel, username, icon_emoji.
scripts/script.sh config
scripts/script.sh config default_channel "#engineering"
scripts/script.sh config default_channel
help
Print usage information and the list of all available commands.
scripts/script.sh help
version
Print the current version string.
scripts/script.sh version
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
scripts/script.sh connect [Technical Reference]
scripts/script.sh webhook test
scripts/script.sh send "Hello, Slack! 👋"
CI/CD Integration
scripts/script.sh template save deploy "🚀 *{{service}}* deployed to *{{env}}* ({{version}})"
scripts/script.sh template use deploy service=web-app env=production version=v1.2.3
Monitoring Alerts
scripts/script.sh notify alerts "🔴 Database connection pool exhausted — 0/50 available"
scripts/script.sh format bold "CRITICAL: Payment service unreachable"
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com