Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer list available packages

we can list all available composer packages by running

composer show -a

and it shows all the packages available on packagist... but in my composer.json I have the folowing configuration:

...
"repositories": [
    {
       "type": "git",
       "url": "https://bitbucket.org/........."
    }
 ]
 ...

so I was expecting that composer show -a was looking for all the packages available in all the repositories defined inside the composer.json file but in this case it shows me all the packages available at packagist even if I didn't included it... how can I list all the available packages at this bitbucket address that I addded in my composer.json file?

like image 451
Deyan koba Avatar asked Aug 31 '18 14:08

Deyan koba


People also ask

How do I check my composer packages?

You can run composer show -i (short for --installed ). In the latest version just use composer show .

Where does composer Look for packages?

Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer. You can add more repositories to your project by declaring them in composer.


2 Answers

You need to use --all switch instead of -a (--available):

composer show --all
  • --all: List all packages available in all your repositories.

https://getcomposer.org/doc/03-cli.md#show

like image 178
rob006 Avatar answered Oct 13 '22 15:10

rob006


You can disable packagist.org and use composer show --all

{
    "repositories": [
        {
            "packagist.org": false
        }
    ]
}

https://getcomposer.org/doc/05-repositories.md#disabling-packagist-org

like image 34
Anastasia Ivanova Avatar answered Oct 13 '22 15:10

Anastasia Ivanova