The command-line interface (CLI) and graphical user interface (GUI) are two different ways for users to interact with an operating system. The key difference between the CLI and GUI is that the interaction with CLI is based on issuing commands. In contrast, the interaction with a GUI involves visual elements, such as windows, buttons, etc.
Both interface types have advantages and disadvantages, but their purpose is the same.