Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Create a more interactive and clean CLI #624

Open
ixje opened this issue Sep 20, 2018 · 2 comments
Open

Create a more interactive and clean CLI #624

ixje opened this issue Sep 20, 2018 · 2 comments

Comments

@ixje
Copy link
Member

ixje commented Sep 20, 2018

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:

  • Allow for interactive block / transaction inspection.
  • A minimal example of how that could look can be see here
  • Work on all platforms (Windows/Linux/OSX). The Windows requirement can be the usage of Cygwin or a proper capable terminal.
  • Separate log messages from command and block history (e.g. see how mitxproxy has a splitpane capability)
  • Have plugin based command support (see the related issue: Refactor prompt commands to be plugin based)
@dethos
Copy link
Contributor

dethos commented Dec 2, 2018

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
Copy link
Member Author

ixje commented Dec 3, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants