Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<a href="#documentation">Docs</a>
</p>

> **Coming from PGX?** PGX is now PGBoxDB: same runtime, new name. Install
> PGBoxDB (`curl -fsSL https://pgboxdb.com/install | sh` or `npx pgboxdb@latest`),
> then run `pgboxdb migrate` to keep your databases. The `pgx` command, the
> `pgxdb` npm package and the `pgx` plugin get no more updates.
> [Upgrade guide](docs/pgboxdb/local-dev/upgrading.md).

<p align="center">
<strong>Install one Skill. Your coding agent handles the database.</strong><br>
No Docker required · Native Mac &amp; Linux · Automatic cleanup
Expand Down
1 change: 1 addition & 0 deletions dist/legacy-domain-redirect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ approval. That is not a domain transfer or deletion.
| `pgx-install` | `d1cc0c44-9283-4fd3-9fce-07c9ef118396` | 2026-11-19 20:04:41 | v0.1.3 script, version pinned |
| `pgx-install` | `f7c5157b-6261-4250-9501-a59715f43c0e` | 2026-11-19 20:23 | + 410 after the deadline |
| `pgx-dev-redirect` | `5d1fab37-4514-412c-98e7-0daa5c826709` | 2026-11-19 20:23:25 | + 410 after the deadline, `INSTALLER` binding |
| `pgx-install` | `d3e22ce3-cc1e-4655-b3e2-f4933cbcf489` | 2026-11-23 | + notice on stderr: PGX is now PGBoxDB, how to switch |

Before the transition, `pgx-install` was `44d28964-e04c-4899-927a-105f9e6202ed`
(tag v0.1.0's script, unpinned).
Expand Down
12 changes: 10 additions & 2 deletions dist/legacy-domain-redirect/install/legacy-install-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// version variable (LEGACY_VERSION). Without it the script would install "the
// newest release", which is a PGBoxDB release from v0.2.0 on, whose assets have
// different names, so `curl … | sh` would fail. An explicit version set by the
// user still wins. The installer itself is not changed in any other way.
// user still wins. A second added line prints a notice (to stderr, so it never
// mixes with output a caller parses) that PGX is now PGBoxDB and how to switch.
// The installer itself is not changed in any other way.
//
// It serves only during the authorised transition: from REDIRECT_UNTIL on (or
// if that is missing or invalid) every request gets 410 Gone, so the previous
Expand All @@ -15,12 +17,18 @@ const REPO = "pgrundev/pgboxdb";
const REF_RE = /^v\d+\.\d+\.\d+[0-9A-Za-z.-]*$/;
const VERSION_RE = /^\d+\.\d+\.\d+[0-9A-Za-z.-]*$/;
const VERSION_VAR = "PGX_VERSION"; // the variable the tagged installer reads
export const notice = (version) =>
`PGX is now PGBoxDB. This installs the last PGX release (${version}), which gets no updates.\n` +
"Switch: curl -fsSL https://pgboxdb.com/install | sh then: pgboxdb migrate (https://pgboxdb.com)";

export function pin(script, version) {
const nl = script.indexOf("\n");
if (!script.startsWith("#!") || nl < 0) return null;
const line = `${VERSION_VAR}="\${${VERSION_VAR}:-${version}}" # pinned by the pgx.dev /install Worker\n`;
return script.slice(0, nl + 1) + line + script.slice(nl + 1);
// Single-quoted for the shell. The text has no single quote (the version is
// checked against VERSION_RE first), so nothing in it expands.
const say = `printf '%s\\n' '${notice(version).replace(/\n/g, "' '")}' >&2 # added by the pgx.dev /install Worker\n`;
return script.slice(0, nl + 1) + line + say + script.slice(nl + 1);
}

const text = (status, msg) =>
Expand Down
20 changes: 18 additions & 2 deletions dist/legacy-domain-redirect/install/legacy-install-worker.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// node --test dist/legacy-domain-redirect/install/legacy-install-worker.test.js
import { test } from "node:test";
import assert from "node:assert/strict";
import worker, { pin } from "./legacy-install-worker.js";
import worker, { pin, notice } from "./legacy-install-worker.js";

const SCRIPT = '#!/bin/sh\nset -eu\nversion="${PGX_VERSION:-}"\n';
const END = "2027-02-17T19:58:29Z";
Expand All @@ -21,7 +21,8 @@ test("serves the tagged script with the version default after the shebang", asyn
const lines = (await r.text()).split("\n");
assert.equal(lines[0], "#!/bin/sh");
assert.match(lines[1], /^PGX_VERSION="\$\{PGX_VERSION:-0\.1\.3\}"/);
assert.equal(lines[2], "set -eu");
assert.match(lines[2], /^printf .*PGX is now PGBoxDB.* >&2 /);
assert.equal(lines[3], "set -eu", "the rest of the tagged script is unchanged");
assert.deepEqual(calls, ["https://raw.githubusercontent.com/pgrundev/pgboxdb/v0.1.3/dist/install.sh"]);
});

