These guidelines intend to provide UX guidelines for Conjur's new Python CLI, focusing on a consistent structure and a more user-friendly interface.
-
The tool’s executable name should be “conjur” (regardless of its supported platform), so “conjur-py3-cli-darwin” is not a good experience.
-
If the CLI tool is executed without any commands, we should show the full help screen.
-
Make sure to provide short-form (e.g. -h) and long-form (--help) for each option.
-
Provide helpful and readable feedback when a command succeeds and doesn’t have an output. It should end in a new line and show a feedback message. E.g.,
Success! Data written to: <target>
-
Provide helpful and readable errors (we currently show exception and line number). A typical error message would be:
Error: Command failed. No such file or directory: ‘/Users/sharonr/.conjurrc’
(need to consider if we need to show an error log number). -
When a command is executed with missing parts (subcommand, argument), unfamiliar syntax and so on, show the relevant error along with the command's help below that. Note: a list of various error scenarios is provided in a separate file. Example of an unknown command:
Error: Unknown command 'test' <Main help screen>
-
Exit codes: commands with no errors will return exit code 0, while errors will return exit code 1.
-
Keep a structured syntax and easy to type, so it will be efficient to use. The general structure would be:
conjur [global options] command subcommand [options] [arguments...]
- Example of a compound command:
conjur user update-password
- Example of multiple arguments:
conjur variable get secrets/secret1 secrets/secret2
- Example of an argument with spaces: `conjur variable get "secrets/secret two"
- Example of a compound command:
-
Help command structure:
- CLI header (title and short explanation)
- Copyright
- Usage: title + explanation
- Global options: title + list of options and their explanation
- Commands: title + list of commands and their explanation
- Footer: To get help on a specific command, type: conjur command -h
Note: The general help screen and the help for each command can be found in this mockup.
-
Use terminal colors – We can add colors for command and subcommands to better differentiate them. See reference.
-
We should support tab-completion:
- Typing the first few characters of the command name followed by
<tab> <tab>
, will auto-complete the command. - Hit space after a command, then
<tab> <tab>
again, will shows a list of available sub-commands
- Typing the first few characters of the command name followed by