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.1.tar.gz (15.1 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.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file alert_after_pro-0.2.1.tar.gz.

File metadata

  • Download URL: alert_after_pro-0.2.1.tar.gz
  • Upload date:
  • Size: 15.1 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.1.tar.gz
Algorithm Hash digest
SHA256 c57d76d856fe604a9401f256ee30b7f7e8d9a304a77f63ac23c9539cc94697b2
MD5 b8813739b8733f4eca3e571326cbbb89
BLAKE2b-256 b3f795e6fbe61878b59ca31f89f7fa046f46afd3c69c56515a09d1aa58a7838c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alert_after_pro-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ad35fd725142b8b087eba5a2ed0e0e93b00bea08f6d30991b58508417323b39
MD5 08333973ee1c5e2d82a45eb2ad6c6c84
BLAKE2b-256 e63095b33b237813e3cfee6fbdf833c745e425b36ca4ff22740284aaefaee345

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