CLI
The wp binary wraps the REST API for terminal use, scripting, and
CI. Twelve commands cover all four primitives plus key management
plus MCP install.
Install
npm i -g @waypath/cli
wp initwp init prompts for your wp_live_... key and persists it to
~/.waypath/config.json. The binary is also published as waypath
and wp-mcp for environments where wp collides.
Commands
| # | Command | Purpose |
|---|---|---|
| 1 | wp init | Configure API key + workspace. |
| 2 | wp ctx <id-or-email> | Print customer context. |
| 3 | wp acct <id> | Print account brief. |
| 4 | wp memory write ... | Append a memory entry. |
| 5 | wp memory list <id> | Tail memory ledger for a customer. |
| 6 | wp event send ... | Ingest a single event. |
| 7 | wp event batch <file> | Ingest a JSONL batch. |
| 8 | wp keys issue ... | Issue a new API key. |
| 9 | wp keys list | List keys. |
| 10 | wp keys revoke <id> | Revoke a key. |
| 11 | wp whoami | Resolve current key to workspace + scopes. |
| 12 | wp mcp install | Run claude mcp add for the user. |
Examples
1. wp init
wp init
# ? API key: wp_live_...
# ? Workspace: ws_default
# saved ~/.waypath/config.json2. wp ctx
wp ctx jane@acme.com
wp ctx cus_8af2 --budget 4096 --format json3. wp acct
wp acct acct_4c2d4. wp memory write
wp memory write \
--customer cus_8af2 \
--type decision \
--agent support_v2 \
--payload '{"action":"escalate_to_human"}' \
--idempotency esc-1284-v25. wp memory list
wp memory list cus_8af2 --limit 206. wp event send
wp event send \
--event page_viewed \
--email jane@acme.com \
--properties '{"url":"/pricing"}'7. wp event batch
# events.jsonl: one EventIngest per line
wp event batch events.jsonl8. wp keys issue
wp keys issue --name "support agent" --scope context:read,memory:write
# wp_live_8a1c2d3e4f5g6h7i8j9k0l1m2n3o4p5q9. wp keys list
wp keys list10. wp keys revoke
wp keys revoke key_91ab2c11. wp whoami
wp whoami
# workspace: ws_default
# scopes: context:read, memory:write12. wp mcp install
wp mcp install
# runs: claude mcp add --transport http waypath https://mcp.waypath.app -s userOutput formats
Every command supports --format json | yaml | table (default table
for lists, json for single records). Pipe-friendly:
wp ctx jane@acme.com --format json | jq '.intent_signals'Config
Config lives at ~/.waypath/config.json:
{
"apiKey": "wp_live_...",
"workspace": "ws_default",
"baseUrl": "https://api.waypath.app"
}Override per-call with env vars WAYPATH_API_KEY and
WAYPATH_BASE_URL. Useful for CI:
WAYPATH_API_KEY=$CI_WAYPATH_KEY wp ctx cus_8af2