What exactly is a CLI?

8

From what I've noticed, there are several CLIs. Example:

  • Ionic CLI
  • Angular CLI
  • Cordova CLI

But what exactly is a CLI? Is it possible to use these frameworks without the use of these CLI's?

    
asked by anonymous 30.09.2017 / 03:25

1 answer

9

CLI which stands for command-line interface (command-line interface), it is briefly an interface that supports command line parameters passing on terminals and / or similar.

In other words, it is a program that accepts parameters to execute commands or even starts a system of I / O and output in>) on the terminal, without ending the program.

Note that in Unix-like systems the program does not have to be an executable, it can be a script that has an "interpreter" program header, so it can work in CLI (globally or not), an example that uses /bin/bash creates a script called foo :

  

Note: /bin/bash is the location of the bash executable, this location may vary from system to system What is the difference between / bin / bash and / usr / bin / env bash?

#!/bin/bash

echo "Seu comando:" $1

Then run:

./foo teste

Will display on screen:

  

your test command

Even with PHP it is possible, create a script and call baz :

  

Note: /usr/bin/php-cgi is the location of the php-cgi executable

#!/usr/bin/php-cgi
<?php
echo 'Seu comando:', $argv[1];

Then run:

./baz teste

In Windows only executables with the .exe extension or .bat scripts, .vbs (among some other script formats that I will enumerate over time) can be executed.

  

Is it possible to use these frameworks without the use of these CLI's?

You are likely to be able to create a project or download a project without its CLI interfaces, but I have to say, in the current versions, creating a project or starting an ionic "server" (command ionic serve ) for example is so laborious barely compensates for the work, I researched a lot about the three (angular, ionic and cordova) and saw no way less than difficult to use any of them without their own CLIs.

I think even if they were frameworks independent of their CLI and were easy to work with, even with CLI it would always be easier, since to create a project a command is enough.

    
30.09.2017 / 04:37