LPM CLI

lpm search

Find packages in npm, private registries, or the LPM.dev Registry catalogue.

Find packages by name or description before you inspect or install them.

lpm search [OPTIONS] <QUERY>

Quickstart

lpm search react
lpm search "react hooks" --limit 5
lpm search @lpm.dev/alice

The command searches one registry per query. It returns at most 20 results and has no subcommands.

LPM CLI supports npm and private registries. Queries that start with @lpm.dev/ always use the LPM.dev Registry catalogue.

Examples

# Search the default registry
lpm search "date formatting" --limit 10

# Search a configured scope
lpm search @my-co/internal

# Search the catalogue using an owner name
lpm search @lpm.dev/alice

# Search for a specific LPM.dev Registry package
lpm search @lpm.dev/alice.highlight

# Produce structured output without prompts
lpm search "react hooks" --json | jq '.packages[].name'

Catalogue queries can return related matches from other owners.

Use lpm info for versions and dependencies. Use lpm install to install a result.

Registry configuration

Search has no lpm.json configuration. Registry routing and npm credentials come from .npmrc.

~/.npmrc
registry=https://registry.npmjs.org/
@my-co:registry=https://packages.example.com/npm/
//packages.example.com/npm/:_authToken=${PRIVATE_NPM_TOKEN}

Environment-backed credentials belong in user configuration. Project-local environment interpolation for credentials is refused.

On macOS and Linux, restrict access to the file:

chmod 600 ~/.npmrc
lpm search @my-co/internal --limit 5
QueryDestination
@lpm.dev/...The LPM.dev Registry catalogue. .npmrc cannot override this scope.
@scope/... with a registry mappingThe registry configured for that scope.
@jsr/... without a scope mappinghttps://npm.jsr.io.
Other queriesThe default .npmrc registry, or npmjs.org.

Configuration merges global and user .npmrc files, then the selected project or workspace-root file. See registry configuration.

The global --registry <URL> flag changes the LPM.dev Registry endpoint. It does not override the default npm registry or a scope mapping.

Registry URLs can include a path prefix. Search rejects URLs with a query string or fragment.

Authentication and visibility

Npm and private-registry searches use credentials that match the destination in .npmrc. Environment tokens work through .npmrc interpolation, as in the example.

Stored publish credentials and a bare NPM_TOKEN do not supply npm search credentials. See authentication for registry credentials.

LPM.dev Registry catalogue searches are anonymous, even with a stored login or --token. They do not expose your private package inventory.

Search results depend on the selected registry's search support, index, and visibility rules. A successful empty result exits with status 0.

Output

Human output shows each package name, a short description, and its latest version. Npm-compatible results show ecosystem js. Other ecosystem values and quality appear when available.

@lpm.dev/alice.highlight
  Syntax highlighting tools
  latest 1.2.3 · ecosystem js

--json returns normalized data with success, count, and packages. count is the number of returned results, not the registry's total matches.

For example, this excerpt shows one npm result:

{
  "success": true,
  "count": 1,
  "packages": [
    {
      "name": "react",
      "description": "A library for user interfaces.",
      "distributionMode": "npm",
      "latestVersion": "19.0.0"
    }
  ]
}

Field values depend on the registry. Absent optional values appear as null. LPM.dev Registry results can supply owner, downloadCount, and other catalogue fields.

Catalogue results keep owner and name separate. Human output combines them as @lpm.dev/<owner>.<name>.

The JSON output omits quality and ecosystem fields. It does not preserve the full upstream response.

Each invocation requests fresh results. Search has no pagination, offline mode, or version-history output.

Troubleshooting

ResultAction
No matchesUse a broader query or check the scope's registry mapping.
Authentication failure from an npm-compatible registryCorrect the matching .npmrc credential and token permissions.
Missing environment variableSet the variable referenced by .npmrc, then repeat the command.
Invalid search responseCheck the selected registry's search endpoint and response.
Invalid limitChoose an integer from 1 to 20.

Search rejects malformed responses instead of treating them as empty results. Responses larger than 10 MiB also fail.

Flags

FlagDescription
--limit <LIMIT>Maximum results, from 1 to 20. Default: 20.

The command also supports the global flags, including --json, --registry, and --cwd.

See also