Skip to content

AliGhahraei/domestobot

Repository files navigation

domestobot

Your own trusty housekeeper

https://github.com/AliGhahraei/domestobot/actions/workflows/python-tests.yml/badge.svg

https://static.wikia.nocookie.net/gtawiki/images/2/20/Domestobot-GTAVCS-Front.png

Description

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.

Installation

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.

Usage

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.

Usage as library

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.

Development

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.

About

Your own trusty housekeeper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages