Skip to content

✨ Implement Bubbletea for Interactive CLI Prompts #4720

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

p-shah256
Copy link
Contributor

Description

This PR implements Bubbletea for interactive command-line prompts in the create API command, improving the UX by providing a more modern and engaging interface. The implementation focuses on the interactive aspects of Kubebuilder's CLI, specifically for prompting users about creating resources and controllers.

Motivation

Enhance the developer experience by providing more intuitive and visually appealing CLI interactions. Bubbletea offers improved interactive capabilities that make Kubebuilder's workflow more user-friendly while maintaining functionality.

Implementation

  • Added Bubbletea for interactive prompts in create API command
  • Implemented styled yes/no prompts for "Create Resource" and "Create Controller" questions
  • Maintained the existing behavior while enhancing the visual presentation

Note on Logrus replacement: While Bubbletea excels at interactive TUI elements, it's not primarily designed for logging functionality. I've focused on the interactive aspects first and would appreciate guidance on the preferred approach for handling the logging components (whether to use slog another dedicated logging library, or a hybrid approach).

Fixes #4523

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 31, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: p-shah256
Once this PR has been reviewed and has the lgtm label, please assign kavinjsir for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Hi @p-shah256. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 31, 2025
@p-shah256
Copy link
Contributor Author

p-shah256 commented Mar 31, 2025

TUI in action

TUI_kub

Curious what you think about handling the logging part - should we stick with a dedicated logging lib alongside Bubbletea, or try something else? Thanks!

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 🎉
This PR allow us to analise it !!!
Great. we will need some time to see if we move forward with the change or not.

I am adding a

/hold

Just to give more time for we properly analyse it and discuss the pros and cons

@camilamacedo86 camilamacedo86 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 31, 2025
@camilamacedo86 camilamacedo86 changed the title ✨ feat: Implement Bubbletea for Interactive CLI Prompts 🌱 Implement Bubbletea for Interactive CLI Prompts Apr 8, 2025
@camilamacedo86 camilamacedo86 changed the title 🌱 Implement Bubbletea for Interactive CLI Prompts ✨ Implement Bubbletea for Interactive CLI Prompts Apr 8, 2025
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @p-shah256,

Hope you're doing well!

I noticed we also have INFO and WARM outputs—do you think it would make sense to use bubbletea with those as well? Just wondering if that could improve consistency or clarity.

If possible, could you maybe add a small example showing how it might look in one of those cases? That would help us better understand how it fits.

Also, for the help command—do you think we should update that to use bubbletea too?

Thanks a lot for your work on this!

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Exploratory) Evaluating bubbletea as a Replacement for logrus
3 participants