
wkkkis-hooks
A tiny CLI for installing ready-to-use React/Next.js hooks from a public registry into your project.
Think of it as npm install โ but only for hooks.
โจ Features
- ๐ Install hooks directly from the wkkkis/hooks-registry
 
- ๐ Configurable install path (
src/hooks by default) 
- ๐ช Auto-update 
index.ts with exports 
- ๐ Search, list, update, remove hooks
 
- ๐งน Optional stripping of 
"use client" 
- ๐ Path alias rewriting (e.g. 
@/ โ relative paths) 
- ๐ฉบ Doctor check & README generator
 
๐ฆ Installation
npm install -g wkkkis-hooks
Requires Node.js 18+.
๐ Quick Start
# Initialize hooks.config.json in your project
wkkkis-hooks init
# Install a hook
wkkkis-hooks add use-debounce-callback
# List available hooks
wkkkis-hooks list
# Update a hook to the latest version
wkkkis-hooks update use-debounce-callback
# Remove a hook
wkkkis-hooks remove use-debounce-callback
โ๏ธ Configuration
The CLI creates a hooks.config.json in your project root:
{
  "baseDir": "src/hooks",
  "addIndex": true,
  "stripUseClient": false,
  "aliasPrefix": "@/ ",
  "aliasTarget": "src"
}
- baseDir โ where hooks will be installed.
 
- addIndex โ auto-maintain an 
index.ts with re-exports. 
- stripUseClient โ remove 
"use client" directive from installed hooks. 
- aliasPrefix / aliasTarget โ rewrite import paths from an alias (e.g. 
@/components) into relative paths when writing files. 
๐ Commands
wkkkis-hooks <command>
init                          Initialize project config
list                          Show available hooks
info <hook>                   Show hook metadata and files
add <hook> [--path=..]        Install a hook
update <hook> [--force]       Update a hook to latest version
remove <hook>                 Remove a hook
readme                        Generate HOOKS.md with documentation
preset <name>                 Install a preset (e.g. "essentials")
search <query>                Search hooks by id/name/description/tags
outdated                      Show hooks that have newer versions
doctor                        Validate installed hooks
migrate --path=<newDir>       Move hooks to a new folder
๐ Example
wkkkis-hooks init --path=src/shared/hooks --alias-prefix=@/ --alias-target=src
wkkkis-hooks add use-toggle
wkkkis-hooks add use-copy-to-clipboard
Now you can import:
import { useBoolean, useClipboard } from "@/hooks";
๐ค Contributing
Issues and PRs are welcome!
Hooks themselves live in wkkkis/hooks-registry.
This CLI just installs them into your project.
๐ License
MIT ยฉ 2025 wkkkis