IndianOpenSourceFoundation / dynamic-cli

A Modern, user-friendly command-line HTTP client for the API testing, and if you're stuck - Search and browse StackOverflow without leaving the CLI
https://pypi.org/project/dynamic-cli/
GNU General Public License v3.0
169 stars 120 forks source link

autocomplete REPL #172

Open shivankar-p opened 2 years ago

shivankar-p commented 2 years ago

Related Issue

Closes: #[issue number that will be closed through this PR]

Describe the changes you've made

Checklist:

Screenshots

Original Updated
original screenshot Screenshot from 2022-03-14 00-13-33
sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

GouravSardana commented 2 years ago

Great work @shivankar-p . Appreciate it, but i have few concerns which will affect us in future: If we do autocomplete with this, problem is this is running a python file right? When you try to use the autocomplete, if you see it stuck at “>>> type you thing” , they can’t leverage terminal. One limitation is user can’t use the terminal for other purposes then there’ll be no sense for user to use our dynamic CLI. Think of this as an user while implementing. He/she has to exit the dynamic and use the terminal again. It’ll affect our User experience.

If we can avoid this stuck in the terminal then it would be better. If you see the xonsh, it made a custom terminal but didn’t stop us for using the terminal functionality. It’s on top of it. Xonsh+promptkit make it feel better. We are making terminal as a single point where our user can do everything starting from search to testing the API. So, I hope you understand the design which we were suppose to implement.

As of now don’t close the PR. I’ll review it in my local to see any improvement and will make a call. Meanwhile, if you can explore, can we achieve this thing by REPL?

shivankar-p commented 2 years ago

Great work @shivankar-p . Appreciate it, but i have few concerns which will affect us in future: If we do autocomplete with this, problem is this is running a python file right? When you try to use the autocomplete, if you see it stuck at “>>> type you thing” , they can’t leverage terminal. One limitation is user can’t use the terminal for other purposes then there’ll be no sense for user to use our dynamic CLI. Think of this as an user while implementing. He/she has to exit the dynamic and use the terminal again. It’ll affect our User experience.

If we can avoid this stuck in the terminal then it would be better. If you see the xonsh, it made a custom terminal but didn’t stop us for using the terminal functionality. It’s on top of it. Xonsh+promptkit make it feel better. We are making terminal as a single point where our user can do everything starting from search to testing the API. So, I hope you understand the design which we were suppose to implement.

As of now don’t close the PR. I’ll review it in my local to see any improvement and will make a call. Meanwhile, if you can explore, can we achieve this thing by REPL?

This is what I meant by REPL(read evaluate print loop). Basically running an infinite loop and taking inputs unless user wants to exit. Something similar to python3 REPL which we get by entering python3 command in the linux terminal.

lainq commented 2 years ago

Great work @shivankar-p . Appreciate it, but i have few concerns which will affect us in future: If we do autocomplete with this, problem is this is running a python file right? When you try to use the autocomplete, if you see it stuck at “>>> type you thing” , they can’t leverage terminal. One limitation is user can’t use the terminal for other purposes then there’ll be no sense for user to use our dynamic CLI. Think of this as an user while implementing. He/she has to exit the dynamic and use the terminal again. It’ll affect our User experience.

If we can avoid this stuck in the terminal then it would be better. If you see the xonsh, it made a custom terminal but didn’t stop us for using the terminal functionality. It’s on top of it. Xonsh+promptkit make it feel better. We are making terminal as a single point where our user can do everything starting from search to testing the API. So, I hope you understand the design which we were suppose to implement.

As of now don’t close the PR. I’ll review it in my local to see any improvement and will make a call. Meanwhile, if you can explore, can we achieve this thing by REPL?

I thought about this and I think a REPL is the only solution in which we can implement autocomplete. Because, we have control only over the repl, the other auto completion is controlled by the shell.

GouravSardana commented 2 years ago

No, REPL is not the only solution. If you see gitsome, those guys were using xonsh as a primary terminal for the customisation and did autocomplete as well.

Try installing gitsome and you can see the difference

lainq commented 2 years ago

No, REPL is not the only solution. If you see gitsome, those guys were using xonsh as a primary terminal for the customisation and did autocomplete as well.

Try installing gitsome and you can see the difference

Oh, let me take a look

GouravSardana commented 2 years ago

cc @shivankar-p