Your own trusty housekeeper
A dynamic and configurable command line app to maintain *nix systems. It helps automating os upgrades, running backup tools, etc. It gets its instructions from a config file and automatically generates shell completions for it. It can also decide whether to run a command or not depending on the platform it’s running on. “Domestobot” is a robotic servant from the GTA series.
Just clone the repo and install it using pipx:
pipx install -e /path/to/domestobot
Alternatively, you can also use plain pip:
pip install --user -e /path/to/domestobot
You could also install from PyPI if you don’t want/need the latest changes.
Domestobot runs a series of steps
, which are simple functions that invoke
shell commands under the hood. Their contents are defined in a config file.
Steps are invoked running domestobot <step name>
and you can also run
domestobot
without a name to run a pre-configured list of steps.
Completions for the current shell only need to be installed once running
domestobot --install-completion
and after that they will be dynamically
generated using your config.
You can use the config tutorial as a starting point (it’s short, I promise).
Copy the directory to ~/.config/domestobot/
so you can test it while you
read. Once you copy it, you can run domestobot --help
to see what
sub-commands (steps) and options are available.
Domestobot can also be used as a library. The apps created by
domestobot.get_app
are regular Typer applications, so you can use them
with add_typer to include them in a bigger application. You could look at
typer-scripts to see how I do it.
To get a working environment, install the toolchain requiremenrs inside a virtual environment:
pip install -r requirements/toolchain_requirements.txt
then install development requirements using doit:
doit sync
Doit can also sort import statements, update requirements, etc. You can see
available commands with doit list
.
To run a local build (including unit tests), run nox inside the project directory:
nox
This same command is run by Github Actions for every pushed commit.