diff --git a/doc/03-cli.md b/doc/03-cli.md index fec4dbf52..30d991cbd 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -3,6 +3,24 @@ You've already learned how to use the command-line interface to do some 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 In the [Libraries](02-libraries.md) chapter we looked at how to create a @@ -16,8 +34,6 @@ while using some smart defaults. ### 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. * **--description:** Description 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 useful if you want to make a bugfix to a project and get a local git 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 installing a package, you can use `--dry-run`. This will simulate the installation and show you what would happen. @@ -55,6 +76,10 @@ resolution. passing this option you can also make it install packages referenced by `require-dev`. * **--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 @@ -73,9 +98,14 @@ If you just want to update a few packages and not all, you can list them as such ### Options * **--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. * **--dev:** Install packages listed in `require-dev`. * **--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 @@ -95,7 +125,9 @@ to the command. ### Options * **--prefer-source:** Install packages from `source` when available. +* **--prefer-dist:** Install packages from `dist` when available. * **--dev:** Add packages to `require-dev`. +* **--no-update:** Disables the automatic update of the dependencies. ## search @@ -140,9 +172,10 @@ specific version. ### Options -* **--installed:** Will list the packages that are installed. -* **--platform:** Will list only platform packages (php & extensions). -* **--dev:** Will include dev-required packages when combined with **--installed** or **--platform**. +* **--installed (-i):** List the packages that are installed. +* **--platform (-p):** List only platform packages (php & extensions). +* **--self (-s):** List the root package info. +* **--dev:** Include dev-required packages when combined with **--installed** or **--platform**. ## 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, 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. -* **--prefer-source:** Get a development version of the code checked out - from version control. +* **--prefer-source:** Install packages from `source` when available. +* **--prefer-dist:** Install packages from `dist` when available. * **--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 @@ -230,7 +269,7 @@ performance. ### 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 a bit of time to run so it is currently not done by default.