DEV Community

Cover image for Open Dev.to from your terminal ๐ŸŽ‰
Kelvin Wangonya
Kelvin Wangonya

Posted on

Open Dev.to from your terminal ๐ŸŽ‰

Sometimes when I'm hacking away on my terminal, I like to take a break and read the articles on this awesome community. The dev.to cli is pretty neat, and I highly recommend it. It works great! Try it out if you haven't.

What I felt would be better for me though, was a scenario where I'd just type in one command and a new Dev.to tab would open on my browser. So I wrote a simple python script to do this. This was extremely simple to do using python's webbrowser package.

python

Then I thought: "Why not make this a package and share it with everyone?", and that's exactly what I did.

Installation

Install open-dev.to from PyPi

pip install open-dev.to
Enter fullscreen mode Exit fullscreen mode

How to use

$ dev.to --help
Usage: dev.to [OPTIONS]

  Open a new dev.to browser tab on the browser

Options:
  -t, --tag TEXT  add a tag
  --help          Show this message and exit.

Enter fullscreen mode Exit fullscreen mode

Open home page

$ dev.to
Enter fullscreen mode Exit fullscreen mode

Open a tag page

e.g javascript, career, productivity

$ dev.to -t javascript
Enter fullscreen mode Exit fullscreen mode

Enjoy!

kitten

Top comments (9)

Collapse
 
nielsbom profile image
Niels Bom • Edited

I think open https://dev.to would also work. Or firefox https://dev.to for example. Or if you want a shorter name for it, add the following to your .bashrc (or similar shell file): alias dev.to=โ€˜open https://dev.toโ€™

Collapse
 
wangonya profile image
Kelvin Wangonya

Nice! An even easier way ๐Ÿ˜„. I guess I just wanted to play around with python ๐Ÿ˜…

Collapse
 
nielsbom profile image
Niels Bom

โ€œScratching your own itchโ€ is one of the best ways to learn, so good choice!

Collapse
 
elabftw profile image
eLabFTW
Collapse
 
laurieontech profile image
Laurie

Kitten using computer!!! โค๏ธโค๏ธโค๏ธ

Also, this is great :)

Collapse
 
tomasforsman profile image
Tomas Forsman

This was fun =) You should add a bit about the process, what you needed to make this happen and how to make a package to share.

Collapse
 
wangonya profile image
Kelvin Wangonya

I'll do that on the next post. Thanks! ๐Ÿ˜Š

Collapse
 
sarthology profile image
Sarthak Sharma

That's Great. All the very best. ๐Ÿ˜Š

Collapse
 
wangonya profile image
Kelvin Wangonya

Thanks Sarthak.