CLI Commands
Complete reference for all pair-cli commands with syntax, options, and examples.
Complete reference for all pair-cli commands with syntax, options, and examples.
Quick Navigation:
- install — Install documentation and assets
- update — Update existing documentation
- update-link — Validate and update links
- package — Package KB content into ZIP
- kb-info — Display package metadata
- kb-verify — Verify KB package integrity
- kb validate — Validate KB structure
- validate-config — Validate configuration
install
Install documentation and assets from KB source to target folder.
Usage
Arguments
[target]— Optional target directory path (default: current working directory)[registry:target ...]— Install specific registries to custom targets
Options
| Option | Description |
|---|---|
--list-targets | List all available asset registries with descriptions |
--config <file> | Use custom configuration file (default: config.json) |
--source <url|path> | KB source URL or local path (overrides auto-download) |
--offline | Skip KB download, use local source only |
--skip-verify | Skip package integrity verification (for ZIP sources) |
KB Source Options:
--source <url>— Download KB from custom HTTP/HTTPS URL or use local path--offline— Skip automatic KB download (requires--sourcewith local path)
Note: Cannot combine --source <url> with --offline. The --offline flag requires --source with a local filesystem path.
Target Resolution: Registry output is written relative to the current working directory. When running via pnpm --filter, the CLI reads INIT_CWD (set by pnpm to the original invoking directory) so output lands at the monorepo root, not inside the filtered package directory.
Examples
update
Update existing documentation and assets from KB source.
Usage
Arguments
[target]— Optional target directory path (default: current working directory)[registry:target ...]— Update specific registries in custom targets
Options
| Option | Description |
|---|---|
--config <file> | Use custom configuration file (default: config.json) |
--source <url|path> | KB source URL or local path (overrides auto-download) |
--offline | Skip KB download, use local source only |
Examples
update-link
Validate and update internal links in installed KB content.
Usage
Options
| Option | Description |
|---|---|
--url <url|path> | KB source URL or local filesystem path |
--dry-run | Preview changes without writing to files |
--log-level <level> | Set logging level (trace, debug, info, warn, error) |
Examples
For detailed usage, see the Link Update Guide.
package
Package KB content into validated ZIP file for distribution.
Usage
Options
| Option | Short | Description |
|---|---|---|
--output <path> | -o | Output ZIP file path (default: kb-package.zip) |
--source-dir <path> | -s | Source directory to package (default: current directory) |
--config <path> | -c | Path to config.json file |
--name <name> | Package name for manifest | |
--version <version> | Package version for manifest | |
--description <description> | Package description for manifest | |
--author <author> | Package author for manifest | |
--skip-registries <list> | Comma-separated registry names to exclude | |
--root <path> | Custom root path for link relativization (default: .pair/) | |
--log-level <level> | -l | Set logging level (trace, debug, info, warn, error) |
--interactive | -i | Enter interactive mode with guided prompts |
--tags <tags> | Comma-separated tags (e.g., "ai,devops,testing") | |
--license <license> | Package license (default: MIT) | |
--org | Enable organizational packaging mode | |
--org-name <name> | Organization name (required when --org) | |
--team <team> | Team name within the organization | |
--department <department> | Department within the organization | |
--approver <approver> | Package approver (free-text) | |
--compliance <tags> | Comma-separated compliance tags (e.g., "SOC2,ISO27001") | |
--distribution <policy> | Distribution policy: open, private, or restricted |
Examples
Interactive Mode
When --interactive is passed, the CLI enters a guided flow with smart defaults from package.json, git config, and saved preferences (~/.pair/preferences.json). Requires a TTY.
Org Template
When --org is active, the CLI looks for .pair/org-template.json to pre-fill defaults. CLI flags override template values.
kb-info
Display metadata from a KB package ZIP file.
Usage
Options
| Option | Description |
|---|---|
--json | Output package metadata as JSON format |
--log-level <level> | Set minimum log level (debug, info, warn, error) |
Examples
kb-verify
Verify KB package integrity before installation or distribution. Validates checksum (SHA-256), structure, and manifest.
Usage
Options
| Option | Description |
|---|---|
--json | Output verification report as JSON format |
--log-level <level> | Set minimum log level (debug, info, warn, error) |
Verification Checks
- Checksum (SHA-256): Validates content integrity
- Structure: Confirms registry directories exist per config.json
- Manifest: Validates required fields and metadata
Examples
kb validate
Validate KB structure, links, and metadata using layout-aware validation.
Usage
Options
| Option | Description |
|---|---|
--layout <mode> | Layout mode: source or target (default: target) |
--strict | Enable external link checking via HTTP HEAD (slow) |
--ignore-config | Skip config-based registry structure validation |
--skip-registries <list> | Comma-separated registry names to exclude from validation |
--log-level <level> | Set logging level (trace, debug, info, warn, error) |
Examples
validate-config
Validate asset registry configuration file.
Usage
Options
| Option | Short | Description |
|---|---|---|
--config <file> | -c | Path to config.json file to validate (default: config.json) |
What Gets Validated
- Asset registry structure (required fields:
behavior,target_path,description) - Behavior values (must be:
mirror,add,overwrite,skip) - Target path validity
- Transform configuration
- Source path existence (if specified)
Examples
Global Options
Options available for all commands:
| Option | Description |
|---|---|
--help | Display help for command |
--version | Display CLI version |
--log-level <level> | Set global logging level (trace, debug, info, warn, error) |
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Validation error or command failure |
2 | Download/packaging error |
3 | File system error (disk full, permission denied) |
Related
- CLI Help Examples — Copy-paste ready command examples
- KB Source Resolution Spec — Technical specification for KB source resolution
- CLI Contracts Spec — Technical contracts and validation rules
- pair-cli README — Full CLI reference including installation methods, architecture, and developer guide