Server RPC CLI
Use the .agents/skills/server/cli.ts CLI to call RPC procedures on the local dev server.
Authentication
On first use, the CLI authenticates using your local gcloud credentials:
- Runs
gcloud auth print-identity-tokento get a Google ID token - Calls
POST /api/auth/cli-loginon the server to verify and get an API key - Caches the API key locally for subsequent calls
Commands
# Authenticate (happens automatically on first call)
.agents/skills/server/cli.ts login
# Clear cached authentication
.agents/skills/server/cli.ts logout
# Call an RPC procedure
.agents/skills/server/cli.ts call threads.list
.agents/skills/server/cli.ts call threads.get '{"id": "abc-123"}'
.agents/skills/server/cli.ts call threads.create '{"title": "My Thread"}'
.agents/skills/server/cli.ts call dev.usersList
Available Procedures
The RPC procedures are defined in apps/server/src/router/. Read the router files to see available procedures and their input schemas.
threads (apps/server/src/router/threads.ts)
threads.list— List all threads for the authenticated userthreads.get{id}— Get a thread by IDthreads.create{title?}— Create a new threadthreads.messages{id}— Get messages for a threadthreads.usage{id}— Get usage/cost for a threadthreads.patch{id, title}— Update thread titlethreads.delete{id}— Delete a threadthreads.archive{id, archived}— Archive/unarchive a threadthreads.title{id, title}— Set thread titlethreads.draft{id, draft}— Set/clear thread draftthreads.chat{id, messages}— Send a chat message (streaming)
dev (apps/server/src/router/dev.ts) — development only
dev.usersList— List all usersdev.usersImpersonate{userId?, email?}— Get API key for a userdev.usersLogin{email, name?}— Find or create user and get API key
Prerequisites
- Local dev server must be running (use
.bin/dev start) gcloudCLI must be authenticated (gcloud auth login)
When to Use
- Inspecting server state or data through the API
- Testing RPC endpoints
- Debugging API behavior
- Verifying changes to server procedures
When NOT to Use
- For direct database access (use the
databaseskill instead) - When the dev server is not running