feat: add OMP (Oh My Pi) provider compatibility

Support OMP as a host alongside pi:
- Convert OMP's array-format system prompts to string via systemPromptToText
- Guard against OMP passing the literal env-var name as the API key value
- Add ~/.omp/agent/auth.json to default auth path lookup
- Fix --list-models output to check both stdout and stderr
- Add OMP compatibility smoke test with isolated temp HOME and mock server
- Deduplicate usage section in README, add OMP install and usage docs
This commit is contained in:
AlexVagrant
2026-05-28 04:12:35 -04:00
committed by wh.huajieyu
parent b850558199
commit c2497ed098
9 changed files with 303 additions and 37 deletions
+25 -4
View File
@@ -36,6 +36,18 @@ Then reload pi:
/reload
```
### Oh My Pi
```sh
omp plugin install pi-commandcode-provider
```
Then restart OMP or run:
```txt
/reload
```
## Setup
Set your Command Code API key using one of these methods:
@@ -83,7 +95,7 @@ The official Command Code CLI auth shape is also supported:
}
```
Or use pi's auth file at `~/.pi/agent/auth.json`:
Or use a pi/OMP auth file at `~/.pi/agent/auth.json` or `~/.omp/agent/auth.json`:
```json
{
@@ -99,12 +111,21 @@ After installing and setting your API key, select a Command Code model in pi:
/model deepseek/deepseek-v4-flash
```
Any query will then use the Command Code API. You can list available models within pi:
Any query will then use the Command Code API. You can list available models:
```txt
/models
```sh
pi -e index.ts --list-models # or /models within pi
omp -e index.ts --list-models
```
In OMP, use the provider-qualified model name:
```sh
omp -p "hello" --model commandcode/deepseek/deepseek-v4-flash
```
OMP currently resolves `--provider commandcode --model ...` before extension providers are loaded, so prefer `--model commandcode/<model-id>`. <!-- TODO: remove this note once OMP fixes provider resolution order for extension-loaded providers -->
## Model discovery
On startup, the provider fetches: