eskill 1.0.17 → 1.0.18
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/cli.js +30 -9
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -135,15 +135,36 @@ program
|
|
|
135
135
|
|
|
136
136
|
console.log(formatSkillList(skills));
|
|
137
137
|
|
|
138
|
-
//
|
|
139
|
-
if (total > 0) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
console.log(
|
|
146
|
-
console.log(
|
|
138
|
+
// 显示分页信息和提示
|
|
139
|
+
if (total > 0 && skills.length > 0) {
|
|
140
|
+
const currentPage = pagination.page || parseInt(options.page);
|
|
141
|
+
const totalPages = pagination.totalPages || Math.ceil(total / skills.length);
|
|
142
|
+
const limit = pagination.limit || parseInt(options.limit);
|
|
143
|
+
|
|
144
|
+
// 分页信息
|
|
145
|
+
console.log(`┌─ 搜索结果 ──────────────────────────────────────────`);
|
|
146
|
+
console.log(`│ 总计: ${total} 个技能 | 当前: 第 ${currentPage}/${totalPages} 页 | 每页: ${limit} 个`);
|
|
147
|
+
console.log(`└────────────────────────────────────────────────────\n`);
|
|
148
|
+
|
|
149
|
+
// 安装提示(使用第一个结果作为示例)
|
|
150
|
+
const firstSkill = skills[0];
|
|
151
|
+
const skillName = firstSkill.name || firstSkill.title || 'skill-name';
|
|
152
|
+
const author = firstSkill.author || firstSkill.owner || 'author';
|
|
153
|
+
console.log(`💡 安装技能:`);
|
|
154
|
+
console.log(` eskill install ${skillName}@${author}\n`);
|
|
155
|
+
|
|
156
|
+
// 翻页提示
|
|
157
|
+
if (totalPages > 1) {
|
|
158
|
+
console.log(`📖 翻页:`);
|
|
159
|
+
if (currentPage < totalPages) {
|
|
160
|
+
console.log(` eskill search ${query} --page ${currentPage + 1}`);
|
|
161
|
+
console.log(` eskill search ${query} -p ${currentPage + 1} # 简写`);
|
|
162
|
+
}
|
|
163
|
+
if (currentPage > 1) {
|
|
164
|
+
console.log(` eskill search ${query} --page ${currentPage - 1} # 上一页`);
|
|
165
|
+
}
|
|
166
|
+
console.log(``);
|
|
167
|
+
}
|
|
147
168
|
}
|
|
148
169
|
} catch (error) {
|
|
149
170
|
spinner.fail(`搜索失败: ${error.message}`);
|