Command-Line Interface
Subject: Computer and Technology noun /kəˈmænd ˌlaɪn ˈɪn.tər.feɪs/ 1 definition
- user-interfaces
- operating-systems
- developer-tools
- system-administration
-
Definition (noun)
Entry #120 · UpdatedA Command-Line Interface (CLI) is a text-based user interface that allows users to control an operating system or software application by entering sequential lines of textual commands. Instead of manipulating visual menus and icons with a pointing device as in a graphical user interface (GUI), a user supplies an instruction alongside positional arguments and option flags, which a shell or application parser interprets to execute operations and return textual output and status codes. Because both instructions and results are represented as plain text streams that can be piped, redirected, and recorded in scripts over lightweight connections, a CLI offers repeatable automation, composability, and low-overhead control across local and remote systems.
Common Types
Operating System Shells: General-purpose command interpreters—such as Bash, Zsh, and PowerShell—that navigate file systems, launch processes, evaluate scripts, and connect programs using standard input, output, and error streams.
Application and Subcommand CLIs: Standalone executable tools like
git,docker, andkubectlthat organize capabilities into hierarchical subcommands paired with positional parameters, option flags (such as-for--format), and numeric exit codes.Interactive REPLs and Consoles: Stateful Read-Eval-Print Loop environments—including the Python interactive shell,
psql, and network switch consoles—that evaluate each entered command or expression immediately and return inline output.Prompt-Driven CLIs: Guided terminal interfaces—such as
npm initor cloud provisioning wizards—that collect and validate input interactively with defaults and selection prompts while still supporting flags for unattended execution.
Example
To diagnose recent production errors on a remote Linux server, an engineer connects over SSH and enters
journalctl -u api.service --since "1 hour ago" | grep -i timeoutin a Bash shell. The shell parses the pipeline and passes the arguments to each utility, streaming matching log lines to standard output so the command can be inspected immediately, redirected to a file, or reused in an automated monitoring script.