A command line interface (CLI) is a software mechanism you use to interact with your operating system using your keyboard. Another mechanism is a graphical UI (GUI), which is popular today with all applications and software systems. You can use a GUI to visually navigate and click on icons and images to make things work. However, a GUI is inefficient for system administration tasks, especially if the environment is virtual or remote. With a command line interface, you can enter text commands to configure, navigate, or run programs on any server or computer system. All operating systems — including Linux, macOS, and Windows—provide a CLI for faster system interaction.","sortDate":"2023-08-16","headlineUrl":"https://aws.amazon.com/what-is/cli/?trk=faq_card","id":"faq-hub#what-is-a-cli","category":"Developer Tools","primaryCTA":"https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?pg=what_is_header","headline":"What is a CLI (Command Line Interface)?"},"metadata":{"tags":[{"id":"GLOBAL#tech-category#devtools","name":"Developer Tools","namespaceId":"GLOBAL#tech-category","description":"Developer Tools","metadata":{}}]}}]},"metadata":{"auth":{},"testAttributes":{}},"context":{"page":{"pageUrl":"https://aws.amazon.com/what-is/cli/"},"environment":{"stage":"prod","region":"us-east-1"},"sdkVersion":"1.0.129"},"refMap":{"manifest.js":"289765ed09","what-is-header.js":"2e0d22c000","what-is-header.rtl.css":"ccf4035484","what-is-header.css":"ce47058367","what-is-header.css.js":"004a4704e8","what-is-header.rtl.css.js":"f687973e4f"},"settings":{"templateMappings":{"category":"category","headline":"headline","primaryCTA":"primaryCTA","primaryCTAText":"primaryCTAText","primaryBreadcrumbText":"primaryBreadcrumbText","primaryBreadcrumbURL":"primaryBreadcrumbURL"}}}

A command line interface (CLI) is a software mechanism you use to interact with your operating system using your keyboard. Another mechanism is a graphical UI (GUI), which is popular today with all applications and software systems. You can use a GUI to visually navigate and click on icons and images to make things work. However, a GUI is inefficient for system administration tasks, especially if the environment is virtual or remote. With a command line interface, you can enter text commands to configure, navigate, or run programs on any server or computer system. All operating systems—including Linux, macOS, and Windows—provide a CLI for faster system interaction.","id":"seo-faq-pairs#what-is-a-cli","customSort":"1"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#cli","name":"cli","namespaceId":"seo-faq-pairs#faq-collections","description":"

CLI","metadata":{}}]}},{"fields":{"faqQuestion":"What are the benefits of a CLI?","faqAnswer":"

A command line interface (CLI) offers several benefits. \n

Efficiency \n

Instead of spending time to find and click on individual files, you can use the CLI to perform actions on several files in one text command. If you are familiar with the commands, you can rapidly navigate and interact with your system. You can also create scripts that perform several commands in the CLI to automate monotonous or repetitive tasks. \n

Remote access \n

CLI applications often consume fewer network resources compared to graphical applications. This makes CLI applications suitable for systems with limited hardware capabilities or remote server environments. \n

You can manage servers remotely by submitting commands over a secure shell, even with low bandwidth connections. It’s a preferred method for managing servers and cloud instances, especially in headless environments where no graphical interface is available. \n

Troubleshooting \n

For developers and system administrators, using command line interfaces is a valuable skill that encourages a deeper understanding of the underlying system. It can make you more proficient with various tools and utilities and improve error management. \n

For instance, you can use a CLI to see system logs and quickly find comprehensive error messages and debugging information. The text-based commands can also be documented easily. This helps ensure tasks can be reproduced and makes it easier to troubleshoot steps in the future.","id":"seo-faq-pairs#what-are-the-benefits-of-a-cli","customSort":"2"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#cli","name":"cli","namespaceId":"seo-faq-pairs#faq-collections","description":"

CLI","metadata":{}}]}},{"fields":{"faqQuestion":"What are the use cases of a CLI?","faqAnswer":"

You can use a command line interface (CLI) in many use cases due to its versatility. For example, if you’re a system administrator, software engineer, data scientist, or technical user who wants more control, you can benefit from using the CLI. We give some examples next. \n

System administration \n

System administrators use CLIs to fix system-related issues, check the operating system configurations, and change or update configurations on remote machines. They can run commands and control systems at scale. \n

Software development \n

Software developers regularly use CLI tools to save time and streamline their workflows. For instance, they frequently access third-party libraries while working. If they add references to these libraries using a CLI, they can do so with one inserted command instead of leaving instructions to search for the library using the GUI. This approach saves time for both the developer and future users that interact with the system. \n

Cloud computing \n

In cloud environments, a CLI is essential for managing virtual machines, containers, cloud services, and server configurations. Developers and administrators use CLIs to interact with cloud providers' APIs, automate resource provisioning, and deploy applications. \n

Network management \n

Network administrators use CLIs to configure routers, switches, firewalls, and other networking devices. CLI tools help when you want to monitor network traffic, troubleshoot connectivity issues, and implement security policies. Penetration testers also use command line tools for vulnerability scanning, network reconnaissance, and incident analysis.","id":"seo-faq-pairs#what-are-the-use-cases-of-a-cli","customSort":"3"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#cli","name":"cli","namespaceId":"seo-faq-pairs#faq-collections","description":"

CLI","metadata":{}}]}},{"fields":{"faqQuestion":"How does a CLI work?","faqAnswer":"

A command line interface (CLI) is a text-based interface where you can input commands that interact with a computer’s operating system. The CLI operates with the help of the default shell, which is between the operating system and the user.  \n

CLI shell \n

A shell refers to a program that is an intermediary between the user and the operating system. Examples include Bash, cmd.exe, PowerShell, and others for more specific functions. \n

The shell is responsible for handling various tasks such as command parsing, environment management, and process execution. Shells also support features like these: \n