Questions tagged [command-line-interface]

The interface to a program that consists entirely of text, as opposed to (although not necessarily mutually exclusive to) a GUI, or Graphical User Interface.

A command line interface (CLI) is an interface to a program based on a series of typed text lines, called commands, which follow a specific language structure. The command lines are then interpreted by a Command Language Interpreter (more commonly known as a Shell).

The CLI was a popular interface since the 1960's, and even with development of more modern UI experiences such as , it is still a ubiquitous interface today. Depending on the specific command language, the CLI could provide a quicker and more accurate way to perform commands compared to alternatives.

Useful Resources

9389 questions
40
votes
3 answers

Is there any straightforward way for Clap to display help when no command is provided?

I'm using the Clap crate for parsing command line parameters. I've defined a subcommand ls that should list files. Clap also defines a help subcommand that displays information about the application and its usage. If no command is provided, nothing…
rpeshkov
  • 4,877
  • 3
  • 27
  • 43
40
votes
10 answers

Use different PHP version CLI executable for one command

So I have Gentoo box with three PHP versions installed (nevermind the reasons): /usr/bin/php -> /usr/lib64/php5.4/bin/php /usr/bin/php5.5 -> /usr/lib64/php5.5/bin/php /usr/bin/php5.6 -> /usr/lib64/php5.4/bin/php I want to install Laravel framework…
roomcays
  • 927
  • 1
  • 7
  • 22
40
votes
8 answers

How to make a shell executable node file using TypeScript

Normally in node files I just put #!/usr/bin/env node at the top and make it executable to create a file that can be run from a bash terminal. However if I do that in a Typescript file, the compiler says "error TS1001: Unexpected character "#""…
Tom Larkworthy
  • 2,104
  • 1
  • 20
  • 29
40
votes
4 answers

Apache Commons CLI : Getting list of values for an option

For a CLI, I have a requirement to pass in an array of ints as input for a particular option. Example - The below command would take in an array of customerIds and perform some operations. myCommand -c 123 124 125 I have implemented the CLI using…
Gautham Reddy
  • 411
  • 1
  • 4
  • 6
40
votes
3 answers

Are there any mature command line JDBC clients?

I am trying to create a set of test scripts that will perform black-box testing of something that works with database. For that I need to issue SQL commands from standard input or file, which was quite possible with "mysql" client, but now we use…
Illarion Kovalchuk
  • 5,774
  • 8
  • 42
  • 54
40
votes
9 answers

PHP, pass parameters from command line to a PHP script

I want to pass parameters from PHP Command Line Interface, and then read in the values using PHP script, something like this: I pass the variable from CLI like this: C:\xampp\php\php.exe name.php…
125369
  • 3,547
  • 20
  • 52
  • 70
39
votes
5 answers

How to access PHP with the Command Line on Windows?

I am trying to learn how to access PHP scripts from the command line (CLI) Below is an image from my attempt, please help. I am running Windows 7
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
39
votes
3 answers

Keyboard shortcut to "Comment" a line in NANO?

I love NANO. It's always there, it can slice and dice, and its NOT VIM! But I am constantly hitting Command / - inadvertently - as I go along, out of habit.. Most IDE's use this convention to "comment out" a line. NANO has great syntax…
Alex Gray
  • 16,007
  • 9
  • 96
  • 118
39
votes
3 answers

How can I pass parameters from the command line to $_POST in a PHP script?

I know this could sound a little weird, but I need to pass some parameters to the $_POST array. Similar to the way Apache does it, or any other web server. Unfortunately I couldn't find libapache2-mod-php5 anywhere for my Ubuntu installation.
hades
  • 1,077
  • 3
  • 11
  • 19
39
votes
3 answers

pytest - specify log level from the CLI command running the tests

my team and I are using Pytest + Jenkins to automate our product testing. we have been using the standard Logging lib of python to get proper log messages during testing, before and after each test etc. we have multiple layers of logging, we log out…
Avishay Cohen
  • 1,978
  • 2
  • 21
  • 34
39
votes
6 answers

Extract .xip file into a folder from command line?

Apple occasionally uses a proprietary XIP file format, particularly when distributing versions of Xcode. It is an analog to zip, but is signed, allowing it to verified on the receiving system. When a XIP file is opened (by double-clicking), Archive…
Antony Raphel
  • 2,036
  • 2
  • 25
  • 45
38
votes
2 answers

How to enable arrow keys for Docker Desktop CLI?

I am able to start a command line interface (CLI) for a distinct docker container from within Docker Desktop: If I press an arrow key inside the console window, strange character codes are shown, e.g. if I press the up key, instead of showing the…
Stefan
  • 10,010
  • 7
  • 61
  • 117
38
votes
4 answers

DefaultParser in Apache Commons CLI

I wanted to try out the Apache Commons CLI, and figured a good place to start would be the 'usage' section on its web page. http://commons.apache.org/proper/commons-cli/usage.html Now, the example suggest to create a DefaultParser, however the…
benroth
  • 2,468
  • 3
  • 24
  • 25
37
votes
1 answer

What can I do about "WMIC is deprecated"?

I've been relying on these two commands: wmic memorychip get capacity // Outputs how much RAM there is (in a convoluted manner). wmic diskdrive get Status,Model // Checks whether the HDDs/SSDs on the system are (supposedly) still "OK" and…
user11773559
37
votes
5 answers

Is there an equivalent of tail -f on Windows?

Many times I find myself in the situation of having to follow the evolution of a log file on Windows. Is there an equivalent of the Linux tail -f command on a Windows terminal, preferably without having to install external software?…
user2233125