hookstack-cli 0.1.5 → 0.1.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.
Files changed (2) hide show
  1. package/bin/cli.mjs +4 -9
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'
3
3
  import { homedir } from 'os'
4
- import { join } from 'path'
4
+ import { join, dirname } from 'path'
5
5
  import { fileURLToPath } from 'url'
6
6
  import * as p from '@clack/prompts'
7
7
  import pc from 'picocolors'
@@ -17,7 +17,8 @@ import {
17
17
 
18
18
  const API_BASE = process.env.HOOKSTACK_API_BASE || 'https://hookstack.vercel.app'
19
19
  const REPO_URL = 'github.com/steve-magne/hookstack'
20
- const VERSION = '0.1.3'
20
+ const __dirname = dirname(fileURLToPath(import.meta.url))
21
+ const VERSION = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8')).version
21
22
 
22
23
  async function fetchHooks(slugs) {
23
24
  const url = `${API_BASE}/api/hooks?slugs=${slugs.map(encodeURIComponent).join(',')}`
@@ -222,7 +223,7 @@ async function main() {
222
223
  const args = parseArgs(process.argv)
223
224
 
224
225
  if (args.version) { console.log(VERSION); return }
225
- if (args.help || (!args.command && args.hooks.length === 0)) { console.log(HELP); return }
226
+ if (args.help || args.hooks.length === 0) { console.log(HELP); return }
226
227
 
227
228
  const command = args.command ?? 'install'
228
229
  if (command !== 'install') {
@@ -231,12 +232,6 @@ async function main() {
231
232
  process.exit(1)
232
233
  }
233
234
 
234
- if (args.hooks.length === 0) {
235
- console.error('✗ No hooks specified. Use --hooks=<slug1>,<slug2>')
236
- console.error(' Browse hooks at https://hookstack.vercel.app')
237
- process.exit(1)
238
- }
239
-
240
235
  const interactive = Boolean(process.stdout.isTTY) && !args.yes
241
236
  if (interactive) await interactiveInstall(args.hooks, args)
242
237
  else await directInstall(args.hooks, args)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hookstack-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "CLI installer for the Hookstack catalogue of Claude Code hooks",
5
5
  "type": "module",
6
6
  "bin": {