Skip to main content
Make an authenticated request to api.gavai.app using the stored credentials, and print the JSON response to stdout. This page covers the synopsis, the arguments, and where to draw the line between an ad-hoc CLI call and a script written against the SDK.

Synopsis

gavai public-api <method> <path> [--body <json>]

Arguments

Flags

Run gavai public-api --help for the authoritative flag list, including the exact shape of --body and any --header / --query flags in your CLI version.

Behavior

The command signs the request with the access token from ~/.config/gavai/credentials.json and sends it to https://api.gavai.app. The response body is printed to stdout as JSON; HTTP errors map to the standard CLI exit codes below. This is appropriate for inspecting a workspace, checking a single resource, or testing an endpoint before wiring it into a script. For multi-step workflows, retries, pagination, or any logic beyond a single request, reach for the TypeScript SDK instead.

Examples

Fetch the current identity:
gavai public-api me
List workspaces accessible to your account:
gavai public-api workspaces
Send a verb explicitly with a body:
gavai public-api POST /v1/workspaces/acme/pages \
  --body '{"slug":"pricing","title":"Pricing"}'
Pipe through jq:
gavai public-api GET /v1/workspaces/acme/pages | jq '.data | length'

Exit codes

See CLI overview — exit codes for the full table.