@tduyng/pi-commandcode 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -37
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,17 +1,25 @@
1
- # pi-commandcode
1
+ # @tduyng/pi-commandcode
2
2
 
3
- Command Code models in pi through the documented Provider API, with pi's own prompt, tools, and approvals. Unofficial: not made or endorsed by Command Code.
3
+ Command Code models as a pi provider, through the documented Provider API, with pi's own prompt, tools and approvals. Unofficial: not made or endorsed by Command Code.
4
4
 
5
- ## What it costs
5
+ No tools, no prompt block, no schema, and the adapters add no round trip of their own.
6
6
 
7
- No tools, no prompt block, no schema. It is a model provider, so it adds nothing to the context and nothing to the cold start.
7
+ ## No transport of its own
8
8
 
9
- Streaming, tool calls, and message conversion are pi's own adapters, so the transport adds no round trip of its own.
9
+ Streaming, tool calls and message conversion are pi's built-in adapters. The extension supplies a provider id, a base URL, a key reference, a catalog and a per-model wire choice, so there is no request code to drift from pi's own.
10
10
 
11
- ## Requirements
11
+ The wire follows the model. Claude models use Anthropic Messages, which is what they speak, and everything else uses OpenAI Chat Completions. That choice is the difference between a working model and a 400.
12
12
 
13
- - An API key from a plan with API access: GOAT, Pro, Max, Team, or Provider. The Go and $1 plans have no API access.
14
- - Pi 1.4 or newer.
13
+ | Model id | Wire | Base URL |
14
+ | --- | --- | --- |
15
+ | `claude-*` | Anthropic Messages, `/provider/v1/messages` | `https://api.commandcode.ai/provider` |
16
+ | everything else | OpenAI Chat Completions, `/provider/v1/chat/completions` | `https://api.commandcode.ai/provider/v1` |
17
+
18
+ The key goes as a Bearer token for Chat Completions and as `x-api-key` for Messages, as the Provider API documents. `typesafe/*` decision models are left out because they run on a separate endpoint and never stream.
19
+
20
+ ## The catalog is a cache
21
+
22
+ The extension reads the model list from `https://api.commandcode.ai/provider/v1/models` and writes it to `<agent-dir>/commandcode-models.json`. A session starts from that file and fetches only when it is missing or when `/model` refreshes, so a cold start does not wait on the network and an offline session still lists the models it had.
15
23
 
16
24
  ## Use
17
25
 
@@ -20,22 +28,36 @@ export COMMAND_CODE_API_KEY="user_..."
20
28
  pi --provider commandcode --model claude-opus-5
21
29
  ```
22
30
 
23
- Inside pi, `/model` lists every `commandcode` model. The list is fetched from `https://api.commandcode.ai/provider/v1/models` at startup and again each time the selector opens.
31
+ Inside pi, `/model` lists every `commandcode` model. The list refreshes each time the selector opens, with the cache as the offline answer.
24
32
 
25
- ## How it works
33
+ ## Install
26
34
 
27
- | Model id | Wire | Base URL |
28
- | --- | --- | --- |
29
- | `claude-*` | Anthropic Messages, `/provider/v1/messages` | `https://api.commandcode.ai/provider` |
30
- | everything else | OpenAI Chat Completions, `/provider/v1/chat/completions` | `https://api.commandcode.ai/provider/v1` |
35
+ - An API key from a plan with API access: GOAT, Pro, Max, Team or Provider. The Go and $1 plans have no API access.
36
+ - Pi 1.4 or newer.
37
+ - Network access to `api.commandcode.ai` with a 10 second fetch timeout.
31
38
 
32
- The key goes as a Bearer token for Chat Completions and as `x-api-key` for Messages, as the Provider API documents. `typesafe/*` decision models are left out because they run on a separate endpoint and never stream.
39
+ ```bash
40
+ pi install npm:@tduyng/pi-commandcode
41
+ ```
42
+
43
+ Local checkout: `pi install /path/to/dotfiles/pi/agent/extensions/pi-commandcode`
44
+
45
+ ```sh
46
+ export COMMAND_CODE_API_KEY="user_..."
47
+ ```
48
+
49
+ | Variable | Meaning |
50
+ | --- | --- |
51
+ | `COMMAND_CODE_API_KEY` | Provider API key, required for requests |
52
+ | `CMD_ZDR=1` | Sends `x-cmd-zdr: 1`, so requests go only to zero-data-retention upstreams. A model without one fails with HTTP 422 |
33
53
 
34
54
  ## Limits
35
55
 
36
56
  - The catalog carries no image or price metadata, so every model is text-only and shows zero cost in pi.
37
57
 
38
- - Thinking is on for every model. Pi levels map to `reasoning_effort`, and `minimal` sends `low`. `off` is offered only for the DeepSeek ids that accept it, because a model that cannot stop thinking rejects `off` with HTTP 400.
58
+ - Thinking is on for every model, and pi levels map to `reasoning_effort` with `minimal` sending `low`.
59
+
60
+ - `off` is offered only for the DeepSeek ids that accept it, because a model that cannot stop thinking rejects `off` with HTTP 400.
39
61
 
40
62
  - Claude 4.6 and newer use adaptive thinking, and the 4.5 models take a thinking budget.
41
63
 
@@ -46,24 +68,3 @@ The key goes as a Bearer token for Chat Completions and as `x-api-key` for Messa
46
68
  - Messages requests carry pi's `?beta=true` query string, added by the Anthropic SDK.
47
69
 
48
70
  - If no models appear, check the network and the key, then open `/model` again.
49
-
50
- ## Configure
51
-
52
- | Variable | Meaning |
53
- | --- | --- |
54
- | `COMMAND_CODE_API_KEY` | Provider API key, required for requests |
55
- | `CMD_ZDR=1` | Sends `x-cmd-zdr: 1`, so requests go only to zero-data-retention upstreams. A model without one fails with HTTP 422 |
56
-
57
- ## Install
58
-
59
- ```bash
60
- pi install npm:@tduyng/pi-commandcode
61
- ```
62
-
63
- Local checkout: `pi install /path/to/dotfiles/pi/agent/extensions/pi-commandcode`
64
-
65
- ## Tests
66
-
67
- ```sh
68
- bun test extensions/pi-commandcode
69
- ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tduyng/pi-commandcode",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Command Code models in Pi through the documented Provider API, with Pi's own prompt and tools.",
5
5
  "keywords": [
6
6
  "pi",