Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
Is it possible to add settings to "allow-plugins" in config section in composer.json through the CLI?

Since composer 2.2 the setting allow-plugins will be compulsory I’ve tried to push this setting through the composer config command in the CLI but with no luck.

I’ve tried a few commands like:

  • composer config --json '{"allow-plugins.composer/installers":true, "allow-plugins.dealerdirect/phpcodesniffer-composer-installer": true, "allow-plugins.roots/wordpress-core-installer": true }'

  • composer config config.allow-plugins '{"composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "wordpress-core-installer": true}'

  • composer config --append "allow-plugins" "composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "wordpress-core-installer": true

  • composer config --json "allow-plugins" '{"composer/installers":true, "dealerdirect/phpcodesniffer-composer-installer": true, "roots/wordpress-core-installer": true }'

All I get is error messages like ".. is not defined" or that it is an invalid value.

What I have is this:

​ "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist"
},​​​​​​

And, I need to add the settings like this:

​​​"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "allow-plugins": {
        "composer/installers": true,
        "dealerdirect/phpcodesniffer-composer-installer": true,
        "roots/wordpress-core-installer": true
     }
},​​​​​

Is this possible through the CLI?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to pass set them one by one.

composer config allow-plugins.composer/installers true
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer  true
composer config allow-plugins.roots/wordpress-core-installer true

Edit per conversation in comments:

OP was looking to also achieve not being prompted during the command. To do this, we must pass the --no-interaction (or -n) option. This can be useful when performing automation tasks.

Full Example of OP's Plugins:

composer config --no-interaction allow-plugins.composer/installerstrue
composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.roots/wordpress-core-installer true
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!