refactor: replace argparse CLI with click commands and add shell subcommand

Migrate the command-line interface from argparse to click, introducing a `cli` group with `serve` and `shell` subcommands. The `serve` command retains port, host, and db_path options with defaults, while the new `shell` command launches an IPython shell with the application context. Update Makefile targets to use the new `.venv/bin/snek` binary and add a `serve` alias for `run`.
This commit is contained in:
2025-05-09 07:56:23 +00:00
parent 5cb4233138
commit b71731bfcf
2 changed files with 29 additions and 33 deletions
+7 -3
View File
@@ -5,17 +5,21 @@ GUNICORN=./.venv/bin/gunicorn
GUNICORN_WORKERS = 1
PORT = 8081
python:
$(PYTHON)
shell:
.venv/bin/snek shell
dump:
@$(PYTHON) -m snek.dump
build:
serve: run
run:
.venv/usr/bin/snek
.venv/bin/snek serve
#$(GUNICORN) -w $(GUNICORN_WORKERS) -k aiohttp.worker.GunicornWebWorker snek.gunicorn:app --bind 0.0.0.0:$(PORT) --reload
install: ubuntu