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.0.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.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alert_after_pro-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 123c8d6f5921ca6e0457b4e04788e75c10765355f29d8f259e457bd6bfd1965f
MD5 3be534a52be13c00edb31775070628c7
BLAKE2b-256 0bf1a77cc4602b0872edb48be65b601e9e84fa963becd511b43d30cf163b2cfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for alert_after_pro-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc1bd6337f96fb7e70ef91a009306a6f84e0bd4a8434f4e6fe1e8f3ad8a58e3
MD5 f0df7e3ba1e8640847484bdfb724e97e
BLAKE2b-256 0d2d0f14cf7303833af42b512e44c67d31c1e1fde367a6147f6caac680e2d182

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