Publishing Guide

Learn how to create and publish packages to the PascalAI Package Registry.

Contents

  1. Create a Publisher Account
  2. Package Structure
  3. Writing pai.package
  4. Package Types: PAI vs CLib
  5. Publishing a Package
  6. Updating a Package
  7. Publishing Guidelines

1. Create a Publisher Account

1

Register via web or CLI

Go to /register to create your account through the browser, or run:

ppm register

You will receive an API key. Save it — it is shown only once.

2

Authenticate the CLI

ppm login

Paste your API key when prompted. It is stored in ~/.ppm/config.

2. Package Structure

A PPM package is a .paipkg file — a ZIP archive with:

mypackage/
  pai.package      <- manifest (required)
  mypackage.pai    <- source file(s)
  README.md        <- optional but recommended

The archive must contain pai.package at the root level.

3. Writing pai.package

The manifest is an INI-format file:

[package]
name     = my-package
version  = 1.0.0
author   = yourusername
type     = pai
category = utilities
description = Short one-line description of what this package does.

[dependencies]
; list other packages this one requires
json-parser = 1.0.0
FieldRequiredDescription
nameYesLowercase, hyphens allowed. Must be unique in the registry.
versionYesSemantic version: MAJOR.MINOR.PATCH
authorYesYour registered username.
typeYespai or clib (see below)
categoryYesOne of the categories listed on the package index.
descriptionYesOne sentence, max 200 characters.
[dependencies]Noname = version pairs of required packages.

4. Package Types

PAI CLib

PAI packages

Written in PascalAI and distributed as source code. These are the most common type. All standard functionality, AI features, and pure-Pascal algorithms belong here.

CLib packages

Wrap a native C library (e.g. libpq, zlib, sqlite3). They include platform-specific compiled artifacts or FFI bindings. Use type = clib only when a native library integration is required.

Tip:

When in doubt, use type = pai. CLib packages require more packaging effort and limit portability.

5. Publishing a Package

1

Initialize a new package

mkdir my-package
cd my-package
ppm init

This creates a starter pai.package manifest in the current directory.

2

Add your source files

Place your .pai source files in the directory. The main file should share the name of your package.

3

Publish

ppm publish --dir ./my-package

PPM will zip the directory, validate the manifest, and upload to the registry. On success it prints the package URL.

Note:

The maximum package size is 50 MB. Do not include build artifacts, compiled binaries, or large data files in the package.

6. Updating a Package

Bump the version field in pai.package and run ppm publish again. Versions must increase monotonically — you cannot re-publish an existing version.

; pai.package — bump from 1.0.0 to 1.1.0
version = 1.1.0
ppm publish --dir ./my-package

7. Publishing Guidelines

Questions?

Open an issue at github.com/pascalai/ppm or email registry@pascalai.org.