Hacker News new | past | comments | ask | show | jobs | submit login

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/ec12b780d5dcd6...

There's an animated GIF demo of the result here: https://github.com/simonw/sqlite-utils/issues/545#issuecomme...




I've now released this as `sqlite-utils` 3.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


why 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.


man i’m installing that this instant …




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: