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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user