Name for the command line user interface employed by projects like Git

bashcommand linegit

There are quite a few command line tools (or suites of tools) out there these days which use a command line interface such that every command starts with the name of the application/tool followed by a space and one of several available "subcommands". Git, for instance, has many different subcommands: "git status", "git init", "git fetch", "git commit", etc.

Just a few other projects I can think of which also use this pattern are:

  • vagrant ("vagrant up", "vagrant destroy", "vagrant status")
  • go(lang) ("go run", "go vet", "go fmt", "go build")
  • svn ("svn checkout", "svn update", "svn commit")
  • crosstool-ng ("ct-ng help", "ct-ng build", "ct-ng menuconfig")
  • repo ("repo sync", "repo help", "repo init")

And this is far from a comprehensive list.

Some examples of command-line applications which do not use this pattern (but could if designed slightly differently):

  • pacman (Arch Linux's package manager. Uses flag-style "subcommands" in contrast to the pattern about which I'm asking. "pacman -Q", "pacman -S", "pacman -R", etc)
  • portage/"emerge" (Gentoo's package manager)
  • ImageMagick (rather than separate subcommands, it uses separate commands. "convert", "import", "animate", "compare", "composite", etc)

My question is "is there a name specifically for this 'subcommand' style of command-line interface pattern and if so what is it?"

Best Answer

In The Go Programming Language by Brian W. Kernighan and Alan A. A. Donovan, the go tool is described as it «uses the ‹Swiss army knife› style, with over a dozen subcommands» (p. 290).

Related Question