@optima-chat/commerce-cli 1.4.1 → 1.5.1

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 (86) hide show
  1. package/.claude/skills/commerce-storefront/SKILL.md +183 -3
  2. package/dist/api/rest/commerce.d.ts +171 -2
  3. package/dist/api/rest/commerce.d.ts.map +1 -1
  4. package/dist/api/rest/commerce.js +167 -0
  5. package/dist/api/rest/commerce.js.map +1 -1
  6. package/dist/commands/merchant/info.js +3 -3
  7. package/dist/commands/merchant/info.js.map +1 -1
  8. package/dist/commands/merchant/setup.js +3 -3
  9. package/dist/commands/merchant/setup.js.map +1 -1
  10. package/dist/commands/merchant/update.js +5 -5
  11. package/dist/commands/merchant/update.js.map +1 -1
  12. package/dist/commands/section/create.d.ts +3 -0
  13. package/dist/commands/section/create.d.ts.map +1 -0
  14. package/dist/commands/section/create.js +218 -0
  15. package/dist/commands/section/create.js.map +1 -0
  16. package/dist/commands/section/delete.d.ts +3 -0
  17. package/dist/commands/section/delete.d.ts.map +1 -0
  18. package/dist/commands/section/delete.js +86 -0
  19. package/dist/commands/section/delete.js.map +1 -0
  20. package/dist/commands/section/hide.d.ts +3 -0
  21. package/dist/commands/section/hide.d.ts.map +1 -0
  22. package/dist/commands/section/hide.js +82 -0
  23. package/dist/commands/section/hide.js.map +1 -0
  24. package/dist/commands/section/index.d.ts +4 -0
  25. package/dist/commands/section/index.d.ts.map +1 -0
  26. package/dist/commands/section/index.js +23 -0
  27. package/dist/commands/section/index.js.map +1 -0
  28. package/dist/commands/section/list.d.ts +3 -0
  29. package/dist/commands/section/list.d.ts.map +1 -0
  30. package/dist/commands/section/list.js +164 -0
  31. package/dist/commands/section/list.js.map +1 -0
  32. package/dist/commands/section/product/create.d.ts +3 -0
  33. package/dist/commands/section/product/create.d.ts.map +1 -0
  34. package/dist/commands/section/product/create.js +208 -0
  35. package/dist/commands/section/product/create.js.map +1 -0
  36. package/dist/commands/section/product/delete.d.ts +3 -0
  37. package/dist/commands/section/product/delete.d.ts.map +1 -0
  38. package/dist/commands/section/product/delete.js +85 -0
  39. package/dist/commands/section/product/delete.js.map +1 -0
  40. package/dist/commands/section/product/hide.d.ts +3 -0
  41. package/dist/commands/section/product/hide.d.ts.map +1 -0
  42. package/dist/commands/section/product/hide.js +78 -0
  43. package/dist/commands/section/product/hide.js.map +1 -0
  44. package/dist/commands/section/product/index.d.ts +4 -0
  45. package/dist/commands/section/product/index.d.ts.map +1 -0
  46. package/dist/commands/section/product/index.js +17 -0
  47. package/dist/commands/section/product/index.js.map +1 -0
  48. package/dist/commands/section/product/list.d.ts +3 -0
  49. package/dist/commands/section/product/list.d.ts.map +1 -0
  50. package/dist/commands/section/product/list.js +157 -0
  51. package/dist/commands/section/product/list.js.map +1 -0
  52. package/dist/commands/section/product/reorder.d.ts +3 -0
  53. package/dist/commands/section/product/reorder.d.ts.map +1 -0
  54. package/dist/commands/section/product/reorder.js +110 -0
  55. package/dist/commands/section/product/reorder.js.map +1 -0
  56. package/dist/commands/section/product/update.d.ts +3 -0
  57. package/dist/commands/section/product/update.d.ts.map +1 -0
  58. package/dist/commands/section/product/update.js +127 -0
  59. package/dist/commands/section/product/update.js.map +1 -0
  60. package/dist/commands/section/reorder.d.ts +3 -0
  61. package/dist/commands/section/reorder.d.ts.map +1 -0
  62. package/dist/commands/section/reorder.js +111 -0
  63. package/dist/commands/section/reorder.js.map +1 -0
  64. package/dist/commands/section/translation/delete.d.ts +3 -0
  65. package/dist/commands/section/translation/delete.d.ts.map +1 -0
  66. package/dist/commands/section/translation/delete.js +97 -0
  67. package/dist/commands/section/translation/delete.js.map +1 -0
  68. package/dist/commands/section/translation/index.d.ts +4 -0
  69. package/dist/commands/section/translation/index.d.ts.map +1 -0
  70. package/dist/commands/section/translation/index.js +11 -0
  71. package/dist/commands/section/translation/index.js.map +1 -0
  72. package/dist/commands/section/translation/list.d.ts +3 -0
  73. package/dist/commands/section/translation/list.d.ts.map +1 -0
  74. package/dist/commands/section/translation/list.js +104 -0
  75. package/dist/commands/section/translation/list.js.map +1 -0
  76. package/dist/commands/section/translation/set.d.ts +3 -0
  77. package/dist/commands/section/translation/set.d.ts.map +1 -0
  78. package/dist/commands/section/translation/set.js +151 -0
  79. package/dist/commands/section/translation/set.js.map +1 -0
  80. package/dist/commands/section/update.d.ts +3 -0
  81. package/dist/commands/section/update.d.ts.map +1 -0
  82. package/dist/commands/section/update.js +137 -0
  83. package/dist/commands/section/update.js.map +1 -0
  84. package/dist/index.js +8 -6
  85. package/dist/index.js.map +1 -1
  86. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import inquirer from 'inquirer';
