-
Notifications
You must be signed in to change notification settings - Fork 49
feat: create CLI #514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create CLI #514
Conversation
does not save sesssion yet
also removed password field in db
|
This looks really cool and useful! |
It doesn't seem to cause any issues, although there is no reason to import it
This comment was marked as resolved.
This comment was marked as resolved.
|
ideally, all sql commands should be moved to ctx.py or db.py |
|
you can try commands like once the groups system is finished, i intend on merging this. Then, more features, e.g. commenting etc, can be added later. I also added an optional dependency |
|
It may be a good idea to try and steer away from this 'fake TUI'-like output. Maybe I will try to make it more like github's CLI |
|
how is it fake tui |
|
it uses panels and layouts which is like a tui, but it still uses commands. using panels takes a lot of space |
|
possibly, a tui could be developed separately, e.g. using textualise |
|
for now, i will leave the |
|
how should sessions be represented? -L for login? or --session (-S is for studio) |
Also changed __str__ representation. This should be implemented into CLI before publish
|
possibly we could use verbose parameter names for the string reprs, idk e.g. a timmccool user.User object -> |
|
I will add some more to-dos as issues but i want to merge this so that i don't need to sync it all the time |
Solves issue #478
Changes
This PR adds a CLI via the
__main__.pyfile and theclisubmodule. It adds a console scriptscratchwhen installed with pip. If you want to develop it, you will need to reinstall scratchattach (pip install -e .).It is based on the specification here, which will later be made into a tutorial.
Each command will be split into a separate file within
cli/cmd, and be imported viacli/cmd/__init__.py.Note
I have not added the CLI to
scratchattach/__init__.py. I do not see a reason to. Any future features like pretty printing of e.g.Activitywill be implemented directly into scratchattach through some method. I will probably call it something like.rich_format()The CLI uses sqlite3 (this is in the python standard library) to store session ids with usernames. It (will) use rich for colored and formatted output.

Tests
It is a good question to consider how the CLI could be tested. I am not sure what the best means is.
TODO