Skip to content
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

Interactive CLI with tab-completion possible? #2406

Closed
kusibornhauser opened this issue Jul 19, 2022 · 3 comments
Closed

Interactive CLI with tab-completion possible? #2406

kusibornhauser opened this issue Jul 19, 2022 · 3 comments

Comments

@kusibornhauser
Copy link

Hi

I really love Rich ❤️. I want to create an interactive CLI application (I don't know if that's the correct term), much like a CLI on a Cisco network device or similar. The Python Cmd2 project is pretty much what I mean - but I want to use rich because it's really beautiful.

Is it possible to create such CLI applications with rich? So that I have a command prompt, and can use tab completion to complete known commands? If so are there examples I can check?

Many thanks!

@willmcgugan
Copy link
Collaborator

Rich doesn't do this. But you can use cmd2 to handle the prompt and write any output with Rich.

@kotfu
Copy link
Contributor

kotfu commented Feb 1, 2023

@kusibornhauser: I'm one of the maintainers of https://github.com/python-cmd2/cmd2. We have an open issue to investigate how we might make cmd2 more friendly to use with rich. I've done some preliminary work on the rich branch of tomcatmanager to see what it would be like to have an application that used both cmd2 and rich. So far, all the basics work fine with no changes to cmd2 required.

If you have specific items you are interested in having better support/integration for beyond the tab completion you mentioned above, please feel free to join the discussion on python-cmd2/cmd2#1251.

Copy link

github-actions bot commented Jul 2, 2024

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

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

No branches or pull requests

3 participants