A bootstrapped command-line tool for exploring and working with a database from the command-line. Useful when interacting with a DB on a project without CLI tooling offered by its framework.
- SQLAlchemy: Powered by providing a SQLAlchemy engine.
- Typer: Powered by the Typer library allowing for simple command definition.
- Click: Typer is powered by the Click library which can be leveraged for additional CLI functionality.
This project is not ready, but its public because I need it 😉
$ pip install -r requirements.txt
There are multiple options for settings
- Edit the
settings.py
file - Create a
.env
file (recommended). - Create environment variables.
To define your own commands, create a file in the commands/
dir. Each file must have app = typer.Typer()
which will be picked up as a sub command.
- Sub-command name: Taken from file name.
- Sub-command help text: Taken from the file's doc string.
- Sub-command available commands: Commands registered to the
app
.
- Your best bet is (after installing) to run
python main.py
- See
commands/example.py
for an example of a custom command.