Expand Down Expand Up @@ -63,3 +64,18 @@ test("from the deadline on, or without one: 410 Gone, upstream never fetched", a
}
assert.equal(calls.length, 0);
});

test("the served script tells the user PGX is now PGBoxDB, on stderr, before installing", async () => {
const { spawnSync } = await import("node:child_process");
const body = pin('#!/bin/sh\necho "installing ${PGX_VERSION}"\n', "0.1.3");
const lines = body.split("\n");
assert.match(lines[1], /^PGX_VERSION=/, "the version default stays on line 2");
assert.match(lines[2], /^printf .* >&2 /, "the notice goes to stderr");
// Run it: stdout is only the installer's own output; stderr has the notice.
const s = spawnSync("sh", ["-c", body], { encoding: "utf8" });
assert.equal(s.stdout, "installing 0.1.3\n");
assert.equal(s.stderr, notice("0.1.3") + "\n");
assert.match(s.stderr, /PGX is now PGBoxDB/);
assert.match(s.stderr, /curl -fsSL https:\/\/pgboxdb\.com\/install \| sh/);
assert.match(s.stderr, /pgboxdb migrate/);
});
6 changes: 4 additions & 2 deletions docs/pgboxdb/local-dev/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ there.
| Before | Now | Note |
|---|---|---|
| `pgx …` | `pgboxdb …` | same subcommands, flags, output and exit codes |
| `npx pgxdb@latest` | `npx pgboxdb@latest` | new package; the old one is not changed by this release |
| `npx pgxdb@latest` | `npx pgboxdb@latest` | new package; `pgxdb` is deprecated and gets no new versions |
| `curl -fsSL https://pgx.dev/install \| sh` | `curl -fsSL https://pgboxdb.com/install \| sh` | the old URL installs the last previous release (0.1.3) with a notice, and stops working on 2027-02-17 |
| `PGX_HOME`, `PGX_PORT`, `PGX_RUN_DIR`, `PGX_DURABILITY`, `PGX_LISTEN`, `PGX_PASSWORD`, `PGX_PG_BINDIR`, `PGX_SOURCE`, `PGX_TTL_INTERVAL`, `PGX_GIT`, `PGX_GIT_SKIP` | `PGBOXDB_…` | the old names are not read; `init`, `run`, `start`, `status`, `doctor` and `migrate` print a note when one is set |
| variables exported into agent sessions and `git exec` (`PGX_AGENT_ID`, `PGX_BRANCH`, `PGX_GIT_BRANCH`, `PGX_ISOLATION`, …) | `PGBOXDB_…` | scripts that read them must be updated |
| `pgx --json version` key `pgx_version`, `share/pgx/dist.json` | `pgboxdb_version`, `share/pgboxdb/dist.json` | |
| new Git databases `pgx_<repo>_…` | `pgboxdb_<repo>_…` | existing databases keep their names and mappings |
| Docker volume `/var/lib/pgx`, image user `pgx` | `/var/lib/pgboxdb`, user `pgboxdb` (same uid 10001) | mount an existing volume at `/var/lib/pgboxdb`; the data inside works unchanged |
| Claude Code plugin `pgx` | plugin `pgboxdb` | install the new plugin; uninstall the old one |
| Claude Code plugin `pgx@pgx-plugin` | `pgboxdb@pgboxdb-plugin` | the old marketplace now serves the new plugin; reinstall: `/plugin uninstall pgx@pgx-plugin`, `/plugin marketplace remove pgx-plugin`, `/plugin marketplace add pgrundev/pgboxdb-plugin`, `/plugin install pgboxdb@pgboxdb-plugin` |
| Agent Skill `--skill pgx` | `npx skills add pgrundev/pgboxdb --skill pgboxdb` | remove the old skill directory (`.claude/skills/pgx`, `.agents/skills/pgx`) after installing the new one |
14 changes: 14 additions & 0 deletions plugins/pgboxdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

One plugin. Every Claude Code agent gets its own Postgres.

> **Coming from PGX?** PGX is now PGBoxDB. The plugin `pgx@pgx-plugin` is
> replaced by this one; reinstall it:
>
> ```text
> /plugin uninstall pgx@pgx-plugin
> /plugin marketplace remove pgx-plugin
> /plugin marketplace add pgrundev/pgboxdb-plugin
> /plugin install pgboxdb@pgboxdb-plugin
> ```
>
> Then install the runtime (`curl -fsSL https://pgboxdb.com/install | sh`) and
> run `pgboxdb migrate` to keep your existing databases. Guide:
> [upgrading](https://github.com/pgrundev/pgboxdb/blob/main/docs/pgboxdb/local-dev/upgrading.md).

PGBoxDB is a local, PostgreSQL-compatible runtime built for disposable databases:
copy-on-write branches created in milliseconds and removed automatically when
their time-to-live runs out. This plugin ships the `pgboxdb` Agent Skill, which
Expand Down
Loading