CLI Usage
The pgm CLI is the primary human-facing interface and supports the same actions
as REST with concise output modes for automation.
What this page covers
Section titled “What this page covers”Install and usage patterns for everyday local use and agent-friendly workflows.
Core workflow
Section titled “Core workflow”- Install:
npm install -g @ivotoby/postgram-cli- Configure once:
export PGM_API_URL=http://127.0.0.1:3100export PGM_API_KEY=your-api-key- Store and retrieve entities:
pgm store "decided to use pgvector" --type=memory --tags decisionspgm search "decided to use pgvector"pgm recall <entity-id>pgm update <id> --content "revised content" --version 1pgm delete <id>- Task and sync operations:
pgm task add "fix retrieval false positives" --context @focus --status nextpgm sync ~/Documents/personal-notes --repo personal-notespgm link <source-id> <target-id> --relation involvespgm expand <entity-id> --depth 2For local development without build:
npx tsx cli/src/pgm.ts <command>- Agent modes:
--json(compact structured JSON)--json --full-response(REST-shaped payloads)--toon(compact agent-readable text for list-like operations).
task completeandsearchare commonly used in automation scripts; capture the returnedversionfor update flows.