ReferenceCLI

CLI Help Examples

Copy-paste ready examples for common pair-cli workflows with expected output.

Copy-paste ready examples for common pair-cli workflows. All examples include expected output as comments.

Installation Workflows

1. First-time Setup

# Step 1: Discover available registries
pair install --list-targets
 
# Output:
# Available asset registries:
#   github     .github         GitHub workflows and configuration files
#   knowledge  .pair            Knowledge base and documentation
#   adoption   .pair/product/adopted  Adoption guides and onboarding materials
 
# Step 2: Install with defaults
pair install

2. Install to Custom Directory

pair install ./custom-docs

3. Install Specific Registries Only

# Install only GitHub workflows
pair install github:.github
 
# Install multiple specific registries
pair install github:.github knowledge:.pair

4. Install from Custom KB Source (Remote)

pair install --source https://internal-mirror.company.com/kb-v1.2.0.zip

5. Install from Local KB Source

# Use absolute path to local KB
pair install --source /home/user/kb-content
 
# Use relative path to local KB
pair install --source ./local-kb

6. Offline Installation (Air-Gapped Environment)

# Offline mode requires --source with local path
pair install --offline --source ./kb-content
 
# Error if --offline without --source
pair install --offline
# Error: --offline requires --source with local filesystem path

Update Workflows

7. Update Existing Installation

pair update

8. Update Specific Registry

pair update knowledge:.pair

9. Update from Custom Source

pair update --source https://github.com/org/repo/releases/download/v2.0.0/kb.zip

Validation Workflows

pair kb validate
pair kb validate --strict

12. Validate Source Layout

pair kb validate --layout source

13. Validate Excluding Registries

pair kb validate --skip-registries github,adoption

14. Validate Without Config

pair kb validate --ignore-config

15. Validate Default Configuration

pair validate-config
 
# Output:
# Configuration is valid!
# Found 3 asset registries

16. Validate Custom Configuration

pair validate-config --config ./custom-config.json
pair update-link
pair update-link --dry-run
pair update-link --verbose

Packaging Workflows

20. Package KB for Distribution

pair package

21. Package with Custom Output Path

pair package -o dist/kb-v1.2.0.zip

22. Package with Metadata

pair package \
  --name "Company Knowledge Base" \
  --version "1.2.0" \
  --description "Internal documentation and guides" \
  --author "DevOps Team" \
  -o dist/company-kb-v1.2.0.zip

23. Package Specific Source Directory

pair package -s ./kb-content -o kb.zip --log-level debug

24. Package Excluding Registries

pair package --skip-registries adoption,github

25. Interactive Package Creation

pair package --interactive

26. Organizational Package

pair package --org --org-name "Acme Corp" --team "Platform" --department "Engineering" \
  --compliance "SOC2,ISO27001" --distribution private \
  -o dist/acme-kb.zip

Package Info and Verification

27. Display Package Metadata

pair kb-info dist/kb-v1.0.0.zip

28. Verify Package Integrity

pair kb-verify kb-package.zip
 
# Output:
# Package verification passed
#   Checksum: valid (SHA-256)
#   Structure: valid (3 registries found)
#   Manifest: valid (all required fields present)

29. Verify with JSON Output

pair kb-verify dist/kb-v1.2.0.zip --json

30. Verify Before Installation

# Complete workflow: verify then install
pair kb-verify downloaded-kb.zip && pair install --source downloaded-kb.zip

Advanced Workflows

31. Complete CI/CD Pipeline

#!/bin/bash
# CI/CD script for KB installation and validation
 
# Step 1: Validate configuration
pair validate-config || exit 1
 
# Step 2: Install KB from specific release
pair install --source https://github.com/org/repo/releases/download/v1.2.0/kb.zip || exit 1
 
# Step 3: Validate and fix links
pair update-link || exit 1
 
# Step 4: Package for distribution
pair package --name "Production KB" --version "1.2.0" -o dist/kb-production-v1.2.0.zip || exit 1
 
# Step 5: Verify package integrity
pair kb-verify dist/kb-production-v1.2.0.zip || exit 1

32. Air-Gapped Environment Workflow

# Step 1: On internet-connected machine
wget https://github.com/org/repo/releases/download/v1.2.0/kb.zip
 
# Step 2: Transfer kb.zip to air-gapped machine (USB, etc.)
 
# Step 3: On air-gapped machine
unzip kb.zip -d ./kb-content
pair install --offline --source ./kb-content

33. Multi-Environment Setup

# Development environment (use latest from main)
pair install --source https://github.com/org/repo/archive/main.zip
 
# Staging environment (use release candidate)
pair install --source https://github.com/org/repo/releases/download/v1.3.0-rc.1/kb.zip
 
# Production environment (use stable release)
pair install --source https://github.com/org/repo/releases/download/v1.2.0/kb.zip