Forrest logo
back to the composer tool

composer:ai:41e41

How to dump env via composer
$ composer config --list --format=json | jq -R 'split("\n") | select(length > 0) | map(select(length > 0)) | map(split(" ")) | map({"cli_command": .${0}, "description": .${1}})'
try on your machine

To dump the environment using Composer and obtain the CLI command and the description as a JSON string, you can execute the following command:

composer config --list --format=json | jq -R 'split("\n") | select(length > 0) | map(select(length > 0)) | map(split(" ")) | map({"cli_command": .[0], "description": .[1]})'

Make sure you have the jq package installed in your Linux distribution. The command uses jq to parse the JSON and extract the desired fields.

This command will display the CLI command and description for each configuration option in your Composer installation as a JSON string.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • How to dump env via composer?
back to the composer tool