npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

usehooks-cli

v4.1.2

Published

A CLI for adding React hooks to your project

Readme

usehooks CLI

A powerful command-line interface tool for seamlessly integrating React hooks into your projects. Inspired by shadcn/ui's component workflow, usehooks CLI makes it easy to add, manage, and discover hooks in your React applications. Visit usehooks.io

Features

  • 🚀 Quick Installation: Add hooks to your project with a single command
  • 📦 Curated Collection: Production-ready hooks from the usehooks.io library
  • 🔍 Smart Search: Find hooks by name, description, or category
  • 📋 Detailed Information: Get comprehensive details about any hook
  • 🔄 Update Management: Keep your hooks up-to-date with the latest versions
  • 🗑️ Clean Removal: Remove hooks and their dependencies safely
  • ⚡️ Zero Configuration: Works out of the box with smart project detection
  • 🎨 Customizable: Flexible configuration options
  • 🛡️ Type Safe: Full TypeScript support
  • 📱 Interactive Mode: User-friendly prompts and confirmations

Requirements

  • Node.js 18.0.0 or higher
  • A React project (Next.js, Vite, Create React App, etc.)

Installation

No installation required! Use npx to run the CLI directly:

npx usehooks-cli@latest init

Usage

add

After initializing your project with npx usehooks-cli@latest init, you can start adding hooks to your components:

npx usehooks-cli@latest add [hooks]

Options:

  • -y, --yes - Skip confirmation prompt
  • -o, --overwrite - Overwrite existing files
  • -c, --cwd - Specify working directory
  • -p, --path - Custom path for hook installation

Example

npx usehooks-cli@latest add use-counter

This command will scaffold the necessary files and update your component to use the use-counter hook.

update

Update hooks to their latest versions.

npx usehooks-cli@latest update [hooks...]

Options:

  • -a, --all - Update all installed hooks
  • -y, --yes - Skip confirmation prompt
  • -c, --cwd - Specify working directory Examples:
# Update a specific hook
npx usehooks-cli@latest update use-counter

# Update all hooks
npx usehooks-cli@latest update --all

# Update multiple specific hooks
npx usehooks-cli@latest update use-counter use-fetch

Features:

  • Content comparison to detect changes
  • Automatic backup creation
  • Dependency management
  • Error recovery with rollback
  • Interactive selection mode

remove

Remove hooks from your project.

npx usehooks-cli@latest remove [hooks...]

Options:

  • -y, --yes - Skip confirmation prompt
  • -c, --cwd - Specify working directory
  • --clean-deps - Remove unused dependencies Examples:
# Remove a specific hook
npx usehooks-cli@latest remove use-counter

# Remove multiple hooks
npx usehooks-cli@latest remove use-counter use-fetch

# Remove with dependency cleanup
npx usehooks-cli@latest remove use-counter --clean-deps

Features:

  • Smart dependency detection
  • Usage checking to prevent accidental removal
  • Interactive selection mode
  • Safe dependency cleanup

list

View all available hooks in the registry.

npx usehooks-cli@latest list

Features:

  • Categorized hook listing
  • Hook descriptions and metadata
  • Installation status indicators
  • Filterable by category

search

Search for hooks by name, description, or category.

npx usehooks-cli@latest search <query>

Options:

  • -c, --category - Filter by specific category
  • -i, --interactive - Interactive search mode
  • -a, --add - Add selected hook after search Examples:
# Search for hooks related to "fetch"
npx usehooks-cli@latest search "fetch"

# Search within a specific category
npx usehooks-cli@latest search "state" --category "State"

# Interactive search with option to add
npx usehooks-cli@latest search "counter" --interactive --add

Features:

  • Fuzzy matching
  • Relevance scoring
  • Multi-criteria search (name, description, category)
  • Interactive selection
  • Quick add functionality

info

Get detailed information about a specific hook.

npx usehooks-cli@latest info <hook-name>

Options:

  • -e, --examples - Show only examples
  • -d, --dependencies - Show only dependencies
  • -m, --methods - Show only methods Examples:
# Get full information about a hook
npx usehooks-cli@latest info use-fetch

# Show only examples
npx usehooks-cli@latest info use-fetch --examples

# Show only dependencies
npx usehooks-cli@latest info use-fetch --dependencies

Features:

  • Comprehensive hook documentation
  • Parameter and return type information
  • Usage examples
  • Dependency information
  • Method descriptions
  • Rich formatting

Hooks

usehooks CLI comes with a curated collection of production-ready hooks. To view the full list, run:

npx usehooks-cli@latest list

License

usehooks CLI is open-source software licensed under the MIT License.