Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

335
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda