DOCUMENTATION

PAX Package Manager

DOCUMENTATION

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.

$ pax
_ ⛶ ×
1---
2PAX Project Configuration
3*---
4/
5 name :: "my_project",
6 version :: "1.0.0",
7 author :: "yourname",
8 description :: "A short description of the project",
9 main :: "src/main.xcx",
10 tags :: ["tag1", "tag2"],
11 files :: ["src/main.xcx", "src/lib.xcx"],
12 deps :: [
13 "somelib@1.0.0",
14 "author/repo@latest",
15 "https://example.com/lib.xcx"
16 ]
17/

Fields

FieldRequiredDescription
nameYesLogical name of the project/package.
versionYesSemantic version string (e.g. "1.0.0").
authorNoAuthor name, shown on the registry.
descriptionNoShort description of the project.
mainNoCustom entry point. Defaults to src/main.xcx if omitted.
tagsNoList of tags for registry discoverability.
filesNoExplicit list of files to include when publishing. If omitted, PAX excludes known non-code files automatically.
depsNoList of dependencies. Supports versioned names, author/repo shortcuts, and direct URLs.

Dependency Formats

$ pax
_ ⛶ ×
1deps :: [
2 "mylib@1.0.0", --- versioned registry package
3 "mylib@latest", --- latest registry package
4 "author/mylib@2.1.0", --- with author prefix
5 "https://example.com/lib.xcx" --- direct URL
6]

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.

$ json
_ ⛶ ×
1{
2 "mylib": { "version": "mylib@1.0.0", "file": "lib/mylib/" },
3 "otherlib": { "version": "otherlib@latest", "file": "lib/otherlib/" }
4}
  • Do not edit pax.lock manually.
  • Commit it to version control for reproducible builds.

Directory Structure

A standard PAX project follows this layout:

$ text
_ ⛶ ×
1my_project/
2├── project.pax # Project configuration
3├── pax.lock # Auto-generated lockfile
4├── src/
5│ └── main.xcx # Main entry point
6├── lib/ # Installed dependencies (managed by PAX)
7└── tests/ # Project-specific tests

Command Reference

PAX is invoked via xcx pax <command>.

CommandDescription
xcx pax new <name>Scaffold a new project structure.
xcx pax installFetch 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 logoutRemove the stored authentication token.
xcx pax whoamiVerify your current registry account.
xcx pax publishPublish the project to the PAX registry.

Command Details

xcx pax new <name>

Scaffolds a new project with the standard directory layout.

$ sh
_ ⛶ ×
1xcx pax new my_project

Creates:

$ text
_ ⛶ ×
1my_project/
2├── project.pax
3├── src/
4│ └── main.xcx
5└── README.md

xcx pax install

Reads project.pax, resolves all deps, and downloads them into lib/. Skips packages already present (by name).

$ sh
_ ⛶ ×
1xcx pax install
  • Only installs files declared in the dependency's own files field.
  • If the dependency has no files field, PAX automatically excludes README.md, LICENSE, tests/, docs/, .git*, and project.pax.
  • Updates pax.lock after each successful fetch.

xcx pax add <dep>

Adds a dependency to project.pax and immediately runs install.

$ sh
_ ⛶ ×
1xcx pax add mylib@1.0.0
2xcx pax add author/mylib@latest

xcx pax remove <name>

Removes a dependency entry from project.pax.

$ sh
_ ⛶ ×
1xcx pax remove mylib

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.

$ sh
_ ⛶ ×
1xcx pax clone snake_game
2xcx pax clone author/snake_game
  • 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:

$ sh
_ ⛶ ×
1xcx pax clone snake_game
2cd snake_game
3xcx pax install
4xcx pax run

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

$ sh
_ ⛶ ×
1xcx pax run
2xcx pax run src/alt.xcx

xcx pax search <query>

Searches the PAX registry for packages matching the query.

$ sh
_ ⛶ ×
1xcx pax search json

Output format:

$ text
_ ⛶ ×
1- json_utils (v1.2.0) by alice
2- fast_json (v0.9.1) by bob

xcx pax upgrade <target>

Upgrades the local XCX installation itself, separate from project dependency management. Pulls release artifacts from the official GitHub releases.

$ sh
_ ⛶ ×
1xcx pax upgrade xcx --- upgrade only the xcx binary (compiler/VM/JIT, includes REPL)
2xcx pax upgrade tools --- upgrade only pax, stdlib, and docs (installed under lib/ next to the binary)
3xcx pax upgrade all --- upgrade both xcx and tools

<target> is required. Running xcx pax upgrade with no target prints an error:

$ text
_ ⛶ ×
1Error: specify what to upgrade: xcx, tools, all

#### --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.

$ sh
_ ⛶ ×
1xcx pax upgrade xcx --check
2xcx pax upgrade tools --check
3xcx pax upgrade all --check

#### 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.

$ text
_ ⛶ ×
1<xcx install directory>/
2├── xcx --- binary (source)
3└── lib/ --- pax, stdlib, docs (tools)

Note: Downgrading to a specific older version is not currently supported.

xcx pax login <token>

Stores a registry authentication token locally in .pax_token.

$ sh
_ ⛶ ×
1xcx pax login your_token_here

xcx pax logout

Removes the stored authentication token.

$ sh
_ ⛶ ×
1xcx pax logout

xcx pax whoami

Verifies your current registry session and prints your account info.

$ sh
_ ⛶ ×
1xcx pax whoami
2# Account: alice [developer]

xcx pax publish

Publishes the current project to the PAX registry. Requires login.

$ sh
_ ⛶ ×
1xcx pax publish
  • Reads project.pax for 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:

$ json
_ ⛶ ×
1{
2 "registry": "https://my-custom-registry.example.com"
3}
  • HTTP is used automatically for localhost and 127.0.0.1.
  • HTTPS is used for all other hosts.