Forrest logo
tool overview
On this page you find all important commands for the CLI tool composer. If the command you are looking for is missing please ask our AI.

composer

A Dependency Manager for PHP.

Articles in our magazine for composer:

Doing magic with Laminas on the CLI

Using the command line is often faster and more effective. Event when using frontend frameworks like nuxt. Here are the most important commands.

List of commands for composer:

  • composer:init Creates a basic composer.json file in current directory.
    $ composer init
    try on your machine
    explain this command
  • composer:packages:install Install all packages depending on the the package.lock file
    $ composer install
    try on your machine
    explain this command
  • composer:packages:show How to show all installed composer packages
    $ composer show --format=json
    try on your machine
    explain this command
  • composer:packages:update Update all packages according to the current system
    $ composer update
    try on your machine
    explain this command
  • composer:packages:update:single Update a single composer package
    $ composer update ${package}
    try on your machine
    explain this command
  • composer:tldr:3498b composer: Update composer to its latest version.
    $ composer self-update
    try on your machine
    explain this command
  • composer:tldr:97345 composer: Uninstall a package from this project, removing it as a dependency from `composer.json`.
    $ composer remove ${user-package_name}
    try on your machine
    explain this command
  • composer:tldr:9d9e7 composer: Update composer lock only after updating `composer.json` manually.
    $ composer update --lock
    try on your machine
    explain this command
  • composer:tldr:ac0f9 composer: Add a package as a dependency for this project, adding it to `composer.json`.
    $ composer require ${user-package_name}
    try on your machine
    explain this command
  • composer:tldr:e2e0f composer: Learn more about why a dependency can't be installed.
    $ composer why-not ${user-package_name}
    try on your machine
    explain this command
  • doctrine:install Add doctrine library to your PHP project
    $ composer require doctrine/orm
    try on your machine
    explain this command
  • laminas:install Install the Laminas CLI tools
    $ composer global require laminas/laminas-cli
    try on your machine
    explain this command
  • php:code-beautifier-and-fixer:install:dev Install "PHP Code Beautifier and Fixer" from a Composer package as a dev dependency
    $ composer require --dev squizlabs/php_codesniffer
    try on your machine
    explain this command
tool overview