Command Line Interface

Command Line Interface(CLI) is a text-based interface that is used to operate software and operating systems while allowing the user to respond to visual prompts by typing simple commands into the interface and receiving a reply in the same way. CLI is quite different from the Graphical User Interface(GUI) that is presently being used in the latest operating systems.

We also call it Terminal in Mac OS or Command Prompt in Windows operating system.

  • In Linux Or Mac we call it Native CLI Terminal.
  • In Windows we call it Native CLI CMD(Command Prompt).

What role does CLI play in Cordova?

  • Cordova is totally dependent on CLI, so without it we can't execute a single process.
  • It is used,
    1. To create a cordova project.
    2. To add platform for which we want to develop app.
    3. To add plugins.
    4. To generate APK.

For these listed tasks, we have to pass command line arguments.


How to open CMD in Windows OS?

  1. Search cmd in the Menu search bar by typing cmd or command prompt, then click on the Command Prompt App option in search results.

    Command Line Interface in Windows


  2. We can also press Ctrl + R to open RUN dialog box, and type in cmd to open Command Prompt.

    Command Line Interface in Windows


  3. It will open a black colored screen, this is the command prompt. Step 1 will open cmd in normal mode.

    Command Line Interface in Windows


  4. To open command prompt in administrator mode, search cmd in searchbar and click right button of mouse and choose option Run as administrator.

    Command Line Interface in Windows

Following are some useful commands, used in day-to-day work:

  • cls → Clear the Command Prompt screen
  • cd [directory_path] → To go to any directory
  • cd .. → To come out of any directory, to its immediate parent directory.
  • mkdir [directory_name] → This command is used to create any directory.
  • ipconfig → To get information about your IP address and DNS related info.

Opening Terminal in Mac OS

  1. Press Command + Space to open Spotlight Search, and type terminal in the search field.

    Terminal in Mac OSx

  2. And click on the Terminal - Utilities option to open the Terminal.

    Terminal in Mac OSx