Skip to content

Simple terminal command line notification tool on completion of your commands and processes.

License

Notifications You must be signed in to change notification settings

AnirudhG07/ntfyme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntfyme 📣 Static Badge

📷 Previews/Screenshots⚡Features🔥Usages🔨Installation⭐Getting Started

Have you ever wanted a simple tool in your terminal which gives you notification when the program is done, like some computer notification or some mail. This tool helps you ease your life with appropriate notifications you can set in your OS, get mail regarding it and best of all, it is VERY SIMPLE TO USE!

ntfyme stands for 'notify-me', obviously! So just write your command and pipe the notification of its Error(or Success) with ntfyme.

📷 Previews

Command line Usage

ntfyme_prev2.mov

You can run any command, from regular command line to computational biology commands to any other!

Gmail

You can get texts for smaller outputs and text files for bigger outputs upto the limit GMAIL allows.

ntfyme_gmail1

Telegram bot messages

After setting up your telegram bot, you can get similar outputs there too with NOTIFICATION.

Telegram bot preview

and more ...

⚡ Features

  • ✨ Very easy to use and setup.
  • ✨ Cross platform support for Windows, MacOS and Linux.
  • ✨ Get local notifications when your command is done.
  • ✨ Get notifications like gmail, telegram bot, etc. when your command is done.
  • ✨ Get information about output, errors, time taken, pid and more in the notification.
  • ✨ Track your process for possible suspensions and get notified after thorough diagnostics.
  • ✨ Enhanced UI features powered by rich and beaupy.

🔥 Usages

Say you want to run your terminal command called <command>, which can be running some python script, some shell scripts, or any terminal regular command.

There are mainly two ways to use the tool to get a notification -

1. Direct Run

For "direct running", you can follow the below format -

ntfyme exec -c <command>

2. Piping the command

For "piping the command", you can follow the below format -

echo <command> | ntfyme exec

Both the above commands will give the SAME output, a notification when the command is done.

Note

For Windows, it is recommended to enclose you commands in double quotes. For example - ntfyme exec -c "echo hi".

More examples

  1. To run multiple commands, you can use the "multiple commands" syntax to input to ntfyme. For example -
echo "echo hi; touch hello.txt; echo 'What a day!' > hello.txt" | ntfyme exec

The net output will be outputted for such commands with an overall diagnostics instead of seperate for each command.

  1. Running ssh will not work with ntfyme. Although one can use it to test the connection and then run the command. For example -
echo "nmap 1.1.1.1 -p 22" | ntfyme exec

This command may take some time to run, but will give you a notification when the command is done.

  1. If you would like to get notifications for an ssh command, you would need to install ntfyme on the remote machine, give your gmail id and app password in the config.toml.

🔨 Installation

You can install this tool with the below options available:

Pypi Installation

You can download this tool by running the below command -

pip install ntfyme

Tip

For Windows, you may get a mesage to add C:\Users\your\path\to\Python31x\Scripts(whatever you get) to path, refer this guide. Please add it to the path in order to run ntfyme.

Homebrew Installation(for MacOS)

This tool can downloaded from my Homebrew tap, by running the below command -

brew install anirudhg07/anirudhg07/ntfyme

Manual Installation

You can download the source code from the repository and run the below command to install the tool -

git clone https://github.com/AnirudhG07/ntfyme.git
cd ntfyme
pip install .

Important

WSL will be counted as windows instead of linux, thus notifications will be done through "plyer" library instead of linux notify-send. To complete the installation process for WSL, please run wsl.sh script in your WSL terminal with sudo permissions. You can do this by running -

chmod +x wsl.sh
sudo ./wsl.sh

⭐ Getting Started

To get started with ntfyme, first download the tool using the above installation methods. To enable notifications through gmail or telegram bot, you will need to setup the respective services manually. The guides to setup the services are mentioned in the docs.

To know more about the config.toml and configurations, read below.

Configurations

ntfyme allows you to configure the tool according to your needs. The configurations are stored in the config.toml which you can open using root privilages while running ntfyme --config. Let's understand some of the configurations below.

ntfyme uses on/off to enable/disable ny settings. Please do not input any other values other than on/off for the enabled option. The comments for each option is mentioned, please read them before changing any option. They will give a thorough idea about the configurations and their usage. Please do not mess around with the config.toml file, as it may lead to some errors in the tool.

Contribute

You are very welcome to contribute to this project. If you find bugs, or more API's for notifications, some more features, etc. feel free to create an issue, discuss and then make a PR. To make ntfyme better and used throughout the world, please star and share this repo to everyone!

About

Simple terminal command line notification tool on completion of your commands and processes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages