CLI
v4.1.2A powerful command-line interface tool for seamlessly integrating React hooks into your projects.
Note: Make sure you have Node.js 18.0 or higher installed. No installation required - use npx to run the CLI directly.
init
Initialize usehooks configuration in your project with smart project detection.
The init command detects your project structure, installs dependencies, adds utility functions, and configures your project.
Usage
npx usehooks-cli@latest init
add
Add hooks and their dependencies to your project.
Usage
npx usehooks-cli@latest add [hooks...]
Arguments
Options
update
Update hooks to their latest versions with automatic backup creation.
Usage
npx usehooks-cli@latest update [hooks...]
Arguments
Options
remove
Remove hooks from your project with smart dependency cleanup.
Usage
npx usehooks-cli@latest remove [hooks...]
Arguments
Options
list
View all available hooks in the registry, organized by category.
Usage
npx usehooks-cli@latest list
search
Search for hooks by name, description, or category with fuzzy matching.
Usage
npx usehooks-cli@latest search <query>
Arguments
Options
info
Get detailed information about a specific hook including examples, dependencies, and methods.
Usage
npx usehooks-cli@latest info <hook-name>
Arguments
Options
Examples
Here are some common usage examples for the usehooks CLI.
Initialize a new project
Start by initializing your project with the usehooks CLI configuration.
npx usehooks-cli@latest init
Add a specific hook
Add a specific hook to your project, for example use-counter.
npx usehooks-cli@latest add use-counter
Add multiple hooks
You can add multiple hooks at once by specifying them as arguments.
npx usehooks-cli@latest add use-counter use-fetch use-toggle
Search for hooks
Search for hooks by keyword with interactive selection.
npx usehooks-cli@latest search "fetch" --interactive --add
Update all hooks
Keep your hooks up-to-date with the latest versions.
npx usehooks-cli@latest update --all
Get hook information
Get detailed information about a hook before adding it.
npx usehooks-cli@latest info use-fetch
Features
The usehooks CLI comes with powerful features to enhance your development workflow.
🚀 Quick Installation
Add hooks to your project with a single command
🔍 Smart Search
Find hooks by name, description, or category with fuzzy matching
🔄 Update Management
Keep your hooks up-to-date with automatic backup creation
🗑️ Clean Removal
Remove hooks and their dependencies safely
⚡️ Zero Configuration
Works out of the box with smart project detection
🛡️ Type Safe
Full TypeScript support with proper type definitions
Need help?
Run any command with the --help
flag to see detailed usage information, or visit the npx usehooks-cli@latest list
command to see all available hooks.