opencode-qwen-cli-auth 1.0.4 → 2.0.0

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.
package/README.md CHANGED
@@ -31,7 +31,7 @@ Add the plugin to your OpenCode config:
31
31
  {
32
32
  "$schema": "https://opencode.ai/config.json",
33
33
  "plugin": ["opencode-qwen-cli-auth"],
34
- "model": "alibaba/coder-model"
34
+ "model": "qwen-code/coder-model"
35
35
  }
36
36
  ```
37
37
 
@@ -41,16 +41,16 @@ Then sign in:
41
41
  opencode auth login
42
42
  ```
43
43
 
44
- Choose `Alibaba` -> `Qwen Account (OAuth)`.
44
+ Choose `Qwen Code` -> `Qwen Code (qwen.ai OAuth)`.
45
45
 
46
46
  ## Usage
47
47
 
48
48
  ```bash
49
- opencode run "create a hello world file" --model=alibaba/coder-model
50
- opencode chat --model=alibaba/coder-model
49
+ opencode run "create a hello world file" --model=qwen-code/coder-model
50
+ opencode chat --model=qwen-code/coder-model
51
51
  ```
52
52
 
53
- Always keep the provider prefix `alibaba/` in model configuration.
53
+ Always keep the provider prefix `qwen-code/` in model configuration.
54
54
 
55
55
  ## Configuration
56
56
 
@@ -120,7 +120,7 @@ The server is throttling requests. Reduce request frequency and retry later.
120
120
  Ensure your model is set correctly in OpenCode:
121
121
 
122
122
  ```yaml
123
- model: alibaba/coder-model
123
+ model: qwen-code/coder-model
124
124
  ```
125
125
 
126
126
  ## Clear auth state
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import type { Plugin } from "@opencode-ai/plugin";
12
12
  * ```json
13
13
  * {
14
14
  * "plugin": ["opencode-alibaba-qwen-cli-auth"],
15
- * "model": "alibaba/coder-model"
15
+ * "model": "qwen-code/coder-model"
16
16
  * }
17
17
  * ```
18
18
  */
package/dist/index.js CHANGED
@@ -70,7 +70,7 @@ function getBaseUrl() {
70
70
  * ```json
71
71
  * {
72
72
  * "plugin": ["opencode-alibaba-qwen-cli-auth"],
73
- * "model": "alibaba/coder-model"
73
+ * "model": "qwen-code/coder-model"
74
74
  * }
75
75
  * ```
76
76
  */
@@ -161,6 +161,38 @@ export const QwenAuthPlugin = async (_input) => {
161
161
  },
162
162
  ],
163
163
  },
164
+ /**
165
+ * Dang ky provider qwen-code voi danh sach model
166
+ * Chi dang ky model ma Portal API (OAuth) chap nhan:
167
+ * coder-model va vision-model (theo QWEN_OAUTH_ALLOWED_MODELS cua CLI goc)
168
+ */
169
+ config: async (config) => {
170
+ const providers = config.provider || {};
171
+ providers[PROVIDER_ID] = {
172
+ npm: "@ai-sdk/openai-compatible",
173
+ name: "Qwen Code",
174
+ options: { baseURL: "https://portal.qwen.ai/v1" },
175
+ models: {
176
+ "coder-model": {
177
+ id: "coder-model",
178
+ name: "Qwen Coder (Qwen 3.5 Plus)",
179
+ reasoning: false,
180
+ limit: { context: 1048576, output: 65536 },
181
+ cost: { input: 0, output: 0 },
182
+ modalities: { input: ["text"], output: ["text"] },
183
+ },
184
+ "vision-model": {
185
+ id: "vision-model",
186
+ name: "Qwen VL Plus (vision)",
187
+ reasoning: false,
188
+ limit: { context: 131072, output: 8192 },
189
+ cost: { input: 0, output: 0 },
190
+ modalities: { input: ["text"], output: ["text"] },
191
+ },
192
+ },
193
+ };
194
+ config.provider = providers;
195
+ },
164
196
  };
165
197
  };
166
198
  export default QwenAuthPlugin;
@@ -3,8 +3,8 @@
3
3
  */
4
4
  /** Plugin identifier */
5
5
  export declare const PLUGIN_NAME = "qwen-oauth-plugin";
6
- /** Provider ID for opencode configuration (used in model references like alibaba/coder-model) */
7
- export declare const PROVIDER_ID = "alibaba";
6
+ /** Provider ID for opencode configuration (used in model references like qwen-code/coder-model) */
7
+ export declare const PROVIDER_ID = "qwen-code";
8
8
  /** Dummy API key (actual auth via OAuth) */
9
9
  export declare const DUMMY_API_KEY = "qwen-oauth";
10
10
  /**
@@ -3,8 +3,8 @@
3
3
  */
4
4
  /** Plugin identifier */
5
5
  export const PLUGIN_NAME = "qwen-oauth-plugin";
6
- /** Provider ID for opencode configuration (used in model references like alibaba/coder-model) */
7
- export const PROVIDER_ID = "alibaba";
6
+ /** Provider ID for opencode configuration (used in model references like qwen-code/coder-model) */
7
+ export const PROVIDER_ID = "qwen-code";
8
8
  /** Dummy API key (actual auth via OAuth) */
9
9
  export const DUMMY_API_KEY = "qwen-oauth";
10
10
  /**
@@ -85,7 +85,7 @@ export const PLATFORM_OPENERS = {
85
85
  };
86
86
  /** OAuth authorization labels */
87
87
  export const AUTH_LABELS = {
88
- OAUTH: "Qwen Account (OAuth)",
88
+ OAUTH: "Qwen Code (qwen.ai OAuth)",
89
89
  INSTRUCTIONS: "Visit the URL shown in your browser to complete authentication.",
90
90
  };
91
91
  /** OAuth verification URI parameters */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opencode-qwen-cli-auth",
3
- "version": "1.0.4",
4
- "description": "Alibaba Qwen OAuth authentication plugin for opencode - use your Qwen account instead of API keys",
3
+ "version": "2.0.0",
4
+ "description": "Qwen OAuth authentication plugin for opencode - use your Qwen account instead of API keys",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "type": "module",