byteplan-cli 1.3.4 → 1.3.6
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/package.json +1 -1
- package/src/api.js +1 -1
- package/src/cli.js +19 -4
- package/src/commands/skills.js +11 -4
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -115,7 +115,7 @@ function saveCredentials(data) {
|
|
|
115
115
|
const lines = [];
|
|
116
116
|
lines.push('BP_ENV=' + currentEnv);
|
|
117
117
|
lines.push('BP_USER=' + data.username);
|
|
118
|
-
lines.push('BP_PASSWORD=' + data.password);
|
|
118
|
+
lines.push('BP_PASSWORD="' + data.password + '"'); // 用双引号包裹,防止 # 等特殊字符被解析为注释
|
|
119
119
|
if (data.accessToken) {
|
|
120
120
|
lines.push('ACCESS_TOKEN=' + data.accessToken);
|
|
121
121
|
}
|
package/src/cli.js
CHANGED
|
@@ -113,9 +113,23 @@ program
|
|
|
113
113
|
// Login command
|
|
114
114
|
program
|
|
115
115
|
.command('login')
|
|
116
|
-
.description('Login to BytePlan
|
|
117
|
-
.option('-u, --user <phone>', 'Phone number
|
|
118
|
-
.option('-p, --password <password>', 'Password
|
|
116
|
+
.description('Login to BytePlan and save credentials')
|
|
117
|
+
.option('-u, --user <phone>', 'Phone number')
|
|
118
|
+
.option('-p, --password <password>', 'Password')
|
|
119
|
+
.addHelpText('after', `
|
|
120
|
+
Usage:
|
|
121
|
+
byteplan login # 使用已保存的凭据刷新 Token(无需参数)
|
|
122
|
+
byteplan login -u <phone> -p <pwd> # 新登录或覆盖已有凭据
|
|
123
|
+
|
|
124
|
+
说明:
|
|
125
|
+
- 首次使用需要提供账号密码: byteplan login -u 18256485741 -p yourpassword
|
|
126
|
+
- 登录成功后凭据保存到 ~/.byteplan/.env
|
|
127
|
+
- 后续可直接运行 byteplan login 刷新 Token(无需参数)
|
|
128
|
+
- 提供新账号密码会覆盖已有配置
|
|
129
|
+
|
|
130
|
+
检查配置状态:
|
|
131
|
+
byteplan config
|
|
132
|
+
`)
|
|
119
133
|
.action(async (options) => {
|
|
120
134
|
try {
|
|
121
135
|
const existingConfig = checkExistingConfig();
|
|
@@ -232,7 +246,7 @@ userCmd
|
|
|
232
246
|
const userInfo = await getUserInfo();
|
|
233
247
|
|
|
234
248
|
const tenants = (userInfo.tenantList || []).map(t => ({
|
|
235
|
-
tenantId: t.
|
|
249
|
+
tenantId: t.id, // API 返回的字段名是 id
|
|
236
250
|
tenantName: t.tenantName,
|
|
237
251
|
tenantCode: t.tenantCode,
|
|
238
252
|
isCurrent: t.tenantCode === userInfo.user?.tenantCode,
|
|
@@ -242,6 +256,7 @@ userCmd
|
|
|
242
256
|
tenants,
|
|
243
257
|
total: tenants.length,
|
|
244
258
|
currentTenantCode: userInfo.user?.tenantCode || '',
|
|
259
|
+
currentTenantId: userInfo.user?.tenantId || '',
|
|
245
260
|
});
|
|
246
261
|
} catch (error) {
|
|
247
262
|
printError(error);
|
package/src/commands/skills.js
CHANGED
|
@@ -204,15 +204,21 @@ Commands:
|
|
|
204
204
|
skills list List all available skills
|
|
205
205
|
skills installed List installed skills
|
|
206
206
|
|
|
207
|
+
说明:
|
|
208
|
+
- 所有命令会自动检查配置状态(~/.byteplan/.env)
|
|
209
|
+
- 如未配置,会提示先运行: byteplan login -u <phone> -p <password>
|
|
210
|
+
- --check-config 仅检查配置不执行安装
|
|
211
|
+
|
|
207
212
|
Platforms:
|
|
208
213
|
claude-code (claude) ~/.claude/commands
|
|
209
214
|
codex ~/.codex
|
|
210
215
|
openclaw ~/.openclaw/skills
|
|
211
216
|
|
|
212
217
|
Examples:
|
|
213
|
-
byteplan skills
|
|
214
|
-
byteplan skills install -p claude-code
|
|
215
|
-
byteplan skills
|
|
218
|
+
byteplan skills list # 查看 skills 并显示配置状态
|
|
219
|
+
byteplan skills install -p claude-code # 安装到 claude-code
|
|
220
|
+
byteplan skills install -p claude-code,codex # 安装到多个平台
|
|
221
|
+
byteplan skills install --check-config # 仅检查配置
|
|
216
222
|
`);
|
|
217
223
|
|
|
218
224
|
// skills install 子命令 - 安装全部
|
|
@@ -223,12 +229,13 @@ skillsCmd
|
|
|
223
229
|
Options (from parent):
|
|
224
230
|
-p, --platform Target platform(s): claude-code, codex, openclaw
|
|
225
231
|
-d, --dir Custom target directory
|
|
226
|
-
--check-config
|
|
232
|
+
--check-config 仅检查配置状态,不执行安装
|
|
227
233
|
|
|
228
234
|
Examples:
|
|
229
235
|
byteplan skills install -p claude-code
|
|
230
236
|
byteplan skills install -p claude-code,codex
|
|
231
237
|
byteplan skills install -d ~/.claude/commands
|
|
238
|
+
byteplan skills install --check-config
|
|
232
239
|
`)
|
|
233
240
|
.action(() => {
|
|
234
241
|
try {
|