$ xpb build [<pocketbase_version>]
[--output <file>]
[--with <module[@version][=replacement]>...]
[--config <file>]<pocketbase_version>is the desired version of pocketbase to use. It defaults to the value of the env variableXPB__PB_VERSION, or tolatestif that is not defined.--outputis the output file. Defaults topocketbase.--withadds an xpb plugin (a Go module) to the build. You can pass this flag multiple times. Advanced usage also supports replacing modules for forks.--configis a path to a JSON build config file. CLI flags override config values when both are provided.
Examples
Build the latest PocketBase and include a plugin:
xpb build latest --with github.com/pocketbuilds/fts@latestBuild a pinned PocketBase version and output a named binary:
xpb build v0.26.6 --output pocketbase_custom The --with format
The general form is:
--with <module[@version][=replacement]>Examples:
--with github.com/pocketbuilds/created_by@latest
--with github.com/pocketbuilds/import_export@v0.1.0
--with github.com/pocketbuilds/xpb@latestBuilder Config File
You can use the --config flag to specify a json file to configure your build:
$ xpb build --config=xpb.jsonYour xpb.json file might look like this (use a git tag, “latest” tag, or branch name to specify version):
{
"pocketbase": {
"version": "latest"
},
"xpb": {
"version": "latest"
},
"plugins": [
{
"module": "github.com/pocketbuilds/created_by",
"version": "latest"
},
{
"module": "github.com/pocketbuilds/original_file_names",
"version": "v0.0.2"
},
{
"module": "github.com/pocketbuilds/last_login",
"version": "main"
}
]
}Other optional json field that can be configured:
{
"arch": "amd64",
"os": "linux",
"tags": [],
"ldflags": []
}Reproducible builds
For repeatable builds, pin versions (avoid latest and main) and commit your xpb.json to your repo.