CLI Commands Overview
Relevant source files
The following files were used as context for generating this wiki page:
The Prompt Package Manager (PRPM) command-line interface (CLI) is the primary tool for developers to interact with the PRPM ecosystem. It facilitates the discovery, installation, testing, and publication of AI coding prompts, rules, and agents. The core philosophy of the CLI is "Install Once, Use Anywhere," enabling users to install a package and have it automatically converted to the appropriate format for their specific AI-powered IDE, such as Cursor, Claude, or Continue.
This solves the problem of format fragmentation across different AI coding tools. Authors can publish a package in a single format, and the CLI handles the on-the-fly conversion for users, ensuring a seamless experience across different development environments. The CLI provides a comprehensive suite of commands for managing the entire lifecycle of these AI packages.
Sources: packages/webapp/src/app/blog/prpm-complete-feature-guide/page.tsx:31-50
Core Commands
The following table provides a high-level summary of the main commands available in the PRPM CLI.
| Command | Description |
|---|---|
init | Initializes a new PRPM package in the current directory, either through an interactive wizard or by scanning for existing files. |
install | Installs a package or a collection of packages from the registry, automatically converting to the local editor's format. |
publish | Publishes a package to the PRPM registry. |
login | Authenticates the user with the PRPM registry, required for publishing. |
search | Performs a keyword-based search for packages in the registry. |
ai-search | Performs a semantic search for packages based on natural language intent. |
playground | Tests a package with various AI models in a sandboxed environment before installation. |
Sources: packages/webapp/src/app/blog/prpm-complete-feature-guide/page.tsx:52-166, CONTRIBUTING.md:10-16, packages/cli/src/commands/init.ts:1003-1033
prpm init
The init command is used to scaffold a new prpm.json manifest file. It operates in two primary modes: a "smart" detection mode and a "classic" interactive wizard.
Sources: packages/cli/src/commands/init.ts:49-56, 1010-1012
Initialization Flow
The command first checks for the --scan or --yes flags. If neither is present, it enters "smart init" mode, which scans the directory for existing package files. If packages are found, it attempts to reconcile them with an existing prpm.json or create a new one. If no packages are detected, it falls back to the "classic init" wizard to guide the user through creating a package from scratch.
The following diagram illustrates the high-level logic of the init command.
Smart Init Mode
This is the default behavior when running prpm init without flags.
- Scan: The CLI scans the current directory for recognizable AI rule/prompt files (e.g.,
agents.md,.cursor/rules,.claude/skills/). - Reconcile: If a
prpm.jsonfile already exists, the command compares the detected files against the manifest entries and reports on packages that areIn sync,New, orMissing from disk. - Review: The user is prompted to review and confirm changes, such as adding new packages to the manifest or removing stale entries.
- Create: If no
prpm.jsonexists, the CLI guides the user through creating a new manifest based on the detected packages.
Sources: packages/cli/src/commands/init.ts:571-711
Classic Init Mode
This mode is triggered if no packages are detected during the smart scan, or if the --yes flag is used. It provides an interactive wizard to configure a new package by prompting for:
- Package name, version, and description
- Format (e.g.,
cursor,claude,agents.md) and subtype (e.g.,rule,agent) - Author and license
- Tags and associated files
It can also extract metadata (description, tags, name) from the primary package file if it already exists.
Sources: packages/cli/src/commands/init.ts:717-981
init Command Options
| Option | Alias | Description |
|---|---|---|
--yes | -y | Skips all interactive prompts and uses default values to create a prpm.json file. |
--force | -f | Overwrites an existing prpm.json file. |
--scan | -s | Activates scan mode to discover packages in specified directories without interactive prompts. |
--output <path> | -o | Specifies the output path for the prpm.json file (scan mode only). |
--append | -a | Appends discovered packages to an existing prpm.json instead of overwriting it (scan mode only). |
--dry-run | Shows what would be discovered in scan mode without creating or modifying any files. |
Sources: packages/cli/src/commands/init.ts:1011-1029
prpm install
This command installs a package or a collection from the PRPM registry. Its key feature is automatic format conversion.
# Install a single package
prpm install @sanjeed5/react-best-practices
# Install a collection of packages
prpm install collections/nextjs-pro
When a package is installed, PRPM detects the user's local AI editor and converts the package to the correct format, writing the files to the appropriate directory (e.g., .cursor/rules/, .claude/skills/).
Users can also force a specific output format using the --as or --format flag.
# Install a package and convert it to the 'cursor' format
prpm install typescript-best-practices --as cursor
# Install a package and convert it to the 'copilot' format
prpm install typescript-best-practices --as copilot
Sources: packages/webapp/src/app/blog/prpm-complete-feature-guide/page.tsx:42-50, 99-105, packages/webapp/src/app/blog/agents-md-deep-dive/page.tsx:321-325
prpm publish
This command allows authors to publish their packages to the PRPM registry. Before publishing, a user must be authenticated via prpm login. The typical workflow is to first create a prpm.json manifest with prpm init, define the package content, and then run prpm publish.
# Initialize the package
prpm init
# ...edit package files...
# Publish to the registry
prpm publish
Sources: CONTRIBUTING.md:10-16, packages/webapp/src/app/blog/agents-md-deep-dive/page.tsx:333-341
prpm search and prpm ai-search
PRPM offers two methods for package discovery:
prpm search: A traditional keyword-based search.# Search for packages related to "react hooks" prpm search "react hooks" # Search for packages in the agents.md format prpm search --format agents.mdprpm ai-search: A semantic search that understands natural language queries and user intent.# Find packages to help with a specific task prpm ai-search "help me manage side effects in React"
The AI search can discover relevant packages even if the query doesn't contain exact keywords from the package's metadata.
Sources: packages/webapp/src/app/blog/prpm-complete-feature-guide/page.tsx:68-88, packages/webapp/src/app/blog/agents-md-deep-dive/page.tsx:315-317
prpm playground
The playground command provides a way to test packages against real AI models directly from the CLI, without needing to install them first. This allows for quick evaluation of a package's effectiveness.
# Test a package in the playground
prpm playground --package @vendor/pkg
It also supports comparing the output of a package across multiple AI models and testing with custom system prompts for more advanced use cases.
# Compare package output across different models
prpm playground --package @vendor/pkg --compare
# Test with a custom system prompt (for verified authors)
prpm playground --custom-prompt "You are an expert code reviewer..." --compare
Sources: packages/webapp/src/app/blog/prpm-complete-feature-guide/page.tsx:120-131, 157-163
Other Commands
| Command | Description |
|---|---|
login | Authenticates the CLI with the PRPM registry account. This is a prerequisite for publishing packages. |
Sources: CONTRIBUTING.md:13
Conclusion
The PRPM CLI is a comprehensive toolset designed to streamline the management of AI coding assistance packages. By abstracting away format differences and providing powerful tools for discovery, testing, and publishing, the CLI enables developers to focus on creating and using high-quality prompts and rules, regardless of their chosen AI-powered editor. The init command, with its smart detection and reconciliation capabilities, is particularly central to maintaining a healthy and synchronized local package ecosystem.