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
- Run 'choco info' separately for each package.
- Use 'choco search <list> --exact --detailed' if you need broader queries.
- 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
- Loop over packages calling 'choco info' once each rather than batching.
- Split on whitespace to detect accidental multi-name input before invoking choco.
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
- A single package name is required to run the choco info comm
- Package name is required. Please pass at least one package n
- Package name cannot point directly to a local, or remote fil
- Package name cannot point directly to a package manifest fil
- Package name cannot be a path to a file
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/afbaa4bf1401eb2b.
Report an issue: GitHub.