4
+ import { commerceApi } from '../../../api/rest/commerce.js';
5
+ import { handleError, createApiError, ValidationError } from '../../../utils/error.js';
6
+ import { output } from '../../../utils/output.js';
7
+ import { addEnhancedHelp } from '../../../utils/helpText.js';
8
+ import { isInteractiveEnvironment } from '../../../utils/interactive.js';
9
+ const cmd = new Command('set')
10
+ .description('Set (create or update) translation for a section')
11
+ .argument('<handle>', 'Section handle')
12
+ .option('--lang <code>', 'Language code, e.g. en-US, zh-CN, ja-JP (required)')
13
+ .option('--title <title>', 'Translated title (required)')
14
+ .option('--content <content>', 'Translated content in Markdown (required)')
15
+ .option('--product-id <id>', 'Product ID (for product-level translation)')
16
+ .action(async (handle, options) => {
17
+ try {
18
+ await setTranslation(handle, options);
19
+ }
20
+ catch (error) {
21
+ handleError(error);
22
+ }
23
+ });
24
+ addEnhancedHelp(cmd, {
25
+ examples: [
26
+ '# Add Chinese translation for merchant-level care section',
27
+ '$ commerce section translation set care --lang zh-CN --title "护理说明" --content "机洗,30度冷水。"',
28
+ '',
29
+ '# Add Japanese translation for product-level section',
30
+ '$ commerce section translation set care --product-id prod-123 --lang ja-JP --title "お手入れ方法" --content "洗濯機で洗えます。"',
31
+ '',
32
+ '# Update existing translation',
33
+ '$ commerce section translation set care --lang zh-CN --title "护理说明" --content "更新后的内容"',
34
+ ],
35
+ output: {
36
+ example: JSON.stringify({
37
+ success: true,
38
+ data: {
39
+ language_code: 'zh-CN',
40
+ title: '护理说明',
41
+ content: '机洗,30度冷水。',
42
+ },
43
+ message: '翻译设置成功',
44
+ }, null, 2),
45
+ },
46
+ relatedCommands: [
47
+ { command: 'section translation list', description: 'View translations' },
48
+ { command: 'section translation delete', description: 'Delete translation' },
49
+ { command: 'i18n languages', description: 'List supported languages' },
50
+ ],
51
+ notes: [
52
+ 'This creates a new translation or updates an existing one',
53
+ 'Supported languages: en-US, zh-CN, zh-HK, zh-TW, vi-VN, es-ES, ja-JP',
54
+ 'Without --product-id: sets merchant-level translation',
55
+ 'With --product-id: sets product-level translation',
56
+ ],
57
+ });
58
+ export const setTranslationCommand = cmd;
59
+ async function setTranslation(handle, options) {
60
+ let { lang, title, content, productId } = options;
61
+ // 非交互模式验证
62
+ if (!isInteractiveEnvironment()) {
63
+ if (!lang || lang.trim().length === 0) {
64
+ throw new ValidationError('缺少必需参数: --lang (语言代码)', 'lang');
65
+ }
66
+ if (!title || title.trim().length === 0) {
67
+ throw new ValidationError('缺少必需参数: --title (翻译标题)', 'title');
68
+ }
69
+ if (!content || content.trim().length === 0) {
70
+ throw new ValidationError('缺少必需参数: --content (翻译内容)', 'content');
71
+ }
72
+ }
73
+ else {
74
+ // 交互模式
75
+ const answers = await inquirer.prompt([
76
+ {
77
+ type: 'list',
78
+ name: 'lang',
79
+ message: '语言:',
80
+ choices: [
81
+ { name: 'English (US)', value: 'en-US' },
82
+ { name: '简体中文', value: 'zh-CN' },
83
+ { name: '繁體中文 (香港)', value: 'zh-HK' },
84
+ { name: '繁體中文 (台灣)', value: 'zh-TW' },
85
+ { name: 'Tiếng Việt', value: 'vi-VN' },
86
+ { name: 'Español', value: 'es-ES' },
87
+ { name: '日本語', value: 'ja-JP' },
88
+ ],
89
+ when: !lang,
90
+ },
91
+ {
92
+ type: 'input',
93
+ name: 'title',
94
+ message: '翻译标题:',
95
+ when: !title,
96
+ validate: (input) => (input.trim().length > 0 ? true : '标题不能为空'),
97
+ },
98
+ {
99
+ type: 'editor',
100
+ name: 'content',
101
+ message: '翻译内容 (Markdown):',
102
+ when: !content,
103
+ },
104
+ ]);
105
+ lang = lang || answers.lang;
106
+ title = title || answers.title;
107
+ content = content || answers.content;
108
+ }
109
+ const level = productId ? '商品级' : '商户级';
110
+ const spinner = output.spinner(`正在设置${level}翻译...`);
111
+ try {
112
+ let result;
113
+ if (productId) {
114
+ result = await commerceApi.productSections.product.translations.set(productId, handle, lang, {
115
+ title: title,
116
+ content: content,
117
+ });
118
+ }
119
+ else {
120
+ result = await commerceApi.productSections.merchant.translations.set(handle, lang, {
121
+ title: title,
122
+ content: content,
123
+ });
124
+ }
125
+ spinner.succeed('翻译设置成功!');
126
+ if (output.isJson()) {
127
+ output.success(result, '翻译设置成功');
128
+ }
129
+ else {
130
+ console.log();
131
+ console.log(chalk.green('✓ 翻译设置成功!'));
132
+ console.log();
133
+ console.log(chalk.gray('区块: ') + chalk.cyan(handle));
134
+ console.log(chalk.gray('语言: ') + chalk.white(result.language_code));
135
+ console.log(chalk.gray('标题: ') + chalk.white(result.title));
136
+ if (result.content) {
137
+ const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
138
+ console.log(chalk.gray('内容: ') + chalk.white(preview));
139
+ }
140
+ if (productId) {
141
+ console.log(chalk.gray('商品ID: ') + chalk.white(productId));
142
+ }
143
+ console.log();
144
+ }
145
+ }
146
+ catch (error) {
147
+ spinner.fail('设置翻译失败');
148
+ throw createApiError(error);
149
+ }
150
+ }
151
+ //# sourceMappingURL=set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/commands/section/translation/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC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,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare const updateSectionCommand: Command;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/section/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiFpC,eAAO,MAAM,oBAAoB,SAAM,CAAC"}
@@ -0,0 +1,137 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { commerceApi } from '../../api/rest/commerce.js';
4
+ import { handleError, createApiError, ValidationError } from '../../utils/error.js';
5
+ import { output } from '../../utils/output.js';
6
+ import { addEnhancedHelp } from '../../utils/helpText.js';
7
+ import { isInteractiveEnvironment } from '../../utils/interactive.js';
8
+ const cmd = new Command('update')
9
+ .description('Update a product page section customization (merchant-level)')
10
+ .argument('<handle>', 'Section handle to update')
11
+ .option('--type <type>', 'Section type: collapsible | static')
12
+ .option('--position <n>', 'Display position')
13
+ .option('--content <text>', 'Section content in Markdown')
14
+ .option('--tab-group <group>', 'Tab group name (use empty string to clear)')
15
+ .action(async (handle, options) => {
16
+ try {
17
+ await updateSection(handle, options);
18
+ }
19
+ catch (error) {
20
+ handleError(error);
21
+ }
22
+ });
23
+ addEnhancedHelp(cmd, {
24
+ examples: [
25
+ '# Update section content',
26
+ '$ commerce section update care --content "New care instructions..."',
27
+ '',
28
+ '# Update section position',
29
+ '$ commerce section update care --position 5',
30
+ '',
31
+ '# Update multiple fields',
32
+ '$ commerce section update care --type static --position 3 --content "Updated content"',
33
+ '',
34
+ '# Move section to a tab group',
35
+ '$ commerce section update care --tab-group product-info',
36
+ '',
37
+ '# Remove from tab group (make independent)',
38
+ '$ commerce section update care --tab-group ""',
39
+ ],
40
+ output: {
41
+ example: JSON.stringify({
42
+ success: true,
43
+ data: {
44
+ id: 'customization-uuid',
45
+ merchant_id: 'merchant-uuid',
46
+ handle: 'care',
47
+ operation_type: 'override',
48
+ type: 'collapsible',
49
+ position: 5,
50
+ content: 'New care instructions...',
51
+ tab_group: null,
52
+ created_at: '2025-11-27T00:00:00Z',
53
+ updated_at: '2025-11-27T00:00:00Z',
54
+ },
55
+ message: '区块更新成功',
56
+ }, null, 2),
57
+ },
58
+ relatedCommands: [
59
+ { command: 'section list --resolved', description: 'View all sections' },
60
+ { command: 'section create', description: 'Create a section' },
61
+ { command: 'section delete', description: 'Delete a customization' },
62
+ ],
63
+ notes: [
64
+ 'Only updates the fields you specify',
65
+ 'The section must have a merchant customization to update',
66
+ 'Use section create first if the section has no customization',
67
+ ],
68
+ });
69
+ export const updateSectionCommand = cmd;
70
+ async function updateSection(handle, options) {
71
+ const { type, position, content, tabGroup } = options;
72
+ // 验证至少有一个更新字段
73
+ if (!type && !position && !content && tabGroup === undefined) {
74
+ if (!isInteractiveEnvironment()) {
75
+ throw new ValidationError('至少需要一个更新字段: --type, --position, --content, 或 --tab-group', 'options');
76
+ }
77
+ else {
78
+ console.log(chalk.yellow('提示: 请指定要更新的字段'));
79
+ console.log(chalk.gray(' --type <type> 区块类型'));
80
+ console.log(chalk.gray(' --position <n> 显示位置'));
81
+ console.log(chalk.gray(' --content <text> 区块内容'));
82
+ console.log(chalk.gray(' --tab-group <group> Tab分组'));
83
+ return;
84
+ }
85
+ }
86
+ // 验证 type
87
+ if (type) {
88
+ const validTypes = ['collapsible', 'static'];
89
+ if (!validTypes.includes(type)) {
90
+ throw new ValidationError(`无效的区块类型: ${type}。有效值: ${validTypes.join(', ')}`, 'type');
91
+ }
92
+ }
93
+ const spinner = output.spinner('正在更新区块...');
94
+ try {
95
+ const data = {};
96
+ if (type) {
97
+ data.type = type;
98
+ }
99
+ if (position) {
100
+ data.position = parseInt(position, 10);
101
+ }
102
+ if (content) {
103
+ data.content = content;
104
+ }
105
+ if (tabGroup !== undefined) {
106
+ data.tab_group = tabGroup || null;
107
+ }
108
+ const result = await commerceApi.productSections.merchant.update(handle, data);
109
+ spinner.succeed('区块更新成功!');
110
+ if (output.isJson()) {
111
+ output.success(result, '区块更新成功');
112
+ }
113
+ else {
114
+ console.log();
115
+ console.log(chalk.green('✓ 区块更新成功!'));
116
+ console.log();
117
+ console.log(chalk.gray('ID: ') + chalk.cyan(result.id));
118
+ console.log(chalk.gray('Handle: ') + chalk.white(result.handle));
119
+ console.log(chalk.gray('操作类型: ') + chalk.white(result.operation_type));
120
+ console.log(chalk.gray('区块类型: ') + chalk.white(result.type));
121
+ console.log(chalk.gray('位置: ') + chalk.white(result.position.toString()));
122
+ if (result.tab_group) {
123
+ console.log(chalk.gray('Tab分组: ') + chalk.white(result.tab_group));
124
+ }
125
+ if (result.content) {
126
+ const preview = result.content.length > 100 ? result.content.substring(0, 100) + '...' : result.content;
127
+ console.log(chalk.gray('内容: ') + chalk.white(preview));
128
+ }
129
+ console.log();
130
+ }
131
+ }
132
+ catch (error) {
133
+ spinner.fail('更新区块失败');
134
+ throw createApiError(error);
135
+ }
136
+ }
137
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/section/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC9B,WAAW,CAAC,8DAA8D,CAAC;KAC3E,QAAQ,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAChD,MAAM,CAAC,eAAe,EAAE,oCAAoC,CAAC;KAC7D,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;KAC5C,MAAM,CAAC,kBAAkB,EAAE,6BAA6B,CAAC;KACzD,MAAM,CAAC,qBAAqB,EAAE,4CAA4C,CAAC;KAC3E,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAsB,EAAE,EAAE;IACvD,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,eAAe,CAAC,GAAG,EAAE;IACnB,QAAQ,EAAE;QACR,0BAA0B;QAC1B,qEAAqE;QACrE,EAAE;QACF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AC1E,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;gBACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { i18nCommand } from './commands/i18n/index.js';
21
21
  import homepage from './commands/homepage/index.js';
