version
Display the version of the packc compiler.
Synopsis
Section titled “Synopsis”packc versionDescription
Section titled “Description”The version command displays the current version of the packc compiler. This is useful for:
- Verifying installation
- Checking compatibility with pack format versions
- Reporting issues or bugs
- Ensuring consistent builds across environments
- Documenting build environments
The version follows semantic versioning (MAJOR.MINOR.PATCH) and is embedded in compiled packs to track which compiler version was used.
packc versionOutput:
packc v0.1.0Version Format
Section titled “Version Format”PackC uses semantic versioning with the format vMAJOR.MINOR.PATCH:
- MAJOR - Incompatible API changes or pack format changes
- MINOR - New functionality in a backwards-compatible manner
- PATCH - Backwards-compatible bug fixes
Example versions:
v0.1.0- Initial development releasev1.0.0- First stable releasev1.1.0- Added new featuresv1.1.1- Bug fixes only
Compiler Version in Packs
Section titled “Compiler Version in Packs”When packc compiles a pack, it embeds the compiler version in the pack metadata:
{ "id": "customer-support", "version": "1.0.0", "compiler_version": "packc-v0.1.0", "prompts": { ... }, "metadata": { "compiled_at": "2025-01-16T10:30:00Z", "compiler_version": "packc-v0.1.0" }}This allows you to:
- Track which compiler built each pack
- Ensure compatibility with SDK versions
- Reproduce builds with the same compiler
- Audit pack provenance
Examples
Section titled “Examples”Check Version
Section titled “Check Version”$ packc versionpackc v0.1.0Verify Installation
Section titled “Verify Installation”# Check if packc is installedif command -v packc &> /dev/null; then echo "packc is installed: $(packc version)"else echo "packc is not installed"fiOutput:
packc is installed: packc v0.1.0Version in Scripts
Section titled “Version in Scripts”#!/bin/bash# check-packc-version.sh
required_version="v0.1.0"installed_version=$(packc version | cut -d' ' -f2)
if [ "$installed_version" = "$required_version" ]; then echo "✓ Correct packc version: $installed_version"else echo "✗ Version mismatch: required $required_version, found $installed_version" exit 1fiDocument Build Environment
Section titled “Document Build Environment”# Create build info filecat > build-info.txt <<EOFBuild Information=================Compiler: $(packc version)Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")Host: $(hostname)User: $(whoami)Git Commit: $(git rev-parse --short HEAD)EOFIntegration
Section titled “Integration”CI/CD Version Check
Section titled “CI/CD Version Check”# .github/workflows/verify-compiler.ymlname: Verify Compiler Version
on: [push, pull_request]
jobs: verify: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3
- name: Install packc run: go install github.com/AltairaLabs/PromptKit/tools/packc@latest
- name: Check version run: | version=$(packc version) echo "Installed: $version" echo "PACKC_VERSION=$version" >> $GITHUB_ENV
- name: Verify minimum version run: | required="v0.1.0" if [[ "$PACKC_VERSION" < "packc $required" ]]; then echo "Error: packc version must be at least $required" exit 1 fiMakefile Version Check
Section titled “Makefile Version Check”.PHONY: check-versioncheck-version: @echo "Checking packc version..." @version=$$(packc version 2>/dev/null); \ if [ $$? -eq 0 ]; then \ echo "✓ Found: $$version"; \ else \ echo "✗ packc not installed"; \ exit 1; \ fi
.PHONY: build-with-versionbuild-with-version: check-version @version=$$(packc version | cut -d' ' -f2); \ echo "Building with packc $$version"; \ packc compile --config arena.yaml --output "packs/app-$$version.pack.json" --id appDocker Version Check
Section titled “Docker Version Check”# DockerfileFROM golang:1.22 AS builder
RUN go install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Verify installationRUN packc version
FROM alpine:latestCOPY --from=builder /go/bin/packc /usr/local/bin/packcRUN packc versionVersion Matrix Testing
Section titled “Version Matrix Testing”# .github/workflows/test-versions.ymlname: Test Multiple Versions
on: [push]
jobs: test: strategy: matrix: packc-version: ['v0.1.0', 'v0.2.0', 'latest']
runs-on: ubuntu-latest steps: - uses: actions/checkout@v3
- name: Install specific packc version run: | if [ "$" = "latest" ]; then go install github.com/AltairaLabs/PromptKit/tools/packc@latest else go install github.com/AltairaLabs/PromptKit/tools/packc@$ fi
- name: Show version run: packc version
- name: Compile packs run: | packc compile --config arena.yaml --output packs/test.pack.json --id test packc validate packs/test.pack.jsonTroubleshooting
Section titled “Troubleshooting”Command Not Found
Section titled “Command Not Found”$ packc versionbash: packc: command not foundSolution: Install packc or add to PATH:
# Install from sourcego install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Or add to PATHexport PATH="$PATH:/path/to/packc"Wrong Version Installed
Section titled “Wrong Version Installed”$ packc versionpackc v0.0.9Solution: Update to latest version:
go install github.com/AltairaLabs/PromptKit/tools/packc@latestVersion Mismatch in CI
Section titled “Version Mismatch in CI”Error: Pack compiled with packc v0.2.0 but SDK expects v0.1.0Solution: Pin packc version in CI:
- name: Install packc run: go install github.com/AltairaLabs/PromptKit/tools/packc@v0.1.0Version Compatibility
Section titled “Version Compatibility”Pack Format Versions
Section titled “Pack Format Versions”| PackC Version | Pack Format | SDK Compatibility |
|---|---|---|
| v0.1.0 | 1.0 | SDK v0.1.x |
| v0.2.0 | 1.1 | SDK v0.2.x |
| v1.0.0 | 2.0 | SDK v1.x |
Checking Compatibility
Section titled “Checking Compatibility”# Check pack format versionpackc inspect packs/app.pack.json | grep "Pack Format"
# Check SDK compatibilitygo list -m github.com/AltairaLabs/PromptKit/sdkUpgrading
Section titled “Upgrading”When upgrading packc:
- Check changelog for breaking changes
- Update in development environment first
- Test compilation of existing packs
- Validate with SDK version
- Update CI/CD environment
- Document version in project
# Save current versioncurrent_version=$(packc version)echo "$current_version" > .packc-version
# Upgradego install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Testpackc compile --config arena.yaml --output /tmp/test.pack.json --id testpackc validate /tmp/test.pack.jsonBest Practices
Section titled “Best Practices”1. Document Required Version
Section titled “1. Document Required Version”Create a .tool-versions file:
packc v0.1.0Or in README:
## Requirements
- Go 1.22+- packc v0.1.0+2. Pin Versions in CI/CD
Section titled “2. Pin Versions in CI/CD”# Always use specific version in CI- name: Install packc run: go install github.com/AltairaLabs/PromptKit/tools/packc@v0.1.03. Check Version Before Building
Section titled “3. Check Version Before Building”#!/bin/bashrequired="v0.1.0"installed=$(packc version | cut -d' ' -f2)
if [ "$installed" != "$required" ]; then echo "Warning: Expected packc $required, found $installed" exit 1fi4. Include in Build Output
Section titled “4. Include in Build Output”echo "Compiled with $(packc version)" >> packs/build-info.txtSee Also
Section titled “See Also”- compile command - Main compilation command
- inspect command - View pack metadata including compiler version
- Installation Guide - Install packc
- SDK Compatibility - SDK version requirements