PAX Package Manager
PAX Package Manager Manual
PAX is the official package manager for XCX, integrated directly into the xcx binary. It manages dependencies, project scaffolding, registry publishing, and build automation.
Project Configuration: project.pax
Every PAX project must have a project.pax file in its root directory. It uses a custom declarative format.
Fields
| Field | Required | Description |
|---|---|---|
name | Yes | Logical name of the project/package. |
version | Yes | Semantic version string (e.g. "1.0.0"). |
author | No | Author name, shown on the registry. |
description | No | Short description of the project. |
main | No | Custom entry point. Defaults to src/main.xcx if omitted. |
tags | No | List of tags for registry discoverability. |
files | No | Explicit list of files to include when publishing. If omitted, PAX excludes known non-code files automatically. |
deps | No | List of dependencies. Supports versioned names, author/repo shortcuts, and direct URLs. |
Dependency Formats
Lock File: pax.lock
PAX automatically maintains a pax.lock file after each install. It records the exact resolved version and local path of every installed dependency.
- Do not edit
pax.lockmanually. - Commit it to version control for reproducible builds.
Directory Structure
A standard PAX project follows this layout:
Command Reference
PAX is invoked via xcx pax <command>.
| Command | Description |
|---|---|
xcx pax new <name> | Scaffold a new project structure. |
xcx pax install | Fetch all dependencies into lib/. |
xcx pax add <dep> | Add a dependency and install it immediately. |
xcx pax remove <name> | Remove a dependency from project.pax. |
xcx pax clone <package> | Download a published package as a local project. |
xcx pax run [path] | Execute the project entry point. |
xcx pax search <query> | Search the registry for available packages. |
xcx pax upgrade <target> | Upgrade the local XCX installation (xcx, tools, or all). |
xcx pax login <token> | Store a registry authentication token. |
xcx pax logout | Remove the stored authentication token. |
xcx pax whoami | Verify your current registry account. |
xcx pax publish | Publish the project to the PAX registry. |
Command Details
xcx pax new <name>
Scaffolds a new project with the standard directory layout.
Creates:
xcx pax install
Reads project.pax, resolves all deps, and downloads them into lib/. Skips packages already present (by name).
- Only installs files declared in the dependency's own
filesfield. - If the dependency has no
filesfield, PAX automatically excludesREADME.md,LICENSE,tests/,docs/,.git*, andproject.pax. - Updates
pax.lockafter each successful fetch.
xcx pax add <dep>
Adds a dependency to project.pax and immediately runs install.
xcx pax remove <name>
Removes a dependency entry from project.pax.
Note: lib/ folders and pax.lock entries are not automatically cleaned up. Re-run xcx pax install or remove them manually.
xcx pax clone <package>
Downloads a published package from the PAX registry as a full local project, ready to run or modify.
- Creates a directory named after the package in the current working directory.
- Copies the full project structure including
project.pax,src/, and all declared files. - Does not install dependencies automatically.
Typical workflow:
xcx pax run [path]
Executes the project. Entry point resolution order:
1. Path provided as argument (e.g. xcx pax run other/main.xcx)
2. main field in project.pax
3. Default: src/main.xcx
xcx pax search <query>
Searches the PAX registry for packages matching the query.
Output format:
xcx pax upgrade <target>
Upgrades the local XCX installation itself, separate from project dependency management. Pulls release artifacts from the official GitHub releases.
<target> is required. Running xcx pax upgrade with no target prints an error:
#### --check
Add --check to any of the three targets to only compare the local version against the latest GitHub release tag and print the result, without downloading or installing anything.
#### Install layout
tools (pax, stdlib, docs) installs into lib/ next to the xcx binary itself - this is a global, installation-level directory, distinct from a project's own lib/ (which holds dependencies declared in that project's project.pax). Upgrading tools does not touch project-level dependencies.
Note: Downgrading to a specific older version is not currently supported.
xcx pax login <token>
Stores a registry authentication token locally in .pax_token.
xcx pax logout
Removes the stored authentication token.
xcx pax whoami
Verifies your current registry session and prints your account info.
xcx pax publish
Publishes the current project to the PAX registry. Requires login.
- Reads
project.paxfor metadata (name,version,description). - Scans and uploads all project files (excluding
.zip,.pax_token,.git). - Sends a compressed archive + file manifest to the registry.
Note: Bump version in project.pax before each publish. The registry may reject duplicate versions.
Registry Configuration
By default PAX connects to pax.xcxlang.com. You can override this via a .pax_config file in the project root:
- HTTP is used automatically for
localhostand127.0.0.1. - HTTPS is used for all other hosts.