hookcn

1.2.0 • Public • Published

hookcn — All your hooks in one command

A CLI tool that instantly copies React hooks into your codebase.

npm version downloads license


Cover Image

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, or use-hook-cli.

⚙️ Setup

Step 1: Initialize the Config

npx hookcn init

This 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 list

Install 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.

Package Sidebar

Install

npm i hookcn

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

11.4 kB

Total Files

7

Last publish

Collaborators

  • azlibdar