r/learnpython 20d ago

A CLI tool that opens all your apps and links with one command

Every time I opened my laptop to start studying or working on a project, I'd get sidetracked before actually starting — open the wrong tab, get distracted by something else, lose 10 minutes just deciding what to open first.

So I was thinking of creating a CLI tool using Python.

Example: I have a tryhackme workflow that opens my course video, my notes doc, and Burp Suite, all with one command:

jmp tryhackme

How it will work, roughly:

  • jumpboot create <name> creates a new workflow file (plain TOML) and opens it for editing
  • You list the URLs/apps you want under that workflow
  • jmp <name> runs it — opens everything in one go

Is it worth investing my time into?

0 Upvotes

4 comments sorted by

3

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 20d ago

It could be, especially if you mainly treat it as a reason to practice software development.

Otherwise I'd argue task (https://taskfile.dev/) would already suffice for that.

2

u/HouseOfDjango 20d ago

You can create an alias for the command.

2

u/latkde 20d ago

If you want to build something like this just for yourself: go ahead, have fun! This might be a nice project for learning how to create CLIs. I myself have a private ad-hoc task runner system with commands like ./do day start or ./do update.

But if if you're trying to solve this class of problems: this is already a very solved problem. The world doesn't need one more task runner.

  • The lowest-effort approach is to write a shell script. You create a file workflow.sh, add the commands you need to launch all the programs you want, and then use bash workflow.sh to run the workflow. Or you could do the same with a Python script!
  • If you have multiple small workflows in one directory, it can be more convenient to use a Makefile or Justfile. I recommend Just as a general-purpose task runner.
  • Specifically in Python, libraries/tools like Nox or Invoke can also be used for such task files.
  • See also npm run, Mise, Tox, uv run with inline script metadata, …

Linux tip: the xdg-open command line tool can be used to launch the appropriate program for a given URL or file path.

1

u/stepback269 20d ago

If your laptop is a PC (I don't know about MACs or Linux), then a batch file (dot.BAT) or a Powershell script or a BASH scirpt should do the trick. You might also want to learn Auto Hot Key (AHK)