Download the PHP package knlab/pb-migrate without Composer
On this page you can find all versions of the php package knlab/pb-migrate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pb-migrate
pb-migrate
日本語版 / Japanese
[!WARNING] Pandorabots has shut down its developer hosting platform, so pb-migrate no longer works. In 2026 Pandorabots wound down the hosted bot service and the Developer Portal API (
api.pandorabots.com) that pb-migrate drives through pb-php; its website now carries a "Hosting Service Sunset" notice, and pb-php is abandoned as well. pb-migrate is no longer maintained, and 0.8.1 is its final release.
push,pull,diff,talk, and every other command that calls the API now fail with a connection error. Local commands such asadd,status,alter:*, andreport --since=cachestill run, and your AIML files remain plain files that you can load into another AIML interpreter.To keep running AIML bots, Pandorabots points to open-source AIML interpreters: Program AB (Java, AIML 2.0 reference implementation), Program-Y (Python), aimlinterpreter (Node.js), and community projects such as Program O (PHP) listed under github.com/pandorabots. The AIML specification is at aiml.foundation. Customers who missed the migration window can contact [email protected].
The rest of this README describes the tool as it worked while the service was available.
Command-line tool to manage existing AIML packages on Pandorabots, built on top of spontena/pb-php.
pb-migrate is the OSS rewrite of an in-house deployment CLI. The tool treats your local AIML files as the source of truth, registers existing package directories, and pushes them to Pandorabots' Developer Portal API.
Concepts
- Local registration is the source of truth. A bot must be registered locally (
pb-migrate add) before it can be operated on remotely. Pandorabots-side state never authoritatively drives the local config. - One project = one app_id. A
pb-migrate.jsonfile describes a project; all bots under it share one Pandorabots application ID. Multi-app_id setups are out of scope. - Credentials live in
.env, structure inpb-migrate.json. The JSON file is committable; the.envis gitignored. Both can be edited by the tool. - Default
pushis destructive. It rewrites the remote bot to match local. Pass--keep-remote-onlyto opt out.
Features
add/remove— register or unregister an existing AIML package directoryconfig— interactively edit credentials (.env) for project or per-bot bot_keysbot:list— show registered bots (local, no API call)bot:remote— show bots on the Pandorabots account, annotated with registration statebot:create/bot:delete/bot:files— remote bot lifecycle (require local registration)compile— verify bots on Pandorabotspush— upload local files (destructive: rewrites remote to match local)pull— download remote files into the local directorydiff— show file-level changes (UPD/ADD/DEL grouped, color-coded)report— rich handoff report of pending changesstatus— local sync state vs. cache: files added, edited or deleted since the last push / pull (no API)cat/file:delete— inspect or delete a single remote filetalk/debug/atalk— converse with a bot from the terminaltest— assert bot replies match expected outputsbatch— run a runbook of pb-migrate commandsalter:list/alter:set/alter:unset/alter:reset— persistent file-body overrides for debug-session probes- Run
pb-migratewith no arguments to drop into an interactive REPL
Requirements
- PHP 8.3+ — keep it on the latest patch release of a supported branch
- ext-json
- Composer
pb-migrate 0.8 and later require PHP 8.3 or newer. On PHP 8.1 or 8.2, Composer keeps installs on 0.7.5, the last release that supports them. PHP 8.1 no longer receives security fixes and PHP 8.2 reaches end of life on 31 December 2026, so upgrading PHP is recommended.
Installation
Install globally:
Make sure ~/.composer/vendor/bin (or the equivalent for your Composer setup) is on your $PATH.
Or pin it inside a project:
Quickstart
Configuration
pb-migrate.json holds the project structure (no credentials):
The $schema URL points at the published JSON Schema. VS Code, JetBrains IDEs, and most JSON-aware editors pick it up automatically — autocomplete on field names, hovers explaining what each field does, and instant warnings on typos like directry or invalid propertiesUpload values.
Per-bot fields:
| Field | Required | Default | Notes |
|---|---|---|---|
directory |
yes | — | Path to the AIML package directory; relative to project root |
propertiesUpload |
no | additive |
full to delete remote properties before re-uploading (strict GitOps) |
alters |
no | {} |
Map of canonical name → override file path (debug-session probes; managed by alter:* commands) |
Bot names must be alphanumeric (Pandorabots constraint).
Credentials (.env, tool-managed)
The tool writes a project-local .env (gitignored) using block markers so user-managed lines are preserved:
| Variable | Purpose |
|---|---|
PB_APP_ID |
Pandorabots application ID (required) |
PB_USER_KEY |
Pandorabots user key (required) |
PB_HOST |
API host. Defaults to https://api.pandorabots.com |
PB_BOT_<UPPER_BOTNAME>_KEY |
Per-bot bot_key for atalk. Only the bots that need anonymous talk have one. |
Edit via:
The interactive prompts show the current value; press Enter to keep it,
type a new value to update, or type - to clear an optional field.
A note on atalk and bot_keys
atalk (anonymous talk) requires a per-bot bot_key. Pandorabots issues
bot_keys through their dashboard UI (developer.pandorabots.com), not through
the Developer Portal API.
Heads-up: bots created via the API (pb-migrate bot:create, or anything
else hitting PUT /bot/...) do not appear in the dashboard's bot list
during the API trial / Developer Portal tier we tested against. There seems
to be no API endpoint that returns the bot_key either. The practical
consequence: if you want atalk to work, create the bot on the dashboard
first and pb-migrate add it locally, rather than using bot:create to
spin it up via the API.
talk and debug use the regular user_key authentication and work fine
for either path.
Commands
For --bot, a glob pattern (prod.*) is accepted in addition to an exact bot name. --all operates on every registered bot.
--only takes a comma-separated list of file names (greet), kind/name pairs (file/greet, set/colors), or the bare kind for the two kinds that have no name of their own (properties, pdefaults).
Push semantics
push is destructive by default: it rewrites the remote bot to match local. Files that exist on the remote but not locally are deleted. This matches the "local is source of truth" model — what's on disk is what should be on the bot.
To preserve remote-only files (e.g. files added via the Pandorabots dashboard by other team members), pass --keep-remote-only.
Pandorabots-managed files like udc are never deletable (412 from the API); pb-migrate skips them with a warning regardless of mode.
Pull semantics
pull writes remote files into the local directory, but it will not silently discard work you have not pushed yet. For each file it compares the local SHA-256 with the hash recorded in the local cache at the last successful push or pull:
| Local file | Cache entry | Result |
|---|---|---|
| hash matches cache | yes | overwritten (no local edits since last sync) |
| hash differs from cache | yes | skipped with a warning — you edited it locally |
| exists | none | overwritten (first pull, or a file dropped in manually) |
| missing | — | written |
Pass --force to overwrite regardless. If you want the remote version but also want to keep your edits, diff --bot mybot first, or commit the local directory before pulling.
Local files may live in subdirectories of the bot directory (ja/greet.aiml); Pandorabots' namespace is flat, so the subdirectory is purely a local convention. pull writes into the existing path when a file with the same kind and name is already present, and only falls back to the directory root for files that do not exist locally yet. The arrow in the output shows where each file landed:
Files the server refuses to serve (HTTP 4xx on system-managed files such as udc) are skipped with the server's message — see Error handling.
Diff and report
diff shows file-level changes only — which files differ, in what category — without inline content diffs:
report produces a richer document suitable for handoff notes / PR descriptions:
Both default to comparing against live remote. Pass --since=cache on report to compare against the local cache instead (no API call) — useful for seeing what changed locally since the last push/pull.
Persistent alters (debug-session probes)
--override is great for one-shot tweaks. For longer investigative sessions where you want a few debug probes (a category that dumps internal predicates, one that simulates state, etc.) to re-apply on every push, register them as persistent alters:
alter:list flags missing override paths with [missing!] so a session in flight is visible at a glance.
⚠️ Persistent alters live in
pb-migrate.json, which is typically committed. Runalter:resetbefore merging your config back into a shared branch — alters are meant to leave no trace once the debug session is over.
Local cache
To avoid re-fetching every remote file on every push / diff, pb-migrate maintains a JSON cache (.pb-migrate-cache.json, gitignored) of the SHA-256 of each file at the time of the last successful push or pull. Pass --verify-remote to bypass the cache when you suspect dashboard edits or cache corruption.
Error handling
API failures surface as Spontena\PbPhp\Exception\ApiException. Since pb-php 2.1.4 its message carries only the HTTP status and the request method/path — never the query string (which holds user_key / botkey) and never the raw response body. pb-migrate re-attaches the server's own explanation (the message field of the JSON error body) wherever an error is shown, so you still see why a call failed:
When the body carries no usable message (empty, non-JSON, or a non-string field), the line is shown without the trailing detail. Transport failures (DNS, timeout, TLS) keep the standard Guzzle exception types with a fixed message and the numeric cURL error code; the original URL-bearing message is intentionally dropped.
Exception messages, stack traces, and the -v / -vvv output never include credentials. If you log exception traces yourself, set zend.exception_ignore_args=On; pb-php also marks its sensitive parameters with #[\SensitiveParameter]. Do not dump whole exception objects or Guzzle request/response accessors — those can still contain the raw query string or conversation text.
Testing the code
The integration suite hits the real Pandorabots API and is not run by default. Provide credentials and select the integration suite explicitly:
CI runs the unit suite on PHP 8.3 / 8.4 / 8.5 / 8.6 — see .github/workflows/ci.yml.
License
MIT — see LICENSE.
All versions of pb-migrate with dependencies
ext-json Version *
spontena/pb-php Version ^2.2
symfony/console Version ^6.4 || ^7.0
symfony/dotenv Version ^6.4 || ^7.0