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

CLI Help template #58

Closed
ksokolic opened this issue Oct 20, 2021 · 3 comments
Closed

CLI Help template #58

ksokolic opened this issue Oct 20, 2021 · 3 comments
Assignees
Labels
CLI communication Feature area: improvement in the CLI communication to the users enhancement New feature or request

Comments

@ksokolic
Copy link
Contributor

ksokolic commented Oct 20, 2021

Currently, we are using cobra's automatic output for help. It provides all needed information but not in the most fashionable way.

Inspired by GitHub help we should introduce our own template that provide better usability:

  • description
  • USAGE
  • COMMANDS
  • ARGUMENTS
  • FLAGS
  • EXAMPLES
  • GLOBAL FLAGS
  • LEARN MORE

Example for mantil aws help

ksenijakordisokolic@Florence Work % mantil aws --help
AWS account subcommand

USAGE
mantil aws [command]

COMMANDS
install       Install Mantil into AWS account.
uninstall     Uninstall Mantil from AWS account.

GLOBAL FLAGS
--help       Show command help.
--no-color   Don't use colors in output.

LEARN MORE
Visit https://docs.mantil.io to learn more.
For further support contact us at [email protected]. 

Example for mantil was install help

ksenijakordisokolic@Florence Work % mantil aws install --help
Install Mantil into AWS account

USAGE
mantil aws install [account-name] [flags]

ARGUMENTS
Argument account-name is for referencing that account in Mantil.
If not provided default name dev will be used for the first account.

FLAGS
--aws-access-key-id string       Access key ID for the AWS account, must be used with the aws-secret-access-key and aws-region flags.
--aws-env                        Use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION environment variables for AWS authentication.
--aws-profile string             Use the given profile for AWS authentication.
--aws-region string              Region for the AWS account, must be used with and aws-access-key-id and aws-secret-access-key flags.
--aws-secret-access-key string   Secret access key for the AWS account, must be used with the aws-access-key-id and aws-region flags.
--dry-run                        Don't start install/uninstall just show what credentials will be used.
--override                       Force override access tokens on already installed account.

EXAMPLES
You must provide credentials for Mantil to access your AWS account.
There are three ways to provide credentials.

$ mantil aws install --aws-access-key-id=AKIAIOSFODNN7EXAMPLE --aws-secret-access-key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY —aws-region=us-east-1
=> Specifies access keys as arguments.

$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$ export AWS_DEFAULT_REGION=us-east-1
$ mantil aws install --aws-env
=> Reads access keys from environment variables. Reference: [https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html).

$ mantil aws install —aws-profile=my-named-profile
=> Uses your named AWS profile from ~/.aws/config. Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

GLOBAL FLAGS
--help       Show command help.
--no-color   Don't use colors in output.

LEARN MORE
Visit https://docs.mantil.io to learn more.
For further support contact us at [email protected]. 

Examples of other help pages and description is available in Notion.

@ksokolic ksokolic added idea Seems to be useful enhancement New feature or request and removed idea Seems to be useful labels Oct 20, 2021
@ianic ianic added this to the single developer milestone Oct 25, 2021
@ianic
Copy link
Member

ianic commented Oct 25, 2021

Nesto smo napravili.

@ianic ianic added CLI communication Feature area: improvement in the CLI communication to the users and removed enhancement New feature or request labels Oct 27, 2021
@ksokolic ksokolic added the enhancement New feature or request label Nov 2, 2021
@ksokolic
Copy link
Contributor Author

ksokolic commented Nov 3, 2021

@djelusic if doable there are few details we should adjust in Help template:

  • Change naming FLAGS to OPTIONS
  • Change naming AVAILABLE COMMANDS to COMMANDS
  • Always start with upper first letter and end with dot (even when explaining options)
  • Make links clickable
  • Add one space at the end of Help
  • Change documentation link to https://help.mantil.com

@djelusic
Copy link
Contributor

djelusic commented Nov 5, 2021

Always start with upper first letter and end with dot (even when explaining options)

As discussed we won't end descriptions with a period to stay consistent with the default cobra commands (help and completions). They will also fix some incosistencies in a future release:
spf13/cobra#1458

Make links clickable

This is handled by the terminal, usually if the output contains a well-formed link you can cmd+click it.

Everything else is implemented and will be available in the next release.

@djelusic djelusic self-assigned this Nov 8, 2021
@djelusic djelusic closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI communication Feature area: improvement in the CLI communication to the users enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants