CLI

From Merrymake
Jump to navigation Jump to search

We at Merrymake have spent a lot of effort making the CLI as easy to use as possible, therefore it is different from usual CLI's in a few important areas:

Fewer clicks[edit | edit source]

We work to keep down the number of clicks needed to complete a task. Therefore, the CLI never presents a single option to the user, but simply auto selects it. This means that commands that offer 'edit or add' will go straight to 'add' the first time, since there is nothing to edit.

Context sensitivity[edit | edit source]

The Merrymake-CLI looks at which folder we are in, and presents only options relevant to that context. For example we cannot create an organization inside another organization. If you are missing an option, verify that you are in the correct folder to perform that action.

Preselecting options[edit | edit source]

Every option in the CLI has a unique word, highlighted with yellow. This name can be used as a commandline argument to preselect that option skipping the choice. In the example from earlier, mm quickstart presented a choice of languages, if we were to call it again we can skip this choice by adding the language as a commandline argument:

mm start my-organization

For text prompts we can preselect the default options by using underscore (_) as the commandline argument. The CLI also prints the full command to get to this current state directly.

Shorthand preselection[edit | edit source]

Most options in the CLI also have brackets with a character inside it, this character can be used as a shorthand when preselecting this option, by prefixing it with a dash (-). Using shorthand looks like this:

mm envvar -n

It is possible to chain shorthands, combining -b -t into -bt. Note that not all options have a shorthand version, such as the command start itself.

Help for text input[edit | edit source]

When you are asked to type in text you can press escape to display a help-text. For example:

mm start

Dryrun[edit | edit source]

The final CLI feature we want to mention is the dryrun mode. This mode lets us navigate through the CLI without making changes to our project, which is very helpful when building commands to use as part some automation, or if we're just curious about what lies behind an option. ;-)

mm dryrun org