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-cli install --list-targets

Output:

  Asset Registries

  github
    target:   .github
    behavior: mirror
    GitHub workflows and configuration files

  knowledge
    target:   .pair/knowledge
    behavior: mirror
    Knowledge base and documentation

  adoption
    target:   .pair/adoption
    behavior: add
    Adoption guides and onboarding materials

  agents
    target:   AGENTS.md
    behavior: mirror
    AI agents guidance and session context

  skills
    target:   .claude/skills/
    behavior: overwrite
    Agent skills distributed to AI tool directories

  workflows
    target:   .claude/workflows/
    behavior: overwrite
    Batch orchestration workflows (Claude Code only; inert elsewhere)

  agent-definitions
    target:   .claude/agents/
    behavior: overwrite
    Agent execution layer the workflows dispatch to (pair-implementer, pair-reviewer, pair-contract-generator)
# Step 2: Install with defaults
pair-cli install

2. Install to Custom Directory

pair-cli install ./custom-docs

3. Install Specific Registries Only

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

4. Install from Custom KB Source (Remote)

pair-cli 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-cli install --source /home/user/kb-content
 
# Use relative path to local KB
pair-cli install --source ./local-kb

6. Offline Installation (Air-Gapped Environment)

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

Update Workflows

7. Update Existing Installation

pair-cli update

8. Update Specific Registry

pair-cli update knowledge:.pair

9. Update from Custom Source

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

Validation Workflows

pair-cli kb-validate

11. Validate with Zero Tolerance

pair-cli kb-validate --strict

Every missing internal target is an error and any declared optional link patterns are discarded. It checks no external links: the CLI makes no network requests, so http/https links are never fetched, with or without --strict.

12. Validate Source Layout

pair-cli kb-validate --layout source

13. Validate Excluding Registries

pair-cli kb-validate --skip-registries github,adoption

14. Validate Without Config

pair-cli kb-validate --ignore-config

No config is consulted, so no registry resolves, no file is collected and nothing is validated, structure, links and metadata are all skipped, and the run says so with a Configuration: notice. Use it to skip validation, not to run with CLI-only patterns.

15. Validate Default Configuration

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

16. Validate Custom Configuration

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

Packaging Workflows

20. Package KB for Distribution

pair-cli package

21. Package with Custom Output Path

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

22. Package with Metadata

pair-cli package \
  --name "Company Knowledge Base" \
  --pkg-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-cli package -s ./kb-content -o kb.zip --log-level debug

24. Package Excluding Registries

pair-cli package --skip-registries adoption,github

25. Interactive Package Creation

pair-cli package --interactive

26. Organizational Package

pair-cli 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-cli kb-info dist/kb-v1.0.0.zip

28. Verify Package Integrity

pair-cli 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-cli kb-verify dist/kb-v1.2.0.zip --json

30. Verify Before Installation

# Complete workflow: verify then install
pair-cli kb-verify downloaded-kb.zip && pair-cli 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-cli validate-config || exit 1
 
# Step 2: Install KB from specific release
pair-cli install --source https://github.com/org/repo/releases/download/v1.2.0/kb.zip || exit 1
 
# Step 3: Validate and fix links
pair-cli update-link || exit 1
 
# Step 4: Package for distribution
pair-cli package --name "Production KB" --pkg-version "1.2.0" -o dist/kb-production-v1.2.0.zip || exit 1
 
# Step 5: Verify package integrity
pair-cli 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-cli install --offline --source ./kb-content

33. Multi-Environment Setup

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

Monorepo usage

When pair-cli is a dependency of a package inside a monorepo, run it with pnpm --filter from the root; the CLI reads INIT_CWD so the output lands at the monorepo root, not in the filtered package:

pnpm --filter pair-cli dev update .

Setup scripts and CI

#!/bin/bash
# setup.sh
pnpm install
pnpm dlx pair-cli install
pnpm dlx pair-cli update-link --dry-run
# .github/workflows/ci.yml
- name: Install pair assets
  run: |
    npm install -g @foomakers/pair-cli
    pair-cli install

Maintenance after an update

pair-cli update
pair-cli update-link --dry-run
pair-cli update-link
git add .pair/
git commit -m "chore: update KB content and fix links"

Try it in a temporary directory

mkdir /tmp/pair-test && cd /tmp/pair-test
pair-cli install
cd - && rm -rf /tmp/pair-test