DEV Community

Cover image for Timer in GitHub CLI
Andrew Malkov
Andrew Malkov

Posted on

Timer in GitHub CLI

The new GitHub CLI 2.0 includes extensions now.

I always wanted to have a timer or stopwatch in my terminal. This will allow me to use it to timebox my tasks and increase my productivity by minimizing switching from a terminal to a different timer application, like browser, and back to terminal.
It will be also cool if this timer can be big enough on the screen, so I can use it as a timer for my demo sessions to let attendees know how much time left for a break.

So, I decided to build it as a GitHub CLI extension. This will allow me to use it easily in all of my machines.

You can find it on GitHub:
https://github.com/anmalkov/gh-timer

How to install

First of all you have to install GitHub CLI 2.0, if you don't have it yet. Install GitHub CLI now.

After that you can install gh-timer extension:

gh extension install anmalkov/gh-timer

options

gh timer [units] [number] [mode] [clock]

[units]

-s, --sec - seconds

-m, --min - minutes

[mode]

-w, --stopwatch - use a stopwatch mode, otherwise use a timer mode

[clock]

-b, --big - show a big clock, otherwise show a small clock

usage examples

gh timer -s 10
run a timer for 10 seconds

gh timer -m 5
run a timer for 5 minutes

gh timer -m 5 -b
run a timer for 5 minutes and show big clock

gh timer -m 60 -w
run a stopwatch for 1 hour

gh timer -h
show help

If you like it, please don't forget to give it a star on GitHub!

If you have any questions or would like to contribute - you are welcome to contact me!

See you soon.

Top comments (0)