Skip to main content

Get notified when your commands complete - supports Telegram, SMS, DingDing, Ntfy, and more

Project description

Alert After Pro ๐Ÿš€

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 the original "alert after" concept. Built for developers who want to be notified when their long-running commands complete, whether they're building projects, running tests, or deploying applications.


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.1.0.tar.gz (13.9 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.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alert_after_pro-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 194730297a417e53baa53d524f7244a9ded8bd63fd138d91aed3607843124a42
MD5 c722362214c675d371fb044b24f82984
BLAKE2b-256 e1eb9d72313f83a61657c097b000c2914f9601437ca2f3a07dc036c70f58c18f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alert_after_pro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91b005adbdd1b96553305fd21633de402a14c8b3c6744470162b5a464ae707d6
MD5 ff1fd01996d28731295f014297d353b5
BLAKE2b-256 0a7ac87ced55d5c379d0d156c82b7abbb26db526dfd71d708564a43a298290d7

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