Practice CLI tool vocabulary: subcommands, positional arguments vs flags, --help flag, bash completion, distribution channels, and idiomatic CLI design language.
0 / 5 completed
1 / 5
In 'git commit -m "message"', 'commit' is a ___ and '-m' is a ___.
'commit' is a subcommand (a named action within the parent 'git' command). '-m' is a flag (also called an option) that takes a value. Well-designed CLIs use subcommands to group related operations and flags to modify their behaviour.
2 / 5
What is the difference between a 'positional argument' and a 'flag' in a CLI?
Positional arguments rely on position for meaning (the first unnamed value is 'source', the second is 'dest'). Flags are explicitly named and can appear in any order. Good CLIs prefer flags for clarity when there are many parameters.
3 / 5
Why is implementing '--help' on every command and subcommand considered idiomatic CLI design?
A self-describing CLI — where every command and subcommand responds to '--help' with usage, options, and examples — reduces the need for external docs and makes the tool immediately productive for new users.
4 / 5
What is 'bash completion' (or shell completion) in the context of a CLI tool?
Shell completion lets users press Tab to autocomplete subcommands, flag names, and argument values. It is a key ergonomic feature: well-designed CLIs ship a completion script for bash, zsh, and fish.
5 / 5
A CLI tool README states 'the tool is distributed via ___.' Which distribution channel is most common for Node.js-based CLI tools?
npm (Node Package Manager) is the primary distribution channel for Node.js CLI tools: 'npm install -g my-tool' installs it globally. Homebrew (brew) is common for macOS tools. apt is the Debian/Ubuntu package manager, typically for system-level tools.