Practice CLI tool vocabulary: subcommands, positional arguments vs flags, --help flag, bash completion, distribution channels, and idiomatic CLI design language.
0 / 25 completed
1 / 25
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 / 25
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 / 25
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 / 25
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 / 25
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.
6 / 25
Sarah: 'I'm trying to debug this failing deployment. The logs show a `kubectl scale deployment myapp --replicas=3` command didn't complete successfully. It just returns an error message saying 'command not found.' I checked the server, and `kubectl` is definitely installed and working correctly for other commands.'
What's the most likely reason Mark's command failed, given his description?
A) The Kubernetes cluster has been experiencing network instability. B) Mark didn't have sufficient permissions to execute `kubectl` on that specific node. C) The `kubectl` executable itself is corrupted or not in the system's PATH. D) The command was executed with a typo – the deployment name, 'myapp', contains an invalid character.
The core issue here isn't network instability or permissions (although those could be factors). It's most likely that `kubectl` wasn't found by the shell. The error 'command not found' strongly suggests that the directory containing the `kubectl` executable is either missing from the system's PATH environment variable, or there was a typo in the command itself. Option B is possible but less probable given the specific error message; option D highlights a common mistake but isn't the primary cause of 'command not found' without further investigation.
7 / 25
John: 'I'm reviewing this PR. The developer used `jq` to filter the API response and then piped the output into a shell script. It's working locally, but I'm concerned about performance with large datasets. Can you explain why they might have chosen that approach?'
John is raising a valid concern about performance. While jq *is* generally very efficient at JSON filtering, piping the output into a shell script introduces additional overhead due to process creation and command execution. The developer likely prioritized conciseness in their solution rather than rigorously optimizing for maximum throughput – this is a common trade-off developers make when quickly prototyping or demonstrating functionality. Therefore, option 2 accurately reflects the situation.
8 / 25
David: 'Hey team, I'm trying to automate the deployment of our new microservice. I've built a CLI tool that uses docker compose up to start it. When I run it from my local machine, everything works perfectly. However, when I try to deploy it through Jenkins, it fails with an error saying 'command not found.' I've checked the Jenkins server and confirmed that Docker Compose is installed and accessible via the PATH.
Which of the following best explains this discrepancy?
This scenario highlights a common issue when deploying CLI tools – differences in environment configuration between development and production environments. The PATH variable dictates where the system looks for executables. Jenkins, as a separate server, will likely have a different PATH than your local machine, preventing it from finding the `docker compose` command even if it's installed and accessible through the path on the server itself. Option A is possible but less direct; options C and D represent other potential issues that are not directly related to the core problem of a misconfigured PATH.
9 / 25
During a code review, Liam comments: 'This script uses `grep` to search for specific log messages. It's fine for small logs, but we should consider using `awk` or `sed` for larger ones as they are generally more efficient.' What is the primary reason Liam suggests switching from `grep` in this scenario?
Liam correctly identifies that `awk` and `sed` are generally more optimized for large-scale text processing than `grep`. While `grep` can handle larger files, its performance degrades significantly as the input size increases due to its algorithm. The other options present misconceptions – `grep` doesn't inherently have poor error handling compared to other tools, and syntax complexity isn't a primary reason for choosing one tool over another in this context. Choosing the right tool based on efficiency is key.
10 / 25
During a code review of a new CLI tool designed for monitoring server health, Alice remarks to Ben: 'I noticed you're using `curl` to fetch metrics from the API. While it works, wouldn't we gain better performance and potentially more control by utilizing a dedicated HTTP client like `httpie` or `wget`?' What is the *most* significant factor driving Alice's suggestion?
Alice's suggestion highlights the importance of choosing the right tool for the job. While curl is a common tool, it lacks features like advanced header manipulation and fine-grained control over HTTP requests that tools like httpie or wget provide. This allows for optimized performance and more robust API interactions – key considerations when dealing with external APIs. The other options represent misconceptions about curl's capabilities or its universal adoption.
11 / 25
Sarah: 'I'm trying to debug this failing deployment. The logs show a `kubectl scale deployment myapp --replicas=3` command didn't complete successfully. It just returns an error message saying 'command not found.' I checked the server, and `kubectl` is definitely installed and working correctly for other commands.'
What's the most likely reason Mark's command failed, given his description?
A) The Kubernetes cluster has been experiencing network instability. B) Mark didn't have sufficient permissions to execute `kubectl` on that specific node. C) The `kubectl` executable itself is corrupted or not in the system's PATH. D) The command was executed with a typo – the deployment name, 'myapp', contains an invalid character.
The core issue here isn't network instability or permissions (although those could be factors). It's most likely that `kubectl` wasn't found by the shell. The error 'command not found' strongly suggests that the directory containing the `kubectl` executable is either missing from the system's PATH environment variable, or there was a typo in the command itself. Option B is possible but less probable given the specific error message; option D highlights a common mistake but isn't the primary cause of 'command not found' without further investigation.
12 / 25
John: 'I'm reviewing this PR. The developer used `jq` to filter the API response and then piped the output into a shell script. It's working locally, but I'm concerned about performance with large datasets. Can you explain why they might have chosen that approach?'
John is raising a valid concern about performance. While jq *is* generally very efficient at JSON filtering, piping the output into a shell script introduces additional overhead due to process creation and command execution. The developer likely prioritized conciseness in their solution rather than rigorously optimizing for maximum throughput – this is a common trade-off developers make when quickly prototyping or demonstrating functionality. Therefore, option 2 accurately reflects the situation.
13 / 25
David: 'Hey team, I'm trying to automate the deployment of our new microservice. I've built a CLI tool that uses docker compose up to start it. When I run it from my local machine, everything works perfectly. However, when I try to deploy it through Jenkins, it fails with an error saying 'command not found.' I've checked the Jenkins server and confirmed that Docker Compose is installed and accessible via the PATH.
Which of the following best explains this discrepancy?
This scenario highlights a common issue when deploying CLI tools – differences in environment configuration between development and production environments. The PATH variable dictates where the system looks for executables. Jenkins, as a separate server, will likely have a different PATH than your local machine, preventing it from finding the `docker compose` command even if it's installed and accessible through the path on the server itself. Option A is possible but less direct; options C and D represent other potential issues that are not directly related to the core problem of a misconfigured PATH.
14 / 25
During a code review, Liam comments: 'This script uses `grep` to search for specific log messages. It's fine for small logs, but we should consider using `awk` or `sed` for larger ones as they are generally more efficient.' What is the primary reason Liam suggests switching from `grep` in this scenario?
Liam correctly identifies that `awk` and `sed` are generally more optimized for large-scale text processing than `grep`. While `grep` can handle larger files, its performance degrades significantly as the input size increases due to its algorithm. The other options present misconceptions – `grep` doesn't inherently have poor error handling compared to other tools, and syntax complexity isn't a primary reason for choosing one tool over another in this context. Choosing the right tool based on efficiency is key.
15 / 25
During a code review of a new CLI tool designed for monitoring server health, Alice remarks to Ben: 'I noticed you're using `curl` to fetch metrics from the API. While it works, wouldn't we gain better performance and potentially more control by utilizing a dedicated HTTP client like `httpie` or `wget`?' What is the *most* significant factor driving Alice's suggestion?
Alice's suggestion highlights the importance of choosing the right tool for the job. While curl is a common tool, it lacks features like advanced header manipulation and fine-grained control over HTTP requests that tools like httpie or wget provide. This allows for optimized performance and more robust API interactions – key considerations when dealing with external APIs. The other options represent misconceptions about curl's capabilities or its universal adoption.
16 / 25
Sarah: 'I'm trying to debug this failing deployment. The logs show a `kubectl scale deployment myapp --replicas=3` command didn't complete successfully. It just returns an error message saying 'command not found.' I checked the server, and `kubectl` is definitely installed and working correctly for other commands.'
What's the most likely reason Mark's command failed, given his description?
A) The Kubernetes cluster has been experiencing network instability. B) Mark didn't have sufficient permissions to execute `kubectl` on that specific node. C) The `kubectl` executable itself is corrupted or not in the system's PATH. D) The command was executed with a typo – the deployment name, 'myapp', contains an invalid character.
The core issue here isn't network instability or permissions (although those could be factors). It's most likely that `kubectl` wasn't found by the shell. The error 'command not found' strongly suggests that the directory containing the `kubectl` executable is either missing from the system's PATH environment variable, or there was a typo in the command itself. Option B is possible but less probable given the specific error message; option D highlights a common mistake but isn't the primary cause of 'command not found' without further investigation.
17 / 25
John: 'I'm reviewing this PR. The developer used `jq` to filter the API response and then piped the output into a shell script. It's working locally, but I'm concerned about performance with large datasets. Can you explain why they might have chosen that approach?'
John is raising a valid concern about performance. While jq *is* generally very efficient at JSON filtering, piping the output into a shell script introduces additional overhead due to process creation and command execution. The developer likely prioritized conciseness in their solution rather than rigorously optimizing for maximum throughput – this is a common trade-off developers make when quickly prototyping or demonstrating functionality. Therefore, option 2 accurately reflects the situation.
18 / 25
David: 'Hey team, I'm trying to automate the deployment of our new microservice. I've built a CLI tool that uses docker compose up to start it. When I run it from my local machine, everything works perfectly. However, when I try to deploy it through Jenkins, it fails with an error saying 'command not found.' I've checked the Jenkins server and confirmed that Docker Compose is installed and accessible via the PATH.
Which of the following best explains this discrepancy?
This scenario highlights a common issue when deploying CLI tools – differences in environment configuration between development and production environments. The PATH variable dictates where the system looks for executables. Jenkins, as a separate server, will likely have a different PATH than your local machine, preventing it from finding the `docker compose` command even if it's installed and accessible through the path on the server itself. Option A is possible but less direct; options C and D represent other potential issues that are not directly related to the core problem of a misconfigured PATH.
19 / 25
During a code review, Liam comments: 'This script uses `grep` to search for specific log messages. It's fine for small logs, but we should consider using `awk` or `sed` for larger ones as they are generally more efficient.' What is the primary reason Liam suggests switching from `grep` in this scenario?
Liam correctly identifies that `awk` and `sed` are generally more optimized for large-scale text processing than `grep`. While `grep` can handle larger files, its performance degrades significantly as the input size increases due to its algorithm. The other options present misconceptions – `grep` doesn't inherently have poor error handling compared to other tools, and syntax complexity isn't a primary reason for choosing one tool over another in this context. Choosing the right tool based on efficiency is key.
20 / 25
During a code review of a new CLI tool designed for monitoring server health, Alice remarks to Ben: 'I noticed you're using `curl` to fetch metrics from the API. While it works, wouldn't we gain better performance and potentially more control by utilizing a dedicated HTTP client like `httpie` or `wget`?' What is the *most* significant factor driving Alice's suggestion?
Alice's suggestion highlights the importance of choosing the right tool for the job. While curl is a common tool, it lacks features like advanced header manipulation and fine-grained control over HTTP requests that tools like httpie or wget provide. This allows for optimized performance and more robust API interactions – key considerations when dealing with external APIs. The other options represent misconceptions about curl's capabilities or its universal adoption.
21 / 25
Sarah: 'I'm trying to debug this failing deployment. The logs show a `kubectl scale deployment myapp --replicas=3` command didn't complete successfully. It just returns an error message saying 'command not found.' I checked the server, and `kubectl` is definitely installed and working correctly for other commands.'
What's the most likely reason Mark's command failed, given his description?
A) The Kubernetes cluster has been experiencing network instability. B) Mark didn't have sufficient permissions to execute `kubectl` on that specific node. C) The `kubectl` executable itself is corrupted or not in the system's PATH. D) The command was executed with a typo – the deployment name, 'myapp', contains an invalid character.
The core issue here isn't network instability or permissions (although those could be factors). It's most likely that `kubectl` wasn't found by the shell. The error 'command not found' strongly suggests that the directory containing the `kubectl` executable is either missing from the system's PATH environment variable, or there was a typo in the command itself. Option B is possible but less probable given the specific error message; option D highlights a common mistake but isn't the primary cause of 'command not found' without further investigation.
22 / 25
John: 'I'm reviewing this PR. The developer used `jq` to filter the API response and then piped the output into a shell script. It's working locally, but I'm concerned about performance with large datasets. Can you explain why they might have chosen that approach?'
John is raising a valid concern about performance. While jq *is* generally very efficient at JSON filtering, piping the output into a shell script introduces additional overhead due to process creation and command execution. The developer likely prioritized conciseness in their solution rather than rigorously optimizing for maximum throughput – this is a common trade-off developers make when quickly prototyping or demonstrating functionality. Therefore, option 2 accurately reflects the situation.
23 / 25
David: 'Hey team, I'm trying to automate the deployment of our new microservice. I've built a CLI tool that uses docker compose up to start it. When I run it from my local machine, everything works perfectly. However, when I try to deploy it through Jenkins, it fails with an error saying 'command not found.' I've checked the Jenkins server and confirmed that Docker Compose is installed and accessible via the PATH.
Which of the following best explains this discrepancy?
This scenario highlights a common issue when deploying CLI tools – differences in environment configuration between development and production environments. The PATH variable dictates where the system looks for executables. Jenkins, as a separate server, will likely have a different PATH than your local machine, preventing it from finding the `docker compose` command even if it's installed and accessible through the path on the server itself. Option A is possible but less direct; options C and D represent other potential issues that are not directly related to the core problem of a misconfigured PATH.
24 / 25
During a code review, Liam comments: 'This script uses `grep` to search for specific log messages. It's fine for small logs, but we should consider using `awk` or `sed` for larger ones as they are generally more efficient.' What is the primary reason Liam suggests switching from `grep` in this scenario?
Liam correctly identifies that `awk` and `sed` are generally more optimized for large-scale text processing than `grep`. While `grep` can handle larger files, its performance degrades significantly as the input size increases due to its algorithm. The other options present misconceptions – `grep` doesn't inherently have poor error handling compared to other tools, and syntax complexity isn't a primary reason for choosing one tool over another in this context. Choosing the right tool based on efficiency is key.
25 / 25
During a code review of a new CLI tool designed for monitoring server health, Alice remarks to Ben: 'I noticed you're using `curl` to fetch metrics from the API. While it works, wouldn't we gain better performance and potentially more control by utilizing a dedicated HTTP client like `httpie` or `wget`?' What is the *most* significant factor driving Alice's suggestion?
Alice's suggestion highlights the importance of choosing the right tool for the job. While curl is a common tool, it lacks features like advanced header manipulation and fine-grained control over HTTP requests that tools like httpie or wget provide. This allows for optimized performance and more robust API interactions – key considerations when dealing with external APIs. The other options represent misconceptions about curl's capabilities or its universal adoption.
What does the "CLI Tool Vocabulary" exercise cover?
Practice CLI tool vocabulary: subcommands, positional arguments vs flags, --help flag, bash completion, distribution channels, and idiomatic CLI design language.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
How many questions are in "CLI Tool Vocabulary"?
This exercise has 25 questions. Each one gives instant feedback with an explanation, so you can see exactly why an answer is right or wrong.
Do I need to create an account to save my progress?
No account is required. The progress bar and score are tracked in your browser for the current session -- the exercise is designed to be a quick, repeatable drill rather than something you resume later.
What happens if I get an answer wrong?
You'll see the correct answer highlighted immediately, along with a short explanation of why it's correct. Wrong answers aren't penalized beyond your score, and you can keep going through every question.
How is this exercise different from reading an article?
Articles explain vocabulary and concepts through prose, while exercises like this one are interactive drills -- multiple-choice questions -- that test and reinforce your recall of specific terms and phrasing.
Can I retry this exercise?
Yes -- use the "Try again" button on the results screen to reset your score and go through all the questions again from the start.
Where can I find more Developer Tools Engineering exercises?
Browse the full Developer Tools Engineering hub for related drills, or check the site-wide exercises index for other IT English topics.
Is this exercise suitable for beginners?
This exercise assumes basic familiarity with IT terminology. If a term feels unfamiliar, check the site Glossary for a plain-English definition before attempting the questions.
How often is new content like this published?
New exercises are added regularly across all categories, alongside new vocabulary sets and articles. Check back on the exercises hub to see what's new.