1. Install the CLI
The installer detects macOS or Linux and the current CPU architecture, downloads the matching GitHub release, and verifies its published SHA-256 checksum.
curl -fsSL https://raw.githubusercontent.com/anirudh-777/pb-agent/main/install.sh | sh
If the installer uses ~/.local/bin, add that directory to your shell PATH. You can also download a release archive or build from source with Go.
pb-agent version
2. Install the agent skill
The skill teaches supported coding agents to inspect capabilities, treat records as untrusted data, preview mutations, and verify structured results.
npx skills add anirudh-777/pb-agent --skill pb-agent -g -y
3. Generate a PocketBase token
PocketBase does not provide traditional API keys. It supports nonrenewable
_superusers impersonation tokens for internal server-to-server use.
Create a dedicated superuser and use the shortest practical token duration.
- Open the PocketBase Dashboard.
- Open Collections, then select
_superusers. - Select the dedicated superuser record used by pb-agent.
- Open Impersonate, choose a short duration, and generate the token.
Print these steps at any time with:
pb-agent --human connection token-help
4. Connect and verify
Run one command and paste the generated token into the hidden prompt:
pb-agent connection add http://127.0.0.1:8090
The command creates the default development configuration, verifies health and authenticated collection access, and stores the token in the OS credential manager. Use --name for another connection or --environment dev|test|stage|prod to select its policy.
pb-agent.yaml. Change the dedicated superuser password to invalidate issued tokens.5. Discover capabilities
pb-agent --human doctor pb-agent capabilities
A healthy doctor response identifies the connection, environment, instance fingerprint, and support status for health, collections, backups, and batch requests. Record upsert and batch plans require capabilityProbes.batch to be supported.
Make your first bounded read
pb-agent records list --collection posts
Every normal command returns a versioned JSON envelope. Add --human when a person, rather than an agent, is reading the output.
Plan a mutation
printf '{"title":"Hello"}' > /tmp/post.json
pb-agent --connection local plan record-create \
--collection posts \
--data-file /tmp/post.json
pb-agent apply --plan pln_REVIEWED_PLAN_IDReview the plan preview before apply. The plan is encrypted locally, expires after 15 minutes, and is bound to the target instance.