phacility/phabricator · error · PhutilArgumentUsageException

Specify a value to set the configuration key

Error message

Specify a value to set the configuration key "%s" to, or use "--stdin" to read a value from stdin.

What it means

Usage guard in the config set CLI workflow: fires when neither --stdin nor a value argument was supplied — only the key was given. The workflow cannot infer the value to store, so it aborts and names the key at fault.

Solutions

  1. Append the value: bin/config set <key> <value>
  2. Or use --stdin to provide the value via standard input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/c5d003e0495681ec. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:55

    }

    $is_stdin = $args->getArg('stdin');

    $key = $argv[0];

    if ($is_stdin) {
      if (count($argv) > 1) {
        throw new PhutilArgumentUsageException(
          pht(
            'Too many arguments: expected only a configuration key when '.
            'using "--stdin".'));
      }

      fprintf(STDERR, tsprintf("%s\n", pht('Reading value from stdin...')));
      $value = file_get_contents('php://stdin');
    } else {
      if (count($argv) == 1) {
        throw new PhutilArgumentUsageException(
          pht(
            'Specify a value to set the configuration key "%s" to, or '.
            'use "--stdin" to read a value from stdin.',
            $key));
      }

      if (count($argv) > 2) {
        throw new PhutilArgumentUsageException(
          pht(
            'Too many arguments: expected one key and one value.'));
      }

      $value = $argv[1];
    }

    $options = PhabricatorApplicationConfigOptions::loadAllOptions();
    if (empty($options[$key])) {
      throw new PhutilArgumentUsageException(

View on GitHub (pinned to 5720a38cfe)