@getpie/pi-cliproxyapi-provider0.1.3
Minimal CLIProxyAPI provider for Pi using official @earendil-works/pi-ai Codex WebSocket transport
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@getpie/pi-cliproxyapi-provider
Minimal CLIProxyAPI provider extension for Pi.
- Uses official
@earendil-works/pi-aiopenAICodexResponsesApi()for persistent WebSocket +previous_response_idcontinuation (zero filesystem path probing or source patching). - Supports
!command(e.g.!op read op://...) and$ENV_VARin~/.pi/agent/cliproxyapi.json. - Discovers models from
{baseUrl}/v1/models?client_version=piand caches them in~/.pi/agent/cliproxyapi-models.json. - Uses Pi native asynchronous provider authentication (verified against Pi 1.3.0).
Command credentials and rotation
!command runs asynchronously and never blocks startup. With a matching cached catalog it starts
in the background as soon as the extension loads and then refreshes the catalog, so the first
authenticated request reuses the running or finished result; cold model discovery awaits it. Model
availability checks never execute it.
Concurrent lookups of the same trimmed command share one execution. Successful, nonempty, trimmed
output is cached in process memory and reused across /new, /resume and /fork. There is no TTL
or automatic credential refresh. Run /reload (or restart Pi) after rotating a command-backed
credential; a reload drops the cached result and runs the command again. /cliproxyapi-refresh refreshes the
model catalog with the loaded credential and does not re-run the command. Nothing persists the
resolved command output to disk. Failures, ten-second timeouts, and empty output are not cached,
so the next lookup can retry. Command errors do not expose the command or its output.
Literal keys and $NAME / ${NAME} environment references retain their existing behavior.
A non-empty CLIPROXYAPI_API_KEY overrides cliproxyapi.json. For the same provider, request keys, runtime keys,
and stored credentials outrank a models.json credential, and that file outranks the extension credential.
Install
pi install npm:@getpie/pi-cliproxyapi-provider
# or
pi install git:github.com/getpie-dev/pi-cliproxyapi-provider
Config (~/.pi/agent/cliproxyapi.json)
{
"baseUrl": "https://your-cpa-host:27119",
"apiKey": "!op read op://dev/cliproxyapi/key",
"providerId": "cpa",
"providerName": "cpa"
}