22
22
  import collection from './commands/collection/index.js';
23
23
  import { testCommand } from './commands/test/index.js';
24
+ import { sectionCommand } from './commands/section/index.js';
24
25
  import { output } from './utils/output.js';
25
26
  const __filename = fileURLToPath(import.meta.url);
26
27
  const __dirname = dirname(__filename);
@@ -35,7 +36,7 @@ program
35
36
  .option('--pretty', '输出表格格式(人类可读)')
36
37
  .addHelpText('after', `
37
38
  Output Formats:
38
- All 93 commands support two output formats:
39
+ All 111+ commands support two output formats:
39
40
 
40
41
  --json JSON format (default) - Machine-readable, AI-friendly
41
42
  Returns: { success: true, data: {...} }
@@ -104,18 +105,19 @@ program.addCommand(i18nCommand);
104
105
  program.addCommand(testCommand);
105
106
  program.addCommand(homepage);
106
107
  program.addCommand(collection);
108
+ program.addCommand(sectionCommand);
107
109
  program
108
110
  .command('version')
109
111
  .description('显示版本信息')
110
112
  .action(() => {
111
- console.log(chalk.cyan(`Optima CLI v${VERSION}`));
112
- console.log(chalk.gray('15 个模块,93 个命令,完整电商管理功能'));
113
+ console.log(chalk.cyan(`Commerce CLI v${VERSION}`));
114
+ console.log(chalk.gray('16 个模块,111+ 个命令,完整电商管理功能'));
113
115
  });
114
116
  program.action(() => {
115
- console.log(chalk.cyan.bold(`\n✨ Optima CLI v${VERSION}\n`));
117
+ console.log(chalk.cyan.bold(`\n✨ Commerce CLI v${VERSION}\n`));
116
118
  console.log(chalk.white('用自然语言管理你的电商店铺 - 专为 Claude Code 设计\n'));
117
- console.log(chalk.green('✅ 已提供 15 个模块、93 个命令'));
118
- console.log(chalk.gray(' 覆盖商品、订单、库存、物流、首页配置、集合、变体翻译、国际化等完整功能\n'));
119
+ console.log(chalk.green('✅ 已提供 16 个模块、111+ 个命令'));
120
+ console.log(chalk.gray(' 覆盖商品、订单、库存、物流、首页配置、集合、商品页区块、国际化等完整功能\n'));
119
121
  console.log(chalk.white('🚀 快速开始:'));
120
122
  console.log(chalk.gray(' 1. 登录: ') + chalk.cyan('commerce auth login'));
121
123
  console.log(chalk.gray(' 2. 查看商户信息: ') + chalk.cyan('commerce merchant info'));
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/commerce-cli",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "description": "用自然语言管理电商店铺 - 专为 Claude Code 设计的对话式 CLI 工具,支持多环境和功能测试",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",