Update CLI docs
parent
a8561fafda
commit
992249d4cc
|
@ -3,6 +3,24 @@
|
||||||
You've already learned how to use the command-line interface to do some
|
You've already learned how to use the command-line interface to do some
|
||||||
things. This chapter documents all the available commands.
|
things. This chapter documents all the available commands.
|
||||||
|
|
||||||
|
To get help from the command-line, simply call `composer` or `composer list`
|
||||||
|
to see the complete list of commands, then `--help` combined with any of those
|
||||||
|
can give you more information.
|
||||||
|
|
||||||
|
## Global Options
|
||||||
|
|
||||||
|
The following options are available with every command:
|
||||||
|
|
||||||
|
* **--verbose (-v):** Increase verbosity of messages.
|
||||||
|
* **--help (-h):** Display help information.
|
||||||
|
* **--quiet (-q):** Do not output any message.
|
||||||
|
* **--no-interaction (-n):** Do not ask any interactive question.
|
||||||
|
* **--working-dir (-d):** If specified, use the given directory as working directory.
|
||||||
|
* **--profile:** Display timing and memory usage information
|
||||||
|
* **--ansi:** Force ANSI output.
|
||||||
|
* **--no-ansi:** Disable ANSI output.
|
||||||
|
* **--version (-V):** Display this application version.
|
||||||
|
|
||||||
## init
|
## init
|
||||||
|
|
||||||
In the [Libraries](02-libraries.md) chapter we looked at how to create a
|
In the [Libraries](02-libraries.md) chapter we looked at how to create a
|
||||||
|
@ -16,8 +34,6 @@ while using some smart defaults.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
* **--no-interaction:** (**-n**) Run the command in non-interactive mode.
|
|
||||||
The rest of these options only make sense when you are in this mode.
|
|
||||||
* **--name:** Name of the package.
|
* **--name:** Name of the package.
|
||||||
* **--description:** Description of the package.
|
* **--description:** Description of the package.
|
||||||
* **--author:** Author name of the package.
|
* **--author:** Author name of the package.
|
||||||
|
@ -48,6 +64,11 @@ resolution.
|
||||||
enabled, composer will install from `source` if there is one. This is
|
enabled, composer will install from `source` if there is one. This is
|
||||||
useful if you want to make a bugfix to a project and get a local git
|
useful if you want to make a bugfix to a project and get a local git
|
||||||
clone of the dependency directly.
|
clone of the dependency directly.
|
||||||
|
* **--prefer-dist:** Reverse of `--prefer-source`, composer will install
|
||||||
|
from `dist` if possible. This can speed up installs substantially on build
|
||||||
|
servers and other use cases where you typically do not run updates of the
|
||||||
|
vendors. It is also a way to circumvent problems with git if you do not
|
||||||
|
have a proper setup.
|
||||||
* **--dry-run:** If you want to run through an installation without actually
|
* **--dry-run:** If you want to run through an installation without actually
|
||||||
installing a package, you can use `--dry-run`. This will simulate the
|
installing a package, you can use `--dry-run`. This will simulate the
|
||||||
installation and show you what would happen.
|
installation and show you what would happen.
|
||||||
|
@ -55,6 +76,10 @@ resolution.
|
||||||
passing this option you can also make it install packages referenced by
|
passing this option you can also make it install packages referenced by
|
||||||
`require-dev`.
|
`require-dev`.
|
||||||
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
|
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
|
||||||
|
* **--no-custom-installers:** Disables custom installers.
|
||||||
|
* **--optimize (-o):** Convert PSR-0 autoloading to classmap to get a faster
|
||||||
|
autoloader. This is recommended especially for production, but can take
|
||||||
|
a bit of time to run so it is currently not done by default.
|
||||||
|
|
||||||
## update
|
## update
|
||||||
|
|
||||||
|
@ -73,9 +98,14 @@ If you just want to update a few packages and not all, you can list them as such
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
* **--prefer-source:** Install packages from `source` when available.
|
* **--prefer-source:** Install packages from `source` when available.
|
||||||
|
* **--prefer-dist:** Install packages from `dist` when available.
|
||||||
* **--dry-run:** Simulate the command without actually doing anything.
|
* **--dry-run:** Simulate the command without actually doing anything.
|
||||||
* **--dev:** Install packages listed in `require-dev`.
|
* **--dev:** Install packages listed in `require-dev`.
|
||||||
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
|
* **--no-scripts:** Skips execution of scripts defined in `composer.json`.
|
||||||
|
* **--no-custom-installers:** Disables custom installers.
|
||||||
|
* **--optimize (-o):** Convert PSR-0 autoloading to classmap to get a faster
|
||||||
|
autoloader. This is recommended especially for production, but can take
|
||||||
|
a bit of time to run so it is currently not done by default.
|
||||||
|
|
||||||
## require
|
## require
|
||||||
|
|
||||||
|
@ -95,7 +125,9 @@ to the command.
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
* **--prefer-source:** Install packages from `source` when available.
|
* **--prefer-source:** Install packages from `source` when available.
|
||||||
|
* **--prefer-dist:** Install packages from `dist` when available.
|
||||||
* **--dev:** Add packages to `require-dev`.
|
* **--dev:** Add packages to `require-dev`.
|
||||||
|
* **--no-update:** Disables the automatic update of the dependencies.
|
||||||
|
|
||||||
## search
|
## search
|
||||||
|
|
||||||
|
@ -140,9 +172,10 @@ specific version.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
* **--installed:** Will list the packages that are installed.
|
* **--installed (-i):** List the packages that are installed.
|
||||||
* **--platform:** Will list only platform packages (php & extensions).
|
* **--platform (-p):** List only platform packages (php & extensions).
|
||||||
* **--dev:** Will include dev-required packages when combined with **--installed** or **--platform**.
|
* **--self (-s):** List the root package info.
|
||||||
|
* **--dev:** Include dev-required packages when combined with **--installed** or **--platform**.
|
||||||
|
|
||||||
## depends
|
## depends
|
||||||
|
|
||||||
|
@ -211,9 +244,15 @@ By default the command checks for the packages on packagist.org.
|
||||||
* **--repository-url:** Provide a custom repository to search for the package,
|
* **--repository-url:** Provide a custom repository to search for the package,
|
||||||
which will be used instead of packagist. Can be either an HTTP URL pointing
|
which will be used instead of packagist. Can be either an HTTP URL pointing
|
||||||
to a `composer` repository, or a path to a local `packages.json` file.
|
to a `composer` repository, or a path to a local `packages.json` file.
|
||||||
* **--prefer-source:** Get a development version of the code checked out
|
* **--prefer-source:** Install packages from `source` when available.
|
||||||
from version control.
|
* **--prefer-dist:** Install packages from `dist` when available.
|
||||||
* **--dev:** Install packages listed in `require-dev`.
|
* **--dev:** Install packages listed in `require-dev`.
|
||||||
|
* **--no-custom-installers:** Disables custom installers.
|
||||||
|
* **--no-scripts:** Disables the execution of the scripts defined in the root
|
||||||
|
package.
|
||||||
|
* **--keep-vcs:** Skip the deletion of the VCS metadata for the created
|
||||||
|
project. This is mostly useful if you run the command in non-interactive
|
||||||
|
mode.
|
||||||
|
|
||||||
## dump-autoload
|
## dump-autoload
|
||||||
|
|
||||||
|
@ -230,7 +269,7 @@ performance.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
* **--optimize:** Convert PSR-0 autoloading to classmap to get a faster
|
* **--optimize (-o):** Convert PSR-0 autoloading to classmap to get a faster
|
||||||
autoloader. This is recommended especially for production, but can take
|
autoloader. This is recommended especially for production, but can take
|
||||||
a bit of time to run so it is currently not done by default.
|
a bit of time to run so it is currently not done by default.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue