Skip to content

config:set

Save a config value directly. Does not perform a config import.

Examples

  • config:set system.site name MySite
  • config:set user.role.anonymous permissions '[]'
  • config:set system.site name 'NULL'
  • config:set --input-format=yaml system.site page {403: '403', front: home}
  • config:set --input-format=yaml user.role.authenticated permissions [foo,bar]
  • config:set --input-format=yaml user.role.authenticated ? "{label: 'Auth user', weight: 5}
  • config:set cat tmp.yml | drush config:set --input-format=yaml user.mail ? -

Arguments

  • config_name. The config object name, for example system.site.
  • key. The config key, for example page.front. Use ? if you are updating multiple top-level keys.
  • value. The value to assign to the config key. Use - to read from Stdin.

Options

  • --input-format=INPUT-FORMAT. Format to parse the object. Recognized values: string, yaml. Since JSON is a subset of YAML, $value may be in JSON format. [default: string]

Global Options

  • -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  • -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
  • -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
  • To see all global options, run drush core:global-options.

Aliases

  • cset
  • config-set

Legend

  • An argument or option with square brackets is optional.
  • Any default value is listed at end of arg/option description.
  • An ellipsis indicates that an argument accepts multiple values separated by a space.