Get notified when your commands complete - supports Telegram, SMS, DingDing, Ntfy, and more
Project description
Alert After Pro ๐
Read this in other languages: English, ไธญๆ
Get notified when your commands complete! Simply prefix any command with aa and receive notifications via Telegram, SMS, DingDing (้้), Ntfy, or Pushover.
Perfect for long-running builds, tests, deployments, or any command you want to monitor remotely.
โจ Features
- Super Simple: Just prefix your command with
aa - Multiple Channels: Telegram, SMS (Twilio), DingDing, Ntfy, Pushover
- Rich Notifications: Command status, duration, exit code, hostname
- Cross-platform: Works on Linux, macOS, and Windows
- Zero Dependencies: Minimal core dependencies
- Configurable: Optional command output capture, multiple simultaneous channels
๐ Quick Start
Installation
pip install alert-after-pro
That's it! One line installation.
Setup
Run the configuration wizard:
aa --setup
Choose your notification channels and provide the necessary credentials.
Usage
Simply prefix any command with aa:
# Examples
aa make build
aa pytest tests/
aa docker-compose up
aa "sleep 10 && echo done"
aa npm install && npm run build
๐ฑ Supported Notification Channels
Telegram
- Create a bot via @BotFather
- Get your bot token
- Send a message to your bot
- Get your chat ID from:
https://api.telegram.org/bot<TOKEN>/getUpdates
Ntfy (ntfy.sh or self-hosted)
- Server: Use
https://ntfy.shor your own server - Topic: Any topic name (e.g., "my-alerts")
- Auth: Optional username/password for private servers
DingDing (้้)
- Create a robot in your DingDing group
- Get the webhook URL
- Optional: Enable signature verification with secret
SMS (via Twilio)
- Sign up at Twilio
- Get your Account SID and Auth Token
- Get a phone number
Pushover
- Sign up at Pushover
- Create an application
- Get your app token and user key
๐ง Command Options
aa --help # Show help
aa --setup # Run configuration wizard
aa --test # Send test notification
aa --silent <command> # Run command without notifications
๐ Configuration
Configuration is stored in ~/.aa/config.yaml:
enabled_notifiers:
- telegram
- ntfy
capture_output: false
telegram:
bot_token: "your_bot_token"
chat_id: "your_chat_id"
ntfy:
server: "https://ntfy.sh"
topic: "my-alerts"
username: "optional"
password: "optional"
dingding:
webhook: "https://oapi.dingtalk.com/robot/send?access_token=..."
secret: "optional_secret"
sms:
provider: "twilio"
account_sid: "your_account_sid"
auth_token: "your_auth_token"
from_number: "+1234567890"
to_number: "+0987654321"
pushover:
app_token: "your_app_token"
user_key: "your_user_key"
๐ What You'll Get
Rich notifications include:
- โ /โ Command status (success/failure)
- ๐ฅ๏ธ Hostname
- ๐ป Full command
- โฑ๏ธ Execution duration
- ๐ Exit code
- ๐ Start and end times
- ๐ Command output (optional)
- โ Error messages (on failure)
๐ ๏ธ Development
Local Development
git clone https://github.com/alert-after-pro/alert-after-pro
cd alert-after-pro
pip install -e .
Testing
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Test specific notifier
aa --test
Project Structure
alert-after-pro/
โโโ src/alert_after_pro/
โ โโโ main.py # Entry point
โ โโโ config.py # Configuration management
โ โโโ notifiers/ # Notification implementations
โ โโโ base.py # Abstract base class
โ โโโ telegram.py
โ โโโ ntfy.py
โ โโโ dingding.py
โ โโโ sms.py
โ โโโ pushover.py
โโโ setup.py
โโโ requirements.txt
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Areas for contribution:
- New notification channels
- Improved error handling
- Better message formatting
- Documentation improvements
- Testing
๐ License
MIT License - see LICENSE file for details.
๐ Acknowledgments
Inspired by alert-after. Built for developers who want to be notified when their long-running commands complete.
Happy coding! ๐
Made with โค๏ธ for developers who like to step away from their terminals.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alert_after_pro-0.2.2.tar.gz.
File metadata
- Download URL: alert_after_pro-0.2.2.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a06a6d64e18ea45abfb44c443dca65fc76ac98d7dbf62a706ab9be3258b408d
|
|
| MD5 |
080be06fefa7a616fcf2673bcfc0dd5c
|
|
| BLAKE2b-256 |
97153b43285b5a568e43d0209aeaa41261867dab85f1eb160679e0ac558dcdfe
|
File details
Details for the file alert_after_pro-0.2.2-py3-none-any.whl.
File metadata
- Download URL: alert_after_pro-0.2.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b09e7278f13fb92f7d33553bd7aa770bc0a2a240ff5e2683fdebf1142933f12
|
|
| MD5 |
bcac5044d0eb97b3b1ab0eb60f38dc8c
|
|
| BLAKE2b-256 |
f2a6d268c99cba741b20015c9d63ad3c60723c0f0e3a1bf2f58a9f8116c98ec2
|