DEV Community

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

Posted on

35 14

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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where youโ€™ll build it, break it, debug it, and fix it. Youโ€™ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good olโ€™ AI to find and fix issues fast.

RSVP here โ†’

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.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay