How to create command prompt kind of commands?

(I’m new to the forum)

I was wondering how to create commands like “fup dump”, output: “‘Fupping’ dump.”

In the standard library, check out argparse. For a fantastic third-party library, check out click.

I will update later with links and examples when I have a keyboard

The simplest way is to install a Python script as a command.

If you’re on a UNIX or UNIXlike system (Linux, MacOS, the other *BSDs
etc), you need:

  • a place in your $PATH where you can put personal commands
  • the command as a Python script

Normal practice is to make a directory $HOME/bin and to include
$HOME/bin in your $PATH environment variable, often towards the front.
That is usually done by putting something like this:

export PATH=$HOME/bin:$PATH

in your $HOME/.profile file.

Regarding the script itself, make a file named $HOME/bin/fup containing:

#!/usr/bin/env python