Skip to main content

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

  1. Create a bot via @BotFather
  2. Get your bot token
  3. Send a message to your bot
  4. Get your chat ID from: https://api.telegram.org/bot<TOKEN>/getUpdates

Ntfy (ntfy.sh or self-hosted)

  • Server: Use https://ntfy.sh or your own server
  • Topic: Any topic name (e.g., "my-alerts")
  • Auth: Optional username/password for private servers

DingDing (้’‰้’‰)

  1. Create a robot in your DingDing group
  2. Get the webhook URL
  3. Optional: Enable signature verification with secret

SMS (via Twilio)

  1. Sign up at Twilio
  2. Get your Account SID and Auth Token
  3. Get a phone number

Pushover

  1. Sign up at Pushover
  2. Create an application
  3. 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

alert_after_pro-0.2.2.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alert_after_pro-0.2.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

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

Hashes for alert_after_pro-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4a06a6d64e18ea45abfb44c443dca65fc76ac98d7dbf62a706ab9be3258b408d
MD5 080be06fefa7a616fcf2673bcfc0dd5c
BLAKE2b-256 97153b43285b5a568e43d0209aeaa41261867dab85f1eb160679e0ac558dcdfe

See more details on using hashes here.

File details

Details for the file alert_after_pro-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for alert_after_pro-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b09e7278f13fb92f7d33553bd7aa770bc0a2a240ff5e2683fdebf1142933f12
MD5 bcac5044d0eb97b3b1ab0eb60f38dc8c
BLAKE2b-256 f2a6d268c99cba741b20015c9d63ad3c60723c0f0e3a1bf2f58a9f8116c98ec2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page