Code Monkey home page Code Monkey logo

noclify's Introduction

Get notified by a Telegram bot when a task executed in your terminal finishes.

Useful if you usually run long tasks and you like to do something else in the meantime.

How to use

  1. Install the CLI
npm i -g noclify
  1. Start a conversation with the Telegram bot. It'll return a key like this one: 14237999-334a-4429-4444-e4c323c37440
  2. Run whatever command you want preceded by noclify in your shell, for example:
noclify sleep 5
  1. Paste the key and you are all set (it won't ask for the key in subsequent runs)
  2. Check that you have been notified of the task ending successfully:
โœ… sleep 5 ended successfully (5.011s)

How it works

There are three pieces working together here:

  1. Telegram's bot API
  2. Cloudflare worker (whose code is under the worker folder)
  3. CLI (whose code is under the cli folder and published in NPM)

When you use the bot the first time it generates a key for you that saves together with your chat id in Cloudflare Worker KV.

The CLI executes whatever command you put after noclify and when it ends notifies the worker with your key and some metadata. Note: If the task lasts less than 4 seconds it won't notify anything, because you are probably there anyway.

The worker finds your chat id given the key and sends the message to the Telegram API.

noclify's People

Contributors

alexmenor avatar

Stargazers

Akbarshokh Sobirov avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.