harveyz-skill 0.6.1 → 0.6.2
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/bin/cli.js +15 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -264,8 +264,23 @@ const scopeArg = scopeIdx !== -1 ? installArgs[scopeIdx + 1] : undefined
|
|
|
264
264
|
|
|
265
265
|
const TOOL_BUNDLE_VALUES = new Set(TOOL_BUNDLE_CHOICES.map(c => c.value))
|
|
266
266
|
|
|
267
|
+
function requireFzf() {
|
|
268
|
+
const probe = spawnSync('fzf', ['--version'], { encoding: 'utf8' })
|
|
269
|
+
if (probe.error || probe.status !== 0) {
|
|
270
|
+
console.error(chalk.red(' ✗ fzf is required but not installed.'))
|
|
271
|
+
console.error('')
|
|
272
|
+
console.error(' Install it with:')
|
|
273
|
+
console.error(chalk.cyan(' brew install fzf') + chalk.dim(' # macOS'))
|
|
274
|
+
console.error(chalk.cyan(' sudo apt install fzf') + chalk.dim(' # Debian/Ubuntu'))
|
|
275
|
+
console.error(chalk.cyan(' sudo dnf install fzf') + chalk.dim(' # Fedora'))
|
|
276
|
+
console.error('')
|
|
277
|
+
process.exit(1)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
267
281
|
// 用 fzf 交互式选择 skill/tool,返回选中的 item 列表
|
|
268
282
|
function fzfSelect() {
|
|
283
|
+
requireFzf()
|
|
269
284
|
const skillItems = getAllSkillItems()
|
|
270
285
|
const toolItems = getAllToolItems()
|
|
271
286
|
const previewPath = path.join(__dirname, 'preview.mjs')
|