hookcn
v1.2.0
Published
A CLI tool that instantly copies React hooks into your codebase
Maintainers
Readme
hookcn — All your hooks in one command
A CLI tool that instantly copies React hooks into your codebase.
hookcn started as a personal tool. Now it’s open for everyone. It lets you copy TypeScript React hooks directly into your codebase — no dependencies, full ownership.
🛠 Getting Started
Install the CLI globally:
npm install -g hookcn[!TIP] You can then run commands using
hookcn,hcn, oruse-hook-cli.
⚙️ Setup
Step 1: Initialize the Config
npx hookcn initThis creates a hooks.json file at your project root:
{
"destination": "src/hooks"
}This tells the CLI where to place downloaded hooks. You can update it anytime.
Step 2: Add a Hook
List available hooks from the registry:
npx hookcn listInstall a hook by name:
npx hookcn add <hook-name>The hook will be copied into the directory defined in hooks.json (default: src/hooks/).
📚 Documentation
Every hook comes with a markdown file inside the docs/ folder.
You can also explore all available hooks and their documentation online on Gitbook.
🤝 Contributing
Contributions are always welcome — whether it’s new hooks, CLI improvements, or documentation fixes.
Refer to this guide CONTRIBUTING.md for more details.
