CityOfZion / neo-python

Python Node and SDK for the NEO 2.x blockchain. For NEO 3.x go to our successor project neo-mamba
https://neo-python.readthedocs.io/en/latest/
MIT License
313 stars 189 forks source link

Create a more interactive and clean CLI #624

Open ixje opened 6 years ago

ixje commented 6 years ago

Rationale: The current CLI can be described as a vertical scrolling log where the bottom line is interactive and allows for command inputs that get displayed in the log. While it gives a quick historical overview, it is not suited for interactive inspection of data such as Blocks and Transactions.

Event logging is interlaced with command history and can clutter the view. Error messages can even disrupt the proper representation of the statusbar (see below). In short, there is enough room for improvement console

Goal: Create a clean interactive CLI. The mitmproxy CLI is a great example how interactive and clean a console application can be. It uses the urwid library for the heavy lifting (beware it has a steep learning curve).

CLI wishes:

dethos commented 5 years ago

So do you know if we can achieve the "goal" with all the described wishes using the current prompt_toolkit package? Changing it might require a substantial amount of work.

Aside of the PR #623 for the plugin based approach, is there any work done on this matter? I might try to help here.

ixje commented 5 years ago

I don't know if prompt_toolkit would be capable. I just know that urwid is, as that's what mitmproxy uses and we could peek a bit there how they solve issues. I really think their UI looks nice and a lot of windows they use could be applicable for here.

The thing that bothers me with prompt-toolkitis that their 2.x version has some "double enter" bug when trying to run it under PyCharm. So I can't debug the cli using my IDE anymore and they've given 0 response or directions when reaching out.

Aside of the PR #623 for the plugin based approach, is there any work done on this matter? I might try to help here.

The only related work that has been done is #623 as far as I know. That is on going in the sense that the framework is there and we're now porting old commands over. If you'd like to investigate if prompt-toolkit is capable I would be open to it