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

context7

v1.0.3

Published

CLI to query the Context7 API

Readme

Context7 CLI (c7)

License: MIT

A simple and convenient command-line interface (CLI) for interacting with the Context7 API.

Quickly search for projects, get information about them, and query specific topics within a project's context, all directly from your terminal. Provides the c7 command.

⚠️ Important: All data provided by this tool comes directly from the official Context7 API (https://context7.com). This tool is simply a convenient wrapper and does not generate or host any content itself.

Features

  • Query: Ask questions or request information on specific topics within a project's documentation context.
  • Search: Discover available projects indexed by Context7 based on keywords.
  • Info: Get metadata about a specific project (like its source repository, last update time, etc.).
  • Flexible Output: Get query results in plain text (txt, default) or structured json.
  • Save Results: Easily save query output directly to a file (llms_{project}.{format}).
  • User-Friendly: Uses spinners for feedback during API calls and colored output for readability.

Installation

Prerequisites

  • Node.js (Version 18+ recommended for native fetch, but should work with v16+ if needed)
  • npm (usually comes with Node.js) or Bun

Install

npm install -g context7
yarn i -g context7
bun i -g context7

Usage

The basic command structure is:

c7 [command] [arguments...] [options...]

Commands

1. Query (Default Command)

Fetches information about a specific topic within a project. This is the default command if no other command (search, info) is specified.

Syntax:

c7 <projectname> <query...> [options]

Arguments:

  • <projectname>: The exact name of the project (e.g., nextjs, react, uv). Use c7 search <term> to find valid names. (Required)
  • <query...>: The topic, question, or keywords to query within the project's context. (Required)

Options:

  • --type, -t: Specify the output format.
    • txt (Default)
    • json
  • --save, -s: Save the output to a file named llms_{projectname}.{format} in the current directory instead of printing to the console. (Boolean flag)
  • --tokens, -k: Specify the maximum number of tokens for the API response. (e.g., --tokens 1000). The API default is used if omitted. (Number)

Examples:

# Get info about data fetching in Next.js (default TXT output)
c7 nextjs data fetching strategies

# Get info about state management in React, output as JSON
c7 react state management -t json

# Search for info on installation in the 'uv' project and save to llms_uv.txt
c7 uv installation steps --save

# Query Node.js streams and save the result as llms_nodejs.json
c7 nodejs streams api -t json -s

# Query Next.js data fetching and use only 1000 tokens
c7 nextjs data fetching -k 1000

2. Search

Searches for available Context7 projects based on a keyword in their title. It filters out projects whose internal path contains a /, as these are often duplicates or not directly queryable via this tool.

Syntax:

c7 search <term>

Arguments:

  • <term>: The keyword to search for in project titles (e.g., react, python, aws). (Required)

Example:

c7 search next
# Output might look like:
# --- Search Results (Use "Project Name" for queries) ---
#   - Next.js (Project Name: nextjs)
# -------------------------------------------------------
# Example query: c7 nextjs <your query>

3. Info

Displays metadata associated with a specific project.

Syntax:

c7 info <projectname>

Arguments:

  • <projectname>: The exact project name (e.g., nextjs, react). Use the name shown in parentheses from the search command results. (Required)

Example:

c7 info react
# Output will show details like Title, Project Name, Docs Source, Last Update, etc.

Getting Help

You can always get help on commands and options:

c7 --help          # General help for all commands
c7 query --help    # Help specifically for the query command (same as default)
c7 search --help   # Help for the search command
c7 info --help     # Help for the info command

Development

  1. Clone the repository.
  2. Install dependencies (npm install or bun install).
  3. Link for local testing (npm link or bun link).
  4. Make your changes!

License

MIT