@newpeak/barista-cli 0.1.131 → 0.1.132
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 +78 -63
- package/dist/commands/skills/index.d.ts +3 -0
- package/dist/commands/skills/index.d.ts.map +1 -0
- package/dist/commands/skills/index.js +252 -0
- package/dist/commands/skills/index.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/skills/barista-cli/scripts/generate.d.ts +12 -0
- package/dist/skills/barista-cli/scripts/generate.d.ts.map +1 -0
- package/dist/skills/barista-cli/scripts/generate.js +312 -0
- package/dist/skills/barista-cli/scripts/generate.js.map +1 -0
- package/package.json +4 -2
- package/skills/barista-cli/SKILL.md +193 -0
- package/skills/barista-cli/data/commands.json +2460 -0
- package/skills/barista-cli/data/commands.yaml +1587 -0
- package/skills/barista-cli/scripts/search.py +194 -0
- package/skills/barista-cli/skill.json +17 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* generate.ts — 从 src/commands/ 源码自动生成 skills 数据文件
|
|
4
|
+
*
|
|
5
|
+
* 扫描 src/commands/liberica/ 和 src/commands/arabica/ 下所有命令文件,
|
|
6
|
+
* 提取模块路径、命令名、描述、选项,输出结构化 YAML。
|
|
7
|
+
*
|
|
8
|
+
* 运行:npx tsx src/skills/barista-cli/scripts/generate.ts
|
|
9
|
+
* 在 build 前自动执行:npm run generate-skills-data
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from 'node:fs';
|
|
12
|
+
import * as path from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
16
|
+
const PROJECT_ROOT = path.resolve(__dirname, '../../../../');
|
|
17
|
+
const COMMANDS_DIR = path.join(PROJECT_ROOT, 'src/commands');
|
|
18
|
+
const SRC_DATA_DIR = path.resolve(__dirname, '../data');
|
|
19
|
+
const SKILLS_DATA_DIR = path.resolve(PROJECT_ROOT, 'skills/barista-cli/data');
|
|
20
|
+
// ── 业务分组映射(新模块需要在此注册) ──
|
|
21
|
+
// 按服务分开,避免 key 冲突
|
|
22
|
+
const GROUP_MAP = {
|
|
23
|
+
liberica: {
|
|
24
|
+
auth: '认证',
|
|
25
|
+
employees: '基础资料', users: '基础资料',
|
|
26
|
+
clients: '基础资料', 'clients/tags': '基础资料', 'clients/invoice-header': '基础资料',
|
|
27
|
+
suppliers: '基础资料', materials: '基础资料', uoms: '基础资料',
|
|
28
|
+
currency: '基础资料', warehouses: '基础资料', 'warehouses/locations': '基础资料',
|
|
29
|
+
orgs: '基础资料', positions: '基础资料', roles: '基础资料',
|
|
30
|
+
'dict-types': '基础资料', dicts: '基础资料',
|
|
31
|
+
operations: '基础资料', calendar: '基础资料',
|
|
32
|
+
'work-centers': '基础资料', shifts: '基础资料',
|
|
33
|
+
'worker-groups': '基础资料', 'job-types': '基础资料',
|
|
34
|
+
equipment: '基础资料', mould: '基础资料',
|
|
35
|
+
'client-contacts': '联系人/价格', 'supplier-contacts': '联系人/价格',
|
|
36
|
+
'client-price': '联系人/价格', 'supplier-price': '联系人/价格',
|
|
37
|
+
'outsourcing-price': '联系人/价格',
|
|
38
|
+
'purchase-orders': '供应链', 'sales-orders': '供应链',
|
|
39
|
+
'sales-orders/delivery-notes': '供应链', 'sales-orders/forecasts': '供应链',
|
|
40
|
+
'outsourcing-orders': '供应链', quotations: '供应链',
|
|
41
|
+
stock: '库存', 'transfer-in-forms': '库存', 'transfer-out-forms': '库存',
|
|
42
|
+
'material-transfers': '库存', 'physical-inventory': '库存',
|
|
43
|
+
'physical-inventory/form': '库存',
|
|
44
|
+
'inventory-overage': '库存', 'inventory-shortage': '库存',
|
|
45
|
+
'stock-reservation': '库存',
|
|
46
|
+
'material-issue': '库存', 'material-return': '库存',
|
|
47
|
+
bom: '生产', routing: '生产', 'work-orders': '生产',
|
|
48
|
+
'actual-production': '生产', 'cutting-material': '生产',
|
|
49
|
+
'product-stock-in': '生产', 'product-stock-out': '生产',
|
|
50
|
+
'mes-result': '生产',
|
|
51
|
+
mrp: '计划', 'mrp/plan': '计划', 'mrp/task': '计划',
|
|
52
|
+
aps: '计划', 'plan-orders': '计划',
|
|
53
|
+
quality: '质量',
|
|
54
|
+
finance: '财务', 'finance/invoices': '财务', 'finance/proceeds': '财务',
|
|
55
|
+
'finance/cost': '财务', 'finance/management-fee': '财务',
|
|
56
|
+
'finance/production-cost': '财务',
|
|
57
|
+
hrs: 'HR', 'hrs/dossier': 'HR', 'hrs/salary': 'HR',
|
|
58
|
+
'hrs/bonus': 'HR', 'hrs/kpi': 'HR', 'hrs/objective': 'HR', 'hrs/skills': 'HR',
|
|
59
|
+
teams: '团队', 'teams/projects': '团队', 'teams/issues': '团队',
|
|
60
|
+
'teams/project-codes': '团队', 'teams/tasks': '团队', 'teams/work-logs': '团队',
|
|
61
|
+
issue: '其他', todo: '其他', 'replenish-orders': '其他',
|
|
62
|
+
},
|
|
63
|
+
arabica: {
|
|
64
|
+
auth: '认证', plans: '套餐', subscription: '订阅',
|
|
65
|
+
orders: '订单', invoices: '发票', enterprises: '企业', access: '访问',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
// ── 模块显示名映射 ──
|
|
69
|
+
const DISPLAY_MAP = {
|
|
70
|
+
uoms: '计量单位', orgs: '组织架构',
|
|
71
|
+
'client-contacts': '客户联系人', 'supplier-contacts': '供应商联系人',
|
|
72
|
+
'client-price': '客户价格', 'supplier-price': '供应商价格',
|
|
73
|
+
'outsourcing-price': '外协价格',
|
|
74
|
+
'purchase-orders': '采购订单', 'sales-orders': '销售订单',
|
|
75
|
+
'outsourcing-orders': '外协订单',
|
|
76
|
+
'transfer-in-forms': '入库单', 'transfer-out-forms': '出库单',
|
|
77
|
+
'material-transfers': '物料移库',
|
|
78
|
+
'physical-inventory': '盘点', 'physical-inventory/form': '盘点表单',
|
|
79
|
+
'inventory-overage': '盘盈', 'inventory-shortage': '盘亏',
|
|
80
|
+
'stock-reservation': '库存预留',
|
|
81
|
+
'material-issue': '领料', 'material-return': '退料',
|
|
82
|
+
'cutting-material': '裁切投料',
|
|
83
|
+
'actual-production': '生产实绩',
|
|
84
|
+
'product-stock-in': '产品入库', 'product-stock-out': '产品出库',
|
|
85
|
+
'mes-result': 'MES 报工',
|
|
86
|
+
'plan-orders': '计划订单',
|
|
87
|
+
mrp: 'MRP 需求计划', aps: 'APS 排程',
|
|
88
|
+
quality: '质量检验',
|
|
89
|
+
'work-orders': '工单',
|
|
90
|
+
'work-centers': '工作中心', 'worker-groups': '工人班组',
|
|
91
|
+
'job-types': '工种',
|
|
92
|
+
'dict-types': '字典类型',
|
|
93
|
+
'replenish-orders': '补货订单',
|
|
94
|
+
quotations: '报价管理',
|
|
95
|
+
};
|
|
96
|
+
// ── 正则提取工具 ──
|
|
97
|
+
function extractDescription(content) {
|
|
98
|
+
const match = content.match(/\.description\('([^']*)'\)/);
|
|
99
|
+
return match ? match[1] : '';
|
|
100
|
+
}
|
|
101
|
+
function hasOption(content, opt) {
|
|
102
|
+
return content.includes(`'${opt}'`) || content.includes(`"${opt}"`);
|
|
103
|
+
}
|
|
104
|
+
// ── 全局命令(不在 liberica/arabica 目录下) ──
|
|
105
|
+
const GLOBAL_COMMANDS = {
|
|
106
|
+
context: {
|
|
107
|
+
description: 'Manage CLI context (environment, service, tenant)',
|
|
108
|
+
commands: {
|
|
109
|
+
show: 'Show current context',
|
|
110
|
+
'use-env': 'Switch environment (dev|test|prod-cn|prod-jp)',
|
|
111
|
+
'use-tenant': 'Switch tenant',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
auth: {
|
|
115
|
+
description: 'Manage authentication tokens',
|
|
116
|
+
commands: {
|
|
117
|
+
login: 'Login with token',
|
|
118
|
+
status: 'Check authentication status',
|
|
119
|
+
logout: 'Logout and clear token',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
skills: {
|
|
123
|
+
description: 'Manage Barista CLI AI skills',
|
|
124
|
+
commands: {
|
|
125
|
+
install: 'Install barista-cli skill for your AI assistant',
|
|
126
|
+
query: 'Search for barista commands by intent',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
// ── 扫描单个服务下的命令 ──
|
|
131
|
+
function scanService(serviceName, servicePath) {
|
|
132
|
+
const groupMap = GROUP_MAP[serviceName] || {};
|
|
133
|
+
const modules = {};
|
|
134
|
+
function walkDir(dirPath, baseModule) {
|
|
135
|
+
if (!fs.statSync(dirPath).isDirectory())
|
|
136
|
+
return;
|
|
137
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
138
|
+
const tsFiles = entries.filter(e => e.isFile() && e.name.endsWith('.ts') && e.name !== 'index.ts');
|
|
139
|
+
const subDirs = entries.filter(e => e.isDirectory() && e.name !== '__tests__' && e.name !== 'node_modules');
|
|
140
|
+
const hasIndex = entries.some(e => e.isFile() && e.name === 'index.ts');
|
|
141
|
+
// Read index.ts for module description
|
|
142
|
+
let moduleDesc = '';
|
|
143
|
+
if (hasIndex) {
|
|
144
|
+
const indexContent = fs.readFileSync(path.join(dirPath, 'index.ts'), 'utf-8');
|
|
145
|
+
moduleDesc = extractDescription(indexContent);
|
|
146
|
+
}
|
|
147
|
+
// If there are command files directly in this dir, add as a module
|
|
148
|
+
if (tsFiles.length > 0) {
|
|
149
|
+
const commands = {};
|
|
150
|
+
for (const file of tsFiles) {
|
|
151
|
+
const content = fs.readFileSync(path.join(dirPath, file.name), 'utf-8');
|
|
152
|
+
const cmdName = file.name.replace('.ts', '');
|
|
153
|
+
const desc = extractDescription(content);
|
|
154
|
+
commands[cmdName] = {};
|
|
155
|
+
if (desc)
|
|
156
|
+
commands[cmdName].description = desc;
|
|
157
|
+
// Detect standard options
|
|
158
|
+
if (hasOption(content, '--json'))
|
|
159
|
+
commands[cmdName].json = true;
|
|
160
|
+
if (hasOption(content, '--dry-run'))
|
|
161
|
+
commands[cmdName]['dry-run'] = true;
|
|
162
|
+
if (hasOption(content, '--force'))
|
|
163
|
+
commands[cmdName].force = true;
|
|
164
|
+
}
|
|
165
|
+
const moduleKey = baseModule || path.basename(dirPath);
|
|
166
|
+
const group = groupMap[moduleKey] || groupMap[moduleKey.split('/')[0]] || '其他';
|
|
167
|
+
modules[moduleKey] = {
|
|
168
|
+
group,
|
|
169
|
+
...(DISPLAY_MAP[moduleKey] ? { displayName: DISPLAY_MAP[moduleKey] } : {}),
|
|
170
|
+
...(moduleDesc ? { description: moduleDesc } : {}),
|
|
171
|
+
commands,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
// Recurse into subdirectories
|
|
175
|
+
for (const subDir of subDirs) {
|
|
176
|
+
const subModule = baseModule ? `${baseModule}/${subDir.name}` : subDir.name;
|
|
177
|
+
walkDir(path.join(dirPath, subDir.name), subModule);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
walkDir(servicePath, '');
|
|
181
|
+
return modules;
|
|
182
|
+
}
|
|
183
|
+
// ── 主函数 ──
|
|
184
|
+
function main() {
|
|
185
|
+
console.log('🔍 Scanning commands...');
|
|
186
|
+
const libericaDir = path.join(COMMANDS_DIR, 'liberica');
|
|
187
|
+
const arabicaDir = path.join(COMMANDS_DIR, 'arabica');
|
|
188
|
+
if (!fs.existsSync(libericaDir)) {
|
|
189
|
+
console.error(`❌ Liberica commands directory not found: ${libericaDir}`);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
if (!fs.existsSync(arabicaDir)) {
|
|
193
|
+
console.error(`❌ Arabica commands directory not found: ${arabicaDir}`);
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
const liberica = scanService('liberica', libericaDir);
|
|
197
|
+
const arabica = scanService('arabica', arabicaDir);
|
|
198
|
+
// Sort modules by group then name
|
|
199
|
+
function sortModules(modules) {
|
|
200
|
+
const groupOrder = ['认证', '基础资料', '联系人/价格', '供应链', '库存', '生产', '计划', '质量', '财务', 'HR', '团队', '其他', '套餐', '订阅', '订单', '发票', '企业', '访问'];
|
|
201
|
+
const sorted = {};
|
|
202
|
+
const entries = Object.entries(modules).sort((a, b) => {
|
|
203
|
+
const ga = groupOrder.indexOf(a[1].group);
|
|
204
|
+
const gb = groupOrder.indexOf(b[1].group);
|
|
205
|
+
if (ga !== gb)
|
|
206
|
+
return ga - gb;
|
|
207
|
+
return a[0].localeCompare(b[0]);
|
|
208
|
+
});
|
|
209
|
+
for (const [key, val] of entries) {
|
|
210
|
+
sorted[key] = val;
|
|
211
|
+
}
|
|
212
|
+
return sorted;
|
|
213
|
+
}
|
|
214
|
+
// Build global commands module
|
|
215
|
+
const globalModule = {};
|
|
216
|
+
for (const [modName, mod] of Object.entries(GLOBAL_COMMANDS)) {
|
|
217
|
+
const cmds = {};
|
|
218
|
+
for (const [cmdName, desc] of Object.entries(mod.commands)) {
|
|
219
|
+
cmds[cmdName] = {};
|
|
220
|
+
if (desc)
|
|
221
|
+
cmds[cmdName].description = desc;
|
|
222
|
+
}
|
|
223
|
+
globalModule[modName] = {
|
|
224
|
+
group: '全局',
|
|
225
|
+
description: mod.description,
|
|
226
|
+
commands: cmds,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const data = {
|
|
230
|
+
_metadata: {
|
|
231
|
+
generatedAt: new Date().toISOString(),
|
|
232
|
+
source: 'src/commands/',
|
|
233
|
+
generator: 'src/skills/barista-cli/scripts/generate.ts',
|
|
234
|
+
},
|
|
235
|
+
global: sortModules(globalModule),
|
|
236
|
+
liberica: sortModules(liberica),
|
|
237
|
+
arabica: sortModules(arabica),
|
|
238
|
+
};
|
|
239
|
+
// Count stats
|
|
240
|
+
let libericaCmds = 0;
|
|
241
|
+
let arabicaCmds = 0;
|
|
242
|
+
let globalCmds = 0;
|
|
243
|
+
for (const mod of Object.values(liberica)) {
|
|
244
|
+
libericaCmds += Object.keys(mod.commands || {}).length;
|
|
245
|
+
}
|
|
246
|
+
for (const mod of Object.values(arabica)) {
|
|
247
|
+
arabicaCmds += Object.keys(mod.commands || {}).length;
|
|
248
|
+
}
|
|
249
|
+
for (const mod of Object.values(globalModule)) {
|
|
250
|
+
globalCmds += Object.keys(mod.commands || {}).length;
|
|
251
|
+
}
|
|
252
|
+
// Write output to both locations
|
|
253
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
254
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
255
|
+
}
|
|
256
|
+
// Write JSON to both locations
|
|
257
|
+
const jsonContent = JSON.stringify(data, null, 2);
|
|
258
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
259
|
+
fs.writeFileSync(path.join(dir, 'commands.json'), jsonContent, 'utf-8');
|
|
260
|
+
}
|
|
261
|
+
// Also write YAML format manually since it's simpler for AI to read
|
|
262
|
+
const yamlLines = [];
|
|
263
|
+
yamlLines.push('# ★ 自动生成。修改源码后重新生成:npm run generate-skills-data');
|
|
264
|
+
yamlLines.push('# ★ 生成时间: ' + new Date().toISOString());
|
|
265
|
+
yamlLines.push('');
|
|
266
|
+
for (const service of ['global', 'liberica', 'arabica']) {
|
|
267
|
+
yamlLines.push(`${service}:`);
|
|
268
|
+
const modules = data[service];
|
|
269
|
+
let currentGroup = '';
|
|
270
|
+
for (const [modName, mod] of Object.entries(modules)) {
|
|
271
|
+
if (mod.group !== currentGroup) {
|
|
272
|
+
currentGroup = mod.group;
|
|
273
|
+
yamlLines.push(` # ── ${currentGroup} ──`);
|
|
274
|
+
}
|
|
275
|
+
const display = mod.displayName || modName;
|
|
276
|
+
yamlLines.push(` ${modName}:`);
|
|
277
|
+
yamlLines.push(` group: "${mod.group}"`);
|
|
278
|
+
if (mod.description) {
|
|
279
|
+
yamlLines.push(` description: "${mod.description}"`);
|
|
280
|
+
}
|
|
281
|
+
yamlLines.push(` commands:`);
|
|
282
|
+
for (const [cmdName, cmd] of Object.entries(mod.commands)) {
|
|
283
|
+
yamlLines.push(` ${cmdName}:`);
|
|
284
|
+
if (cmd.description) {
|
|
285
|
+
yamlLines.push(` description: "${cmd.description}"`);
|
|
286
|
+
}
|
|
287
|
+
const flags = [];
|
|
288
|
+
if (cmd.json)
|
|
289
|
+
flags.push('--json');
|
|
290
|
+
if (cmd['dry-run'])
|
|
291
|
+
flags.push('--dry-run');
|
|
292
|
+
if (cmd.force)
|
|
293
|
+
flags.push('--force');
|
|
294
|
+
if (flags.length > 0) {
|
|
295
|
+
yamlLines.push(` options: [${flags.join(', ')}]`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const yamlContent = yamlLines.join('\n');
|
|
301
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
302
|
+
fs.writeFileSync(path.join(dir, 'commands.yaml'), yamlContent, 'utf-8');
|
|
303
|
+
}
|
|
304
|
+
console.log(`✅ Generated commands.yaml + commands.json`);
|
|
305
|
+
console.log(` Global: ${Object.keys(globalModule).length} modules, ${globalCmds} commands`);
|
|
306
|
+
console.log(` Liberica: ${Object.keys(liberica).length} modules, ${libericaCmds} commands`);
|
|
307
|
+
console.log(` Arabica: ${Object.keys(arabica).length} modules, ${arabicaCmds} commands`);
|
|
308
|
+
console.log(` → src/skills/barista-cli/data/`);
|
|
309
|
+
console.log(` → skills/barista-cli/data/`);
|
|
310
|
+
}
|
|
311
|
+
main();
|
|
312
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/skills/barista-cli/scripts/generate.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GA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AAC,IAAI,CAAC,CAAC;IACzC,KAAK,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,EAAE,CAAC;QAClD,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,aAAa,UAAU,WAAW,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,aAAa,YAAY,WAAW,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,aAAa,WAAW,WAAW,CAAC,CAAC;IAC3F,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC/C,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newpeak/barista-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.132",
|
|
4
4
|
"description": "AI Tools CLI for Liberica and Arabica services",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"barista": "./bin/barista"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"
|
|
33
|
+
"generate-skills-data": "npx tsx src/skills/barista-cli/scripts/generate.ts",
|
|
34
|
+
"build": "npm run generate-skills-data && tsc",
|
|
34
35
|
"dev": "tsc --watch",
|
|
35
36
|
"start": "node ./bin/barista",
|
|
36
37
|
"test": "vitest",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"files": [
|
|
44
45
|
"dist",
|
|
45
46
|
"bin",
|
|
47
|
+
"skills",
|
|
46
48
|
"package.json",
|
|
47
49
|
"README.md",
|
|
48
50
|
"LICENSE"
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: barista-cli
|
|
3
|
+
description: >-
|
|
4
|
+
Barista CLI — 让 AI 助手通过命令行操控企业生产管理系统。
|
|
5
|
+
【Liberica】生产管理 SaaS(70+ 模块:基础资料/供应链/库存/生产/BOM/计划/质量/财务/HR/团队等)。
|
|
6
|
+
用户为租户企业员工,通过 tenant + username 登录。
|
|
7
|
+
【Arabica】Liberica 在线订阅平台(套餐/订阅下单/发票/企业管理)。
|
|
8
|
+
用户为会员(个人账号),通过 account + password 登录。
|
|
9
|
+
Actions: list, get, create, update, delete, submit, cancel, review, batch-review,
|
|
10
|
+
enable, disable, copy, track, export, import, compute, release, complete, register.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Barista CLI — AI 操控企业生产管理系统
|
|
14
|
+
|
|
15
|
+
## 系统关系
|
|
16
|
+
|
|
17
|
+
**Liberica** = 生产管理 SaaS(制造企业 ERP)。用户=**租户企业员工**,登录=tenant+username+password。
|
|
18
|
+
**Arabica** = Liberica 在线订阅平台。用户=**会员**(个人账号),登录=account+password。
|
|
19
|
+
|
|
20
|
+
两者用户体系完全独立,但有业务流程关联:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
会员注册 Arabica → 登录 → 注册企业 → 选套餐下单 → 获得 Liberica 权限
|
|
24
|
+
→ 员工登录 Liberica → 日常生产管理(采购/库存/生产/销售等)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## When to Apply
|
|
28
|
+
|
|
29
|
+
| 场景 | 系统 | 判断 |
|
|
30
|
+
|------|------|------|
|
|
31
|
+
| 生产数据(订单/库存/物料/BOM/工单/质量/财务/HR) | **Liberica** | 涉及制造企业日常运营 |
|
|
32
|
+
| 订阅/套餐/购买/发票/企业注册 | **Arabica** | 涉及购买 Liberica 服务 |
|
|
33
|
+
| 先看用户意图对应哪个业务领域 | 判断后再选系统 | 不确定时问用户 |
|
|
34
|
+
|
|
35
|
+
## CRITICAL: 关键陷阱(AI 必须遵守)
|
|
36
|
+
|
|
37
|
+
### 1. 邮箱用户名登录
|
|
38
|
+
```bash
|
|
39
|
+
# ✅ 正确:用位置参数
|
|
40
|
+
barista liberica auth login dev shanghai admin@shanghai.newpeaksh.com 123456
|
|
41
|
+
# ❌ 错误:--username 遇到 @ 会报 A0900006
|
|
42
|
+
barista liberica auth login --username admin@shanghai.newpeaksh.com
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. teams issues 的 --tenant 被忽略
|
|
46
|
+
```bash
|
|
47
|
+
# ✅ 正确:先切换 context
|
|
48
|
+
barista context use-tenant coffee
|
|
49
|
+
barista liberica teams issues update <id> --status CLOSED --assign-to <uid>
|
|
50
|
+
|
|
51
|
+
# ❌ 错误:--tenant coffee 被忽略,使用配置中的默认 tenant
|
|
52
|
+
barista liberica teams issues update <id> --status CLOSED --tenant coffee
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**已知忽略 --tenant 的命令**:teams issues update/close/get/delete
|
|
56
|
+
|
|
57
|
+
### 3. teams issues close 需要 --assign-to
|
|
58
|
+
```
|
|
59
|
+
A1506: 负责人ID列表不能为空
|
|
60
|
+
# 用 update 代替 close:
|
|
61
|
+
barista liberica teams issues update <id> --status CLOSED --assign-to <userId>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. 日期字段用 epoch ms
|
|
65
|
+
```bash
|
|
66
|
+
# ✅ 正确:Date.now() → 1746547200000
|
|
67
|
+
# ❌ 错误:"2025-05-06" 导致 B0001
|
|
68
|
+
```
|
|
69
|
+
影响命令:transfer-out-forms create(stockDate)、finance invoices create(invoiceDate)
|
|
70
|
+
|
|
71
|
+
### 5. Liberica vs Arabica 登录差异
|
|
72
|
+
| | Liberica | Arabica |
|
|
73
|
+
|--|----------|---------|
|
|
74
|
+
| 命令 | `barista liberica auth login <env> <tenant> <username> <password>` | `barista arabica auth login <env> <account> <password>` |
|
|
75
|
+
| 有无 tenant | 有 | 无 |
|
|
76
|
+
| 用户类型 | 企业员工 | 会员 |
|
|
77
|
+
| 注册 | 无注册命令 | `barista arabica auth register` |
|
|
78
|
+
|
|
79
|
+
### 6. 两个独立的问题系统
|
|
80
|
+
- `liberica issue submit` — 向开发团队上报需求/BUG(通过 Typica → GitLab Issue)
|
|
81
|
+
- 默认上报到 **CLI 项目**(barista)
|
|
82
|
+
- `--project-code arabica` 上报到 **Arabica 项目**
|
|
83
|
+
- `--project-code liberica` 上报到 **Liberica 项目**
|
|
84
|
+
- `--type BUG|REQUIREMENT|QUESTION` 指定问题类型
|
|
85
|
+
- 可用 `validate-project <code>` 验证项目代号是否有效
|
|
86
|
+
- `liberica teams issues` — 团队内部项目的问题管理(本地 DB)
|
|
87
|
+
- 关闭已上报的 issue:在 teams issues 中过滤 BARISTA 项目 ID `2048236204222570498`
|
|
88
|
+
|
|
89
|
+
### 7. token 存储
|
|
90
|
+
- Token 存在系统密钥链(keytar),fallback 到 AES-256-GCM 加密文件
|
|
91
|
+
- Liberica key 格式:`liberica:{environment}:{tenant}`
|
|
92
|
+
- Arabica key 格式:`arabica:{environment}`(无 tenant)
|
|
93
|
+
|
|
94
|
+
## 安全规则
|
|
95
|
+
|
|
96
|
+
所有写操作(create/update/delete/batch-*)必须先 dry-run 再 force:
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
// 1. 预览
|
|
100
|
+
const preview = await $`barista liberica <resource> <action> --dry-run --json`
|
|
101
|
+
const { success, data } = JSON.parse(preview.stdout)
|
|
102
|
+
if (!success) throw new Error(data.error?.message)
|
|
103
|
+
|
|
104
|
+
// 2. 验证 preview 内容是否正确
|
|
105
|
+
|
|
106
|
+
// 3. 执行
|
|
107
|
+
const result = await $`barista liberica <resource> <action> --force --json`
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 如何查找命令
|
|
111
|
+
|
|
112
|
+
当需要查找具体命令时,使用 search.py 按用户意图搜索。search.py 位于技能安装目录下的 `scripts/search.py`:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# 示例路径(根据你的 AI 平台调整):
|
|
116
|
+
python3 .claude/skills/barista-cli/scripts/search.py "<用户意图>" [--domain <domain>]
|
|
117
|
+
# 或使用 barista 内置搜索:
|
|
118
|
+
barista skills query "<用户意图>" [--domain <domain>]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**domain 选项**:
|
|
122
|
+
|
|
123
|
+
| domain | 搜索范围 |
|
|
124
|
+
|--------|----------|
|
|
125
|
+
| 不传 | 所有服务 |
|
|
126
|
+
| `liberica` | 仅 Liberica |
|
|
127
|
+
| `liberica.purchase-orders` | Liberica 采购订单模块 |
|
|
128
|
+
| `liberica.finance.invoices` | Liberica 财务发票子模块 |
|
|
129
|
+
| `arabica` | 仅 Arabica |
|
|
130
|
+
| `arabica.plans` | Arabica 套餐模块 |
|
|
131
|
+
|
|
132
|
+
**示例**:
|
|
133
|
+
```bash
|
|
134
|
+
python3 search.py "采购订单 列表" --domain liberica
|
|
135
|
+
python3 search.py "创建入库单"
|
|
136
|
+
python3 search.py "subscription" --domain arabica
|
|
137
|
+
python3 search.py "invoice" --domain arabica.invoices
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## JSON 响应格式
|
|
141
|
+
|
|
142
|
+
所有命令的 `--json` 输出遵循统一格式:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"success": true,
|
|
147
|
+
"data": {
|
|
148
|
+
"items": [...],
|
|
149
|
+
"pagination": { "page": 1, "size": 20, "total": 150 }
|
|
150
|
+
},
|
|
151
|
+
"meta": { "requestId": "...", "timestamp": "...", "environment": "dev", "tenant": "..." }
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
错误格式(两种):
|
|
156
|
+
```json
|
|
157
|
+
{ "success": false, "code": "B0301", "message": "TOKEN解析失败" }
|
|
158
|
+
{ "success": false, "error": { "code": "A150001", "message": "..." } }
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 常见错误
|
|
162
|
+
|
|
163
|
+
| 错误 | 含义 | 修复 |
|
|
164
|
+
|------|------|------|
|
|
165
|
+
| B0301 | Liberica token 过期/invalid | `barista liberica auth login <env> <tenant> <username> <password>` |
|
|
166
|
+
| A0307 | 获取 token 失败 | 同上 |
|
|
167
|
+
| Arabica 登录失败 | 会员 token 过期 | `barista arabica auth login <env> <account> <password>` |
|
|
168
|
+
| A958001 | teams issues 的 tenant 不对 | `barista context use-tenant <正确tenant>` 重试 |
|
|
169
|
+
| A1506 | 负责人 ID 列表为空 | 用 `update --status CLOSED --assign-to <id>` 代替 close |
|
|
170
|
+
| B0001 | 系统执行出错 | 检查日期格式(epoch ms)、必填参数 |
|
|
171
|
+
| A0900006 | 错误的账号 | 邮箱用位置参数,不用 --username |
|
|
172
|
+
| A1504 | HTTP 方法错误 | CLI 一般自动处理(list→GET,create→POST) |
|
|
173
|
+
|
|
174
|
+
## 内置 JSON 输出
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// AI 在 Claude Code / OpenCode 中执行:
|
|
178
|
+
const result = await $`barista liberica <resource> <action> --json`
|
|
179
|
+
const { success, data, error } = JSON.parse(result.stdout)
|
|
180
|
+
|
|
181
|
+
if (!success) {
|
|
182
|
+
if (error?.code === 'B0301') { /* need re-login */ }
|
|
183
|
+
throw new Error(error?.message)
|
|
184
|
+
}
|
|
185
|
+
const items = data?.items || []
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## ⚠️ 通用约束
|
|
189
|
+
|
|
190
|
+
1. ID 字段必须用 `string` 类型(后端返回 BigInteger 超出 JS number 精度)
|
|
191
|
+
2. 不加 `X-TENANT-ID` header(tenant 在 JWT 中)
|
|
192
|
+
3. Authorization 不加 `Bearer` 前缀
|
|
193
|
+
4. 分页 1-based 直传
|