1
0
Fork 0

update cli documentation

pull/6283/head
Fabien Bourigault 2017-03-21 14:57:46 +01:00
parent 4a6013d0f4
commit df85bc3ac3
1 changed files with 57 additions and 37 deletions

View File

@ -46,11 +46,13 @@ php composer.phar init
* **--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.
* **--type:** Type of package.
* **--homepage:** Homepage of the package. * **--homepage:** Homepage of the package.
* **--require:** Package to require with a version constraint. Should be * **--require:** Package to require with a version constraint. Should be
in format `foo/bar:1.0.0`. in format `foo/bar:1.0.0`.
* **--require-dev:** Development requirements, see **--require**. * **--require-dev:** Development requirements, see **--require**.
* **--stability (-s):** Value for the `minimum-stability` field. * **--stability (-s):** Value for the `minimum-stability` field.
* **--license (-l):** License of package.
* **--repository:** Provide one (or more) custom repositories. They will be stored * **--repository:** Provide one (or more) custom repositories. They will be stored
in the generated composer.json, and used for auto-completion when prompting for in the generated composer.json, and used for auto-completion when prompting for
the list of requires. Every repository can be either an HTTP URL pointing the list of requires. Every repository can be either an HTTP URL pointing
@ -86,9 +88,6 @@ resolution.
servers and other use cases where you typically do not run updates of the 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 vendors. It is also a way to circumvent problems with git if you do not
have a proper setup. have a proper setup.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--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.
@ -106,6 +105,9 @@ resolution.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only. * **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`. Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes. * **--apcu-autoloader:** Use APCu to cache found/not-found classes.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
## update ## update
@ -135,30 +137,31 @@ php composer.phar update vendor/*
* **--prefer-source:** Install packages from `source` when available. * **--prefer-source:** Install packages from `source` when available.
* **--prefer-dist:** Install packages from `dist` when available. * **--prefer-dist:** Install packages from `dist` when available.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--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` (this is the default behavior). * **--dev:** Install packages listed in `require-dev` (this is the default behavior).
* **--no-dev:** Skip installing packages listed in `require-dev`. The autoloader generation skips the `autoload-dev` rules. * **--no-dev:** Skip installing packages listed in `require-dev`. The autoloader generation skips the `autoload-dev` rules.
* **--lock:** Only updates the lock file hash to suppress warning about the
lock file being out of date.
* **--no-autoloader:** Skips autoloader generation. * **--no-autoloader:** Skips autoloader generation.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters. terminals or scripts which don't handle backspace characters.
* **--no-suggest:** Skips suggested packages in the output. * **--no-suggest:** Skips suggested packages in the output.
* **--with-dependencies:** Add also all dependencies of whitelisted packages to the whitelist.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to get a faster * **--optimize-autoloader (-o):** Convert PSR-0/4 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.
* **--classmap-authoritative (-a):** Autoload classes from the classmap only. * **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`. Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes. * **--apcu-autoloader:** Use APCu to cache found/not-found classes.
* **--lock:** Only updates the lock file hash to suppress warning about the * **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
lock file being out of date. requirements and force the installation even if the local machine does not
* **--with-dependencies:** Add also all dependencies of whitelisted packages to the whitelist. fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--root-reqs:** Restricts the update to your first degree dependencies.
* **--prefer-stable:** Prefer stable versions of dependencies. * **--prefer-stable:** Prefer stable versions of dependencies.
* **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal * **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal
versions of requirements, generally used with `--prefer-stable`. versions of requirements, generally used with `--prefer-stable`.
* **--interactive:** Interactive interface with autocompletion to select the packages to update.
* **--root-reqs:** Restricts the update to your first degree dependencies.
## require ## require
@ -181,20 +184,23 @@ php composer.phar require vendor/package:2.* vendor/package2:dev-master
### Options ### Options
* **--dev:** Add packages to `require-dev`.
* **--prefer-source:** Install packages from `source` when available. * **--prefer-source:** Install packages from `source` when available.
* **--prefer-dist:** Install packages from `dist` when available. * **--prefer-dist:** Install packages from `dist` when available.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--dev:** Add packages to `require-dev`.
* **--no-update:** Disables the automatic update of the dependencies.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters. terminals or scripts which don't handle backspace characters.
* **--no-suggest:** Skips suggested packages in the output. * **--no-suggest:** Skips suggested packages in the output.
* **--no-update:** Disables the automatic update of the dependencies.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--update-no-dev:** Run the dependency update with the `--no-dev` option. * **--update-no-dev:** Run the dependency update with the `--no-dev` option.
* **--update-with-dependencies:** Also update dependencies of the newly * **--update-with-dependencies:** Also update dependencies of the newly
required packages. required packages.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--prefer-stable:** Prefer stable versions of dependencies.
* **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal
versions of requirements, generally used with `--prefer-stable`.
* **--sort-packages:** Keep packages sorted in `composer.json`. * **--sort-packages:** Keep packages sorted in `composer.json`.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to
get a faster autoloader. This is recommended especially for production, but get a faster autoloader. This is recommended especially for production, but
@ -202,9 +208,7 @@ php composer.phar require vendor/package:2.* vendor/package2:dev-master
* **--classmap-authoritative (-a):** Autoload classes from the classmap only. * **--classmap-authoritative (-a):** Autoload classes from the classmap only.
Implicitly enables `--optimize-autoloader`. Implicitly enables `--optimize-autoloader`.
* **--apcu-autoloader:** Use APCu to cache found/not-found classes. * **--apcu-autoloader:** Use APCu to cache found/not-found classes.
* **--prefer-stable:** Prefer stable versions of dependencies.
* **--prefer-lowest:** Prefer lowest versions of dependencies. Useful for testing minimal
versions of requirements, generally used with `--prefer-stable`.
## remove ## remove
@ -219,16 +223,16 @@ After removing the requirements, the modified requirements will be
uninstalled. uninstalled.
### Options ### Options
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--dev:** Remove packages from `require-dev`. * **--dev:** Remove packages from `require-dev`.
* **--no-update:** Disables the automatic update of the dependencies.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some
terminals or scripts which don't handle backspace characters. terminals or scripts which don't handle backspace characters.
* **--no-update:** Disables the automatic update of the dependencies.
* **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`.
* **--update-no-dev:** Run the dependency update with the --no-dev option. * **--update-no-dev:** Run the dependency update with the --no-dev option.
* **--update-with-dependencies:** Also update dependencies of the removed packages. * **--update-with-dependencies:** Also update dependencies of the removed packages.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not
fulfill these. See also the [`platform`](06-config.md#platform) config option.
* **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to * **--optimize-autoloader (-o):** Convert PSR-0/4 autoloading to classmap to
get a faster autoloader. This is recommended especially for production, but 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. can take a bit of time to run so it is currently not done by default.
@ -280,6 +284,7 @@ You can also search for more than one term by passing multiple arguments.
### Options ### Options
* **--only-name (-N):** Search only in name. * **--only-name (-N):** Search only in name.
* **--type (-t):** Search for a specific package type.
## show ## show
@ -328,17 +333,19 @@ php composer.phar show monolog/monolog 1.0.2
### Options ### Options
* **--latest (-l):** List all installed packages including their latest version. * **--all :** List all packages available in all your repositories.
* **--all (-a):** List all packages available in all your repositories.
* **--installed (-i):** List the packages that are installed (this is enabled by default, and deprecated). * **--installed (-i):** List the packages that are installed (this is enabled by default, and deprecated).
* **--platform (-p):** List only platform packages (php & extensions). * **--platform (-p):** List only platform packages (php & extensions).
* **--available (-a):** List available packages only.
* **--self (-s):** List the root package info. * **--self (-s):** List the root package info.
* **--tree (-t):** List your dependencies as a tree. If you pass a package name it will show the dependency tree for that package.
* **--name-only (-N):** List package names only. * **--name-only (-N):** List package names only.
* **--path (-P):** List package paths. * **--path (-P):** List package paths.
* **--tree (-t):** List your dependencies as a tree. If you pass a package name it will show the dependency tree for that package.
* **--latest (-l):** List all installed packages including their latest version.
* **--outdated (-o):** Implies --latest, but this lists *only* packages that have a newer version available. * **--outdated (-o):** Implies --latest, but this lists *only* packages that have a newer version available.
* **--minor-only (-m):** Use with --latest. Only shows packages that have minor SemVer-compatible updates. * **--minor-only (-m):** Use with --latest. Only shows packages that have minor SemVer-compatible updates.
* **--direct (-D):** Restricts the list of packages to your direct dependencies. * **--direct (-D):** Restricts the list of packages to your direct dependencies.
* **--strict:** Return a non-zero exit code when there are outdated packages.
* **--format (-f):** Lets you pick between text (default) or json output format. * **--format (-f):** Lets you pick between text (default) or json output format.
## outdated ## outdated
@ -358,8 +365,8 @@ The color coding is as such:
* **--all (-a):** Show all packages, not just outdated (alias for `composer show -l`). * **--all (-a):** Show all packages, not just outdated (alias for `composer show -l`).
* **--direct (-D):** Restricts the list of packages to your direct dependencies. * **--direct (-D):** Restricts the list of packages to your direct dependencies.
* **--minor-only (-m):** Only shows packages that have minor SemVer-compatible updates.
* **--strict:** Returns non-zero exit code if any package is outdated. * **--strict:** Returns non-zero exit code if any package is outdated.
* **--minor-only (-m):** Only shows packages that have minor SemVer-compatible updates.
* **--format (-f):** Lets you pick between text (default) or json output format. * **--format (-f):** Lets you pick between text (default) or json output format.
## browse / home ## browse / home
@ -370,6 +377,7 @@ in your browser.
### Options ### Options
* **--homepage (-H):** Open the homepage instead of the repository URL. * **--homepage (-H):** Open the homepage instead of the repository URL.
* **--show (-s):** Only show the homepage or repository URL.
## suggests ## suggests
@ -380,13 +388,14 @@ to limit output to suggestions made by those packages only.
Use the `--by-package` or `--by-suggestion` flags to group the output by Use the `--by-package` or `--by-suggestion` flags to group the output by
the package offering the suggestions or the suggested packages respectively. the package offering the suggestions or the suggested packages respectively.
Use the `--verbose (-v)` flag to display the suggesting package and the suggestion reason.
This implies `--by-package --by-suggestion`, showing both lists.
### Options ### Options
* **--by-package:** Groups output by suggesting package. * **--by-package:** Groups output by suggesting package.
* **--by-suggestion:** Groups output by suggested package. * **--by-suggestion:** Groups output by suggested package.
* **--no-dev:** Excludes suggestions from `require-dev` packages. * **--no-dev:** Excludes suggestions from `require-dev` packages.
* **--verbose (-v):** Increased verbosity adds suggesting package name and
reason for suggestion.
## depends ## depends
@ -468,6 +477,8 @@ php composer.phar validate
* **--no-check-all:** Do not emit a warning if requirements in `composer.json` use unbound version constraints. * **--no-check-all:** Do not emit a warning if requirements in `composer.json` use unbound version constraints.
* **--no-check-lock:** Do not emit an error if `composer.lock` exists and is not up to date. * **--no-check-lock:** Do not emit an error if `composer.lock` exists and is not up to date.
* **--no-check-publish:** Do not emit an error if `composer.json` is unsuitable for publishing as a package on Packagist but is otherwise valid. * **--no-check-publish:** Do not emit an error if `composer.json` is unsuitable for publishing as a package on Packagist but is otherwise valid.
* **--with-dependencies:** Also validate the composer.json of all installed dependencies.
* **--strict:** Return a non-zero exit code for warnings as well as errors.
## status ## status
@ -517,6 +528,11 @@ sudo -H composer self-update
* **--rollback (-r):** Rollback to the last version you had installed. * **--rollback (-r):** Rollback to the last version you had installed.
* **--clean-backups:** Delete old backups during an update. This makes the * **--clean-backups:** Delete old backups during an update. This makes the
current version of Composer the only backup available after the update. current version of Composer the only backup available after the update.
* **--no-progress:** Do not output download progress.
* **--update-keys:** Prompt user for a key update.
* **--stable:** Force an update to the stable channel.
* **--preview:** Force an update to the preview channel.
* **--snapshot:** Force an update to the snapshot channel.
## config ## config
@ -552,6 +568,7 @@ See the [Config](06-config.md) chapter for valid configuration options.
* **--editor (-e):** Open the local composer.json file using in a text editor as * **--editor (-e):** Open the local composer.json file using in a text editor as
defined by the `EDITOR` env variable. With the `--global` option, this opens defined by the `EDITOR` env variable. With the `--global` option, this opens
the global config file. the global config file.
* **--auth (-a):** Affect auth config file (only used for --editor).
* **--unset:** Remove the configuration element named by `setting-key`. * **--unset:** Remove the configuration element named by `setting-key`.
* **--list (-l):** Show the list of current config variables. With the `--global` * **--list (-l):** Show the list of current config variables. With the `--global`
option this lists the global configuration only. option this lists the global configuration only.
@ -617,16 +634,16 @@ By default the command checks for the packages on packagist.org.
### Options ### Options
* **--stability (-s):** Minimum stability of package. Defaults to `stable`.
* **--prefer-source:** Install packages from `source` when available.
* **--prefer-dist:** Install packages from `dist` when available.
* **--repository:** Provide a custom repository to search for the package, * **--repository:** 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, a path to a local `packages.json` file, or a to a `composer` repository, a path to a local `packages.json` file, or a
JSON string which similar to what the [repositories](04-schema.md#repositories) JSON string which similar to what the [repositories](04-schema.md#repositories)
key accepts. key accepts.
* **--stability (-s):** Minimum stability of package. Defaults to `stable`.
* **--prefer-source:** Install packages from `source` when available.
* **--prefer-dist:** Install packages from `dist` when available.
* **--dev:** Install packages listed in `require-dev`. * **--dev:** Install packages listed in `require-dev`.
* **--no-install:** Disables installation of the vendors. * **--no-dev:** Disables installation of require-dev packages.
* **--no-scripts:** Disables the execution of the scripts defined in the root * **--no-scripts:** Disables the execution of the scripts defined in the root
package. package.
* **--no-progress:** Removes the progress display that can mess with some * **--no-progress:** Removes the progress display that can mess with some
@ -634,6 +651,7 @@ By default the command checks for the packages on packagist.org.
* **--keep-vcs:** Skip the deletion of the VCS metadata for the created * **--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 project. This is mostly useful if you run the command in non-interactive
mode. mode.
* **--no-install:** Disables installation of the vendors.
* **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*` * **--ignore-platform-reqs:** ignore `php`, `hhvm`, `lib-*` and `ext-*`
requirements and force the installation even if the local machine does not requirements and force the installation even if the local machine does not
fulfill these. fulfill these.
@ -652,7 +670,7 @@ using this option you can still use PSR-0/4 for convenience and classmaps for
performance. performance.
### Options ### Options
* **--no-scripts:** Skips the execution of all scripts defined in composer.json file.
* **--optimize (-o):** Convert PSR-0/4 autoloading to classmap to get a faster * **--optimize (-o):** Convert PSR-0/4 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.
@ -672,16 +690,17 @@ Lists the name, version and license of every package installed. Use
### Options ### Options
* **--no-dev:** Remove dev dependencies from the output
* **--format:** Format of the output: text or json (default: "text") * **--format:** Format of the output: text or json (default: "text")
* **--no-dev:** Remove dev dependencies from the output
## run-script ## run-script
### Options ### Options
* **--timeout:** Set the script timeout in seconds, or 0 for no timeout. * **--timeout:** Set the script timeout in seconds, or 0 for no timeout.
* **--no-dev:** Disable dev mode * **--dev:** Sets the dev mode.
* **--list:** List user defined scripts * **--no-dev:** Disable dev mode.
* **--list (-l):** List user defined scripts.
To run [scripts](articles/scripts.md) manually you can use this command, To run [scripts](articles/scripts.md) manually you can use this command,
just give it the script name and optionally any required arguments. just give it the script name and optionally any required arguments.
@ -694,7 +713,7 @@ runs.
### Options ### Options
* **--list:** List the available composer binaries * **--list (-l):** List the available composer binaries.
## diagnose ## diagnose
@ -721,6 +740,7 @@ php composer.phar archive vendor/package 2.0.21 --format=zip
* **--format (-f):** Format of the resulting archive: tar or zip (default: * **--format (-f):** Format of the resulting archive: tar or zip (default:
"tar") "tar")
* **--dir:** Write the archive to this directory (default: ".") * **--dir:** Write the archive to this directory (default: ".")
* **--file:** Write the archive with the given file name.
## help ## help