chocolatey/choco · error · ApplicationException

Only a single package name can be passed to the choco info c

Error message

Only a single package name can be passed to the choco info command.

What it means

The info command only accepts a single package name. After confirming Input is non-empty, Validate() splits on spaces and throws if more than one token is present. A TODO notes multi-package info is not yet supported.

Source

Thrown at src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs:104

            configuration.Verbose = true;
            configuration.ListCommand.Exact = true;
        }

        public override void Validate(ChocolateyConfiguration configuration)
        {
            base.Validate(configuration);

            if (string.IsNullOrWhiteSpace(configuration.Input))
            {
                throw new ApplicationException("A single package name is required to run the choco info command.");
            }

            // Validate only a single package has been passed to info
            // TODO: Provide ability to get info on a list of packages. See https://github.com/chocolatey/choco/issues/2905
            var input = configuration.Input.Split(' ');
            if (input.Length > 1)
            {
                throw new ApplicationException("Only a single package name can be passed to the choco info command.");
            }
        }

        public override void HelpMessage(ChocolateyConfiguration configuration)
        {
            this.Log().Info(ChocolateyLoggers.Important, "Info Command");
            this.Log().Info(@"
Chocolatey will perform a search for a package local or remote and provide
 detailed information about that package. This is a synonym for
 `choco search <pkgname> --exact --detailed`.

");

            "chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage");
            "chocolatey".Log().Info(@"
    choco info [<options/switches>]
");

View on GitHub (pinned to 0d5abdd10c)

Solutions

  1. Run 'choco info' separately for each package.
  2. Use 'choco search <list> --exact --detailed' if you need broader queries.
  3. Track multi-package info support via the referenced GitHub issue #2905.

Example fix

# before
choco info pkgA pkgB

# after
choco info pkgA
choco info pkgB
Defensive patterns

Strategy: validation

Validate before calling

// info takes exactly one package.
var names = pkg.Split((char[])null, StringSplitOptions.RemoveEmptyEntries);
if (names.Length != 1)
{
    throw new ArgumentException("choco info accepts a single package name");
}
foreach (var n in names) RunChoco($"info {n}");

Prevention

When it happens

Trigger: Running 'choco info pkgA pkgB' or 'choco info "pkgA pkgB"', yielding a Split(' ') length > 1.

Common situations: Passing a space-separated list expecting batch info; quoted multi-name strings that split into multiple tokens; copy-pasting a search query.

Related errors


AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13). Data as JSON: /api/errors/afbaa4bf1401eb2b. Report an issue: GitHub.