3 ms·
This is really fun. I have an experimental branch of my sqlite-utils CLI tool (which has dozens of sub-commands) running with this now and it really did only ta
by simonw 4y ago
This is really fun. I have an experimental branch of my sqlite-utils CLI tool (which has dozens of sub-commands) running with this now and it really did only take 6 lines of code - I'm treating Trogon as an optional dependency because people using my package as a Python library rather than a CLI tool may not want the extra installed components:
https://github.com/simonw/sqlite-utils/commit/ec12b780d5dcd64b348986b083394bd805de5fe7 https://github.com/simonw/sqlite-utils/commit/ec12b780d5dcd6...
There's an animated GIF demo of the result here: https://github.com/simonw/sqlite-utils/issues/545#issuecomment-1556190531 https://github.com/simonw/sqlite-utils/issues/545#issuecomme...
- hprotagonist 4y agoman i’m installing that this instant …
- simonw 4y agoI've now released this as `sqlite-utils` 3.32: https://sqlite-utils.datasette.io/en/stable/changelog.html#v3-32 https://sqlite-utils.datasette.io/en/stable/changelog.html#v... To install: pipx install sqlite-utils Then add the trogon dependency - this command ensures it gets added to the correct virtual environment: sqlite-utils install trogon Then run this: sqlite-utils tui Screenshot in the docs: https://sqlite-utils.datasette.io/en/stable/cli.html#cli-tui https://sqlite-utils.datasette.io/en/stable/cli.html#cli-tui
- hprotagonist 4y agowhy not pipx inject sqlite-utils trogon or really, pipx install 'sqlite-utils[tui]' i believe you can expose sub-commands only if an extra is installed; i know this is true for separate entry points.