inspect
Display detailed information about a compiled pack file.
Synopsis
Section titled “Synopsis”packc inspect <pack-file>Description
Section titled “Description”The inspect command displays comprehensive information about a pack’s structure, contents, and metadata. Use this to understand what’s inside a pack without manually parsing the JSON.
Arguments
Section titled “Arguments”<pack-file> (required)
- Path to the pack file to inspect
- Must be a
.pack.jsonfile
Examples
Section titled “Examples”Basic Inspection
Section titled “Basic Inspection”packc inspect packs/app.pack.jsonOutput:
=== Pack Information ===Pack: Customer Support AssistantID: customer-supportVersion: 1.0.0Description: AI-powered customer support system
Template Engine: go
=== Prompts (3) ===
1. customer-support System: You are a helpful customer support agent... Variables: customer_name, order_id, issue_type Tools: search_kb, create_ticket Parameters: temperature=0.7, max_tokens=1000
2. sales-assistant System: You are a sales assistant... Variables: product_name, price Tools: search_products, get_inventory Parameters: temperature=0.8, max_tokens=800
3. technical-expert System: You are a technical expert... Variables: product_id, error_code Tools: search_docs, run_diagnostics Parameters: temperature=0.5, max_tokens=1500
Shared Fragments (2): greeting, signature
Pack Metadata: Domain: customer-service Language: en Tags: [support, production]
Compilation: packc-v0.1.0, 2024-01-15T10:30:00Z, Schema: 1.0Pipe to File
Section titled “Pipe to File”packc inspect packs/app.pack.json > pack-info.txtInspect Multiple Packs
Section titled “Inspect Multiple Packs”for pack in packs/*.pack.json; do echo "=== $pack ===" packc inspect "$pack" echo ""doneOutput Sections
Section titled “Output Sections”Pack Information
Section titled “Pack Information”Basic pack metadata:
Pack: Name of the packID: unique-identifierVersion: 1.0.0Description: Pack descriptionTemplate Engine
Section titled “Template Engine”Template system used:
Template Engine: goCurrently only go templates are supported.
Prompts
Section titled “Prompts”Detailed information for each prompt:
1. prompt-name System: System prompt text (truncated) Variables: var1, var2, var3 Tools: tool1, tool2 Parameters: temperature=0.7, max_tokens=1000Shared Fragments
Section titled “Shared Fragments”Reusable prompt fragments:
Shared Fragments (2): greeting, signaturePack Metadata
Section titled “Pack Metadata”Additional pack information:
Pack Metadata: Domain: customer-service Language: en Tags: [support, production]Compilation Info
Section titled “Compilation Info”Build details:
Compilation: packc-v0.1.0, 2024-01-15T10:30:00Z, Schema: 1.0Use Cases
Section titled “Use Cases”1. Quick Pack Summary
Section titled “1. Quick Pack Summary”packc inspect packs/app.pack.json | head -n 102. Find Available Prompts
Section titled “2. Find Available Prompts”packc inspect packs/app.pack.json | grep -A 5 "=== Prompts"3. Check Pack Version
Section titled “3. Check Pack Version”packc inspect packs/app.pack.json | grep "Version:"4. List All Tools
Section titled “4. List All Tools”packc inspect packs/app.pack.json | grep "Tools:" | sort -u5. Compare Packs
Section titled “5. Compare Packs”diff <(packc inspect packs/v1.pack.json) <(packc inspect packs/v2.pack.json)6. Document Pack Contents
Section titled “6. Document Pack Contents”# Generate documentationpackc inspect packs/prod.pack.json > docs/pack-contents.mdExit Codes
Section titled “Exit Codes”0- Success1- Error (pack not found, invalid format, etc.)
Common Errors
Section titled “Common Errors”Pack Not Found
Section titled “Pack Not Found”$ packc inspect missing.pack.jsonError loading pack: open missing.pack.json: no such file or directorySolution: Check file path is correct
Invalid Pack Format
Section titled “Invalid Pack Format”$ packc inspect invalid.jsonError loading pack: invalid pack formatSolution: Ensure file is a valid pack (use validate first)
Integration Examples
Section titled “Integration Examples”Pre-deployment Check
Section titled “Pre-deployment Check”#!/bin/bash# Check pack before deploying
echo "Inspecting pack..."packc inspect packs/prod.pack.json
read -p "Deploy this pack? (y/n) " -n 1 -rechoif [[ $REPLY =~ ^[Yy]$ ]]; then ./deploy.sh packs/prod.pack.jsonfiPack Comparison Script
Section titled “Pack Comparison Script”#!/bin/bash# Compare two pack versions
OLD_PACK=$1NEW_PACK=$2
echo "=== Old Pack ==="packc inspect "$OLD_PACK"
echo ""echo "=== New Pack ==="packc inspect "$NEW_PACK"
echo ""echo "=== Differences ==="diff <(packc inspect "$OLD_PACK") <(packc inspect "$NEW_PACK")Pack Inventory
Section titled “Pack Inventory”#!/bin/bash# Generate inventory of all packs
echo "# Pack Inventory" > inventory.mdecho "" >> inventory.md
for pack in packs/*.pack.json; do echo "## $(basename $pack)" >> inventory.md packc inspect "$pack" | head -n 20 >> inventory.md echo "" >> inventory.mddoneBest Practices
Section titled “Best Practices”1. Inspect Before Using
Section titled “1. Inspect Before Using”Always inspect new packs:
packc inspect unknown.pack.json2. Document Pack Contents
Section titled “2. Document Pack Contents”Keep pack documentation up-to-date:
packc inspect packs/app.pack.json > docs/PACK.mdgit add docs/PACK.mdgit commit -m "docs: update pack documentation"3. Verify After Download
Section titled “3. Verify After Download”Inspect downloaded packs:
curl -O https://example.com/packs/app.pack.jsonpackc inspect app.pack.jsonpackc validate app.pack.json4. Compare Environments
Section titled “4. Compare Environments”# Compare dev vs proddiff <(packc inspect packs/app.dev.pack.json) \ <(packc inspect packs/app.prod.pack.json)See Also
Section titled “See Also”- compile - Compile packs
- validate - Validate packs
- How to Work with Packs