Skip to content

version

Display the version of the packc compiler.

Terminal window
packc version

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.

Terminal window
packc version

Output:

packc v0.1.0

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 release
  • v1.0.0 - First stable release
  • v1.1.0 - Added new features
  • v1.1.1 - Bug fixes only

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
Terminal window
$ packc version
packc v0.1.0
Terminal window
# Check if packc is installed
if command -v packc &> /dev/null; then
echo "packc is installed: $(packc version)"
else
echo "packc is not installed"
fi

Output:

packc is installed: packc v0.1.0
#!/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 1
fi
Terminal window
# Create build info file
cat > build-info.txt <<EOF
Build 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)
EOF
# .github/workflows/verify-compiler.yml
name: 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
fi
.PHONY: check-version
check-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-version
build-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 app
# Dockerfile
FROM golang:1.22 AS builder
RUN go install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Verify installation
RUN packc version
FROM alpine:latest
COPY --from=builder /go/bin/packc /usr/local/bin/packc
RUN packc version
# .github/workflows/test-versions.yml
name: 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.json
Terminal window
$ packc version
bash: packc: command not found

Solution: Install packc or add to PATH:

Terminal window
# Install from source
go install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Or add to PATH
export PATH="$PATH:/path/to/packc"
Terminal window
$ packc version
packc v0.0.9

Solution: Update to latest version:

Terminal window
go install github.com/AltairaLabs/PromptKit/tools/packc@latest
Error: Pack compiled with packc v0.2.0 but SDK expects v0.1.0

Solution: Pin packc version in CI:

- name: Install packc
run: go install github.com/AltairaLabs/PromptKit/tools/packc@v0.1.0
PackC VersionPack FormatSDK Compatibility
v0.1.01.0SDK v0.1.x
v0.2.01.1SDK v0.2.x
v1.0.02.0SDK v1.x
Terminal window
# Check pack format version
packc inspect packs/app.pack.json | grep "Pack Format"
# Check SDK compatibility
go list -m github.com/AltairaLabs/PromptKit/sdk

When upgrading packc:

  1. Check changelog for breaking changes
  2. Update in development environment first
  3. Test compilation of existing packs
  4. Validate with SDK version
  5. Update CI/CD environment
  6. Document version in project
Terminal window
# Save current version
current_version=$(packc version)
echo "$current_version" > .packc-version
# Upgrade
go install github.com/AltairaLabs/PromptKit/tools/packc@latest
# Test
packc compile --config arena.yaml --output /tmp/test.pack.json --id test
packc validate /tmp/test.pack.json

Create a .tool-versions file:

packc v0.1.0

Or in README:

## Requirements
- Go 1.22+
- packc v0.1.0+
# Always use specific version in CI
- name: Install packc
run: go install github.com/AltairaLabs/PromptKit/tools/packc@v0.1.0
#!/bin/bash
required="v0.1.0"
installed=$(packc version | cut -d' ' -f2)
if [ "$installed" != "$required" ]; then
echo "Warning: Expected packc $required, found $installed"
exit 1
fi
Terminal window
echo "Compiled with $(packc version)" >> packs/build-info.txt