Configure & connect
One command connects Restish to the API and generates the CLI:
restish api connect pff https://api.pff.com
Discovered PFF Premium Stats Pro CLI API
Base URL: https://api.pff.com
OpenAPI: https://api.pff.com/openapi.json
This API declares 2 auth scheme(s):
pffOAuth oauth2 authorizationCode 68 operations, needs email offline_access openid profile, global default
pffApiKey http bearer 68 operations, global default
Auth coverage for profile "default":
configured: pffOAuth
unresolved: pffOAuth (OAuth access token not cached)
skipped: pffApiKey
callable: 0/68 secured operations
Wrote config: …/.config/restish/restish.json
OpenAPI x-cli extensions: x-cli-config, 1 hidden operation, 10 operations with aliases, 59 renamed parameters
Connected API "pff" with base URL https://api.pff.com (70 operations discovered — run 'restish pff --help')
Here’s what just happened:
pffis the name you’ll type before every command (restish pff …). You can pick any name; this guide usespff.- Restish fetched the API’s OpenAPI document from
https://api.pff.com/openapi.jsonand generated a command for every operation in it — all with--help. - The document also tells Restish how to sign you in (
configured: pffOAuth).unresolvedandcallable: 0/68are expected — they only mean you haven’t signed in yet. That’s the next step.skipped: pffApiKeyis the API-key option for scripts, covered there too.
Use the bare address. Connect to
https://api.pff.com, nothttps://api.pff.com/v1. The contract lives at the bare origin and every command carries its own path; with/v1appended, discovery fails —spec discovery failed: GET https://api.pff.com/v1/openapi.json: 401 Unauthorized— because everything under/v1/needs a credential.
Coming from Restish 1? The command is
api connect.restish api configurewas a Restish 1 command and prints an error on 2.x.
See what you can call
restish pff --help # every command, grouped
restish pff passing --help # one command's arguments and flags
The list is generated from the OpenAPI document Restish fetched when you last ran api connect (or api sync), so it matches what the API served at that moment; run restish api sync pff to pick up commands added since (see “When the API changes” below). Commands are grouped by what they return:
| Group | What it covers | Examples |
|---|---|---|
ref |
Reference data — leagues, games, the player directory | leagues, games, players |
team |
Team lists and reports, including PFF’s own team-page tables (team-stats, team-roster, team-report, …) |
teams, team-overview, team-report |
player |
One player’s reports | player-passing-summary, player-position-pivot |
facet |
League-wide leaderboards | passing, rushing, receiving, defense |
signature |
PFF signature stats | signature-passing-time-in-pocket |
auth |
Your session | whoami, logout |
meta |
The API contract itself | openapi-json, openapi-yaml |
The short names in the Examples column are aliases: restish pff passing and restish pff facet-passing-summary are the same command.
Under the hood the API has two surfaces: the long-standing Premium Stats reports (snake_case JSON, every ref-, player-, facet- and signature- command plus teams/team-overview/team-summary) and PFF’s own newer team tables (camelCase columns + rows — the other team-* commands). Restish hides the difference; you only ever type a command name. Querying covers both.
Where Restish keeps things
| File (macOS and Linux) | Contents |
|---|---|
~/.config/restish/restish.json |
The APIs you’ve connected and their profiles |
~/.config/restish/tokens.cbor |
Cached sign-in tokens — readable only by you (mode 0600) |
restish doctor prints the exact paths on your system. restish api inspect pff prints the stored configuration with secrets masked, and restish api list shows every API you’ve connected.
When the API changes
The API gains commands and parameters over time. To pick them up:
restish api sync pff
This re-fetches the OpenAPI document and regenerates the commands. Your sign-in and profiles are left alone.
Next: Authentication — the two credentials the API accepts, how to get an API key, and how to call the API from anything, not just Restish.