phacility/phabricator · error · PhutilArgumentUsageException

Specify a configuration key to get.

Error message

Specify a configuration key to get.

What it means

Usage guard in the config get CLI workflow: fires when no positional arguments were supplied, so there is no configuration key to read. It is a simple emptiness check on the wildcard args before any options lookup happens.

Solutions

  1. Pass one key, e.g. bin/config get phabricator.base-uri
  2. Use bin/config list to browse available keys
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php:25 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/9e51f2d630992675. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php:25

    $this
      ->setName('get')
      ->setExamples('**get** __key__')
      ->setSynopsis(pht('Get a local configuration value.'))
      ->setArguments(
        array(
          array(
            'name'      => 'args',
            'wildcard'  => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $console = PhutilConsole::getConsole();

    $argv = $args->getArg('args');
    if (count($argv) == 0) {
      throw new PhutilArgumentUsageException(
        pht('Specify a configuration key to get.'));
    }

    $key = $argv[0];

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

    $options = PhabricatorApplicationConfigOptions::loadAllOptions();
    if (empty($options[$key])) {
      throw new PhutilArgumentUsageException(
        pht(
          "No such configuration key '%s'! Use `%s` to list all keys.",
          $key,
          'config list'));
    }

View on GitHub (pinned to 5720a38cfe)