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

Develop CLI Style guide #12811

Open
klizhentas opened this issue May 22, 2022 · 8 comments
Open

Develop CLI Style guide #12811

klizhentas opened this issue May 22, 2022 · 8 comments
Assignees
Labels
cli Tickets related to CLI experience feature-request Used for new features in Teleport, improvements to current should be #enhancements ux

Comments

@klizhentas
Copy link
Contributor

Review Heroku CLI style guide and develop our own:

https://devcenter.heroku.com/articles/cli-style-guide

@klizhentas klizhentas added feature-request Used for new features in Teleport, improvements to current should be #enhancements ux time-to-value labels May 22, 2022
@zmb3
Copy link
Collaborator

zmb3 commented Jun 14, 2022

I would love to see some of the advice from https://seirdy.one/posts/2022/06/10/cli-best-practices/ incorporated.

@zmb3
Copy link
Collaborator

zmb3 commented Jul 20, 2022

Example of inconsistent use of --force flag: #1872

@zmb3 zmb3 added the cli Tickets related to CLI experience label Jul 20, 2022
@Tener
Copy link
Contributor

Tener commented Jul 22, 2022

I know this could be a large undertaking, but if we are looking into improving our CLI then I think considering the switch from kingpin to cobra is a worthwhile thing (https://github.com/spf13/cobra, https://cobra.dev/). I know things were different a few years back, but right now cobra sees much more activity: https://go.libhunt.com/compare-kingpin-vs-cobra.

Cobra generally looks more mature, better designed and more feature-rich (shell autocomplete, suggesting corrections on typos, ...).

@zmb3
Copy link
Collaborator

zmb3 commented Jul 22, 2022

Unlikely to happen as the tsh aliases work is being done on our fork of kingpin.

@Tener
Copy link
Contributor

Tener commented Jul 22, 2022

Unlikely to happen as the tsh aliases work is being done on our fork of kingpin.

I haven't tried it, but my gut feeling is that my tsh aliases PR wouldn't be substantially different with cobra: #13305. (By the way: the PR is ready for review, so feel free to try it out.)

That being said, cobra is not a drop-in replacement, so some issues will likely appear in one place or another.

@GavinFrazar
Copy link
Contributor

GavinFrazar commented Jan 10, 2023

@smallinsky do you mind if I work on this? I think our CLI really needs refinement. It's the major entry-point to setting up and using Teleport, yet we have a lot of inconsistencies and issues with it. The first step in cleaning it up should be establishing our own rules around CLI code style and UX as this feature-request suggests. Then we can work to move our CLI into compliance with those rules, and then setting up lints and tests to keep us in compliance with the rules so we don't drift away from them as other work is done.

I've come across many more issues while working on #19560 that make me think this should be prioritized.

edit: By "working on this" I mean to draft an RFD.

@zmb3
Copy link
Collaborator

zmb3 commented Jan 19, 2024

This should also include the use of colors, see #36929 for example.

@GavinFrazar
Copy link
Contributor

This should also include the use of colors, see #36929 for example.

good point, also mentioned by https://seirdy.one/posts/2022/06/10/cli-best-practices/

Excessive animation and color can harm users with attention and/or vestibular disorders, and some on the autism spectrum. Many tools offer a --color[=WHEN] flag where WHEN is always, never, or auto. Expecting users to learn all the color configurations for all their tools is unrealistic; tools should respect the NO_COLOR environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Tickets related to CLI experience feature-request Used for new features in Teleport, improvements to current should be #enhancements ux
Projects
None yet
Development

No branches or pull requests

6 participants