simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.62k stars 109 forks source link

Try out Trogon for a tui interface #545

Closed simonw closed 1 year ago

simonw commented 1 year ago

https://github.com/Textualize/trogon

simonw commented 1 year ago

I don't want to add trogon as a default dependency because it's a little heavy - it pulls in all of Rich and Textual as well. People who use sqlite-utils just for its Python API won't benefit from this - it's a CLI feature only.

But I have a sqlite-utils install ... command for helping people to install packages into the same virtual environment as sqlite-utils no matter how they installed that tool: https://sqlite-utils.datasette.io/en/stable/cli.html#cli-install

So I can treat Trogon as an optional dependency and add the sqlite-utils tui command only if that package is also installed.

simonw commented 1 year ago

OK, this works!

trogon

To try it out, install that branch from GitHub:

pip install https://github.com/simonw/sqlite-utils/archive/refs/heads/trogon.zip

Then run this:

sqlite-utils install trogon

And this:

sqlite-utils tui
simonw commented 1 year ago

Opened a feature request for customizing the help and command name:

simonw commented 1 year ago

It looks like nargs=-1 on a positional argument isn't yet supported - opened an issue here:

simonw commented 1 year ago

Draft documentation: https://sqlite-utils--549.org.readthedocs.build/en/549/cli.html#cli-tui

simonw commented 1 year ago

Now released: https://sqlite-utils.datasette.io/en/stable/changelog.html#v3-32