pi-provider-kimi-code 0.1.0 → 0.1.2

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 +66 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # pi-provider-kimi-code
2
+
3
+ [![npm](https://img.shields.io/npm/v/pi-provider-kimi-code)](https://www.npmjs.com/package/pi-provider-kimi-code)
4
+
5
+ A [pi-coding-agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) custom provider extension that adds [Kimi Code](https://kimi.com) models with OAuth device-code login.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pi install npm:pi-provider-kimi-code
11
+ ```
12
+
13
+ Or load without installing:
14
+
15
+ ```bash
16
+ pi -e /path/to/pi-provider-kimi-code
17
+ ```
18
+
19
+ ## Authentication
20
+
21
+ ### OAuth (recommended)
22
+
23
+ Inside pi, run:
24
+
25
+ ```
26
+ /login kimi-coding
27
+ ```
28
+
29
+ This starts the device-code flow — a browser window opens, you authorize, and credentials are stored automatically.
30
+
31
+ ### API Key
32
+
33
+ Set the `KIMI_API_KEY` environment variable:
34
+
35
+ ```bash
36
+ KIMI_API_KEY=sk-... pi
37
+ ```
38
+
39
+ ## Models
40
+
41
+ | ID | Name | Reasoning | Input | Context | Max Output |
42
+ |--------------------|------------------|-----------|-------------|----------|------------|
43
+ | `kimi-k2-thinking` | Kimi K2 Thinking | yes | text | 262 144 | 32 768 |
44
+ | `k2p5` | Kimi K2.5 | yes | text, image | 262 144 | 32 768 |
45
+
46
+ Select a model inside pi:
47
+
48
+ ```
49
+ /model kimi-coding/kimi-k2-thinking
50
+ ```
51
+
52
+ ## How It Works
53
+
54
+ - Registers provider `kimi-coding` with base URL `https://api.kimi.com/coding`
55
+ - Uses `api: "anthropic-messages"` — Kimi's API is wire-compatible with the Anthropic Messages format, so no custom streaming logic is needed
56
+ - OAuth uses [RFC 8628](https://datatracker.ietf.org/doc/html/rfc8628) device authorization grant against `https://auth.kimi.com`
57
+ - Zero dependencies — types from `@mariozechner/pi-ai` and `@mariozechner/pi-coding-agent` are provided by the pi runtime
58
+ - Zero build step — pi loads TypeScript directly via jiti
59
+
60
+ ## Credits
61
+
62
+ This extension is based on the OAuth implementation from [kimi-cli](https://github.com/MoonshotAI/kimi-cli) by Moonshot AI.
63
+
64
+ ## License
65
+
66
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-provider-kimi-code",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "pi custom provider extension for Kimi Code models with OAuth device-code login",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,7 +18,8 @@
18
18
  ],
19
19
  "files": [
20
20
  "index.ts",
21
- "package.json"
21
+ "package.json",
22
+ "README.md"
22
23
  ],
23
24
  "scripts": {
24
25
  "clean": "echo 'nothing to clean'",