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

repobrief-cli

v0.1.1

Published

Generate a structured, token-conscious Markdown brief of a repository for AI coding assistants.

Readme

RepoBrief

Give your AI the context it needs.

RepoBrief analyzes a local repository and generates a structured, token-conscious Markdown brief: project overview, technology stack, directory structure, entry points, development commands, conventions and a prioritized selection of source files. Hand it to Claude Code, Cursor or any other LLM tool so it understands your codebase before it changes anything.

It does not dump every file into one huge prompt. It picks the most useful files first, stays within a size limit, and leaves secrets out.

  • Runs entirely locally. No account, server, API key or network requests.
  • Zero runtime dependencies. Node.js 20+.
  • Never modifies your source files.

Repository: github.com/Sameera-MHK/repo-brief · Owner: sameera_mhk

Installation

npm install -g repobrief-cli

Or run it without installing:

npx repobrief-cli generate .

Quick start

cd my-project
repobrief analyze .     # quick terminal summary
repobrief generate .    # writes ./repobrief.md

Then give repobrief.md to your AI assistant, for example: "Read repobrief.md before making changes."

Example generated brief

# Repository Brief: sample-app

> Generated by RepoBrief. Read this brief first, then inspect the original source files before making changes.

## Project Overview

**Description (package.json):** A sample Express app
**Package:** `sample-app` (version 1.2.3)
**From README.md:** Sample app that serves a small API.
**Files:** 9 found, 7 eligible, 2 excluded, 7 included below.

## Technology Stack

- **Languages (by file extension):** JavaScript (4), JSON (1), Markdown (1), Shell (1)
- **Frameworks:** Express (package.json dependencies)
- **Testing:** Vitest (package.json devDependencies)

## Directory Structure
...
## Architecture and Entry Points

**Confirmed** (declared in configuration):
- `src/server.js` — package.json "main"

**Inferred** (from file names and locations; verify before relying on them):
- `src/routes/users.js` — possible route or API handler (path naming)

## Development Commands

- `npm run start` — `node src/server.js`

## Important Files
## Coding Conventions
## Source Context
## AI Assistant Instructions

Commands

repobrief generate [path]

Analyzes the repository at path (default .) and writes a brief. The default output is repobrief.md inside the target directory (repobrief.json with --json).

repobrief analyze [path]

Prints a concise summary: project name, languages, frameworks, important dependencies, repository/selected/excluded file counts, approximate output size and detected entry points. Add --json for machine-readable output.

Options

| Flag | Description | | --- | --- | | -o, --output <path> | Output file location. | | --max-files <n> | Maximum number of source files to include (default 50). | | --max-chars <n> | Maximum total generated characters (default 200000). | | --include <glob> | Only include matching files. Repeatable. | | --exclude <glob> | Exclude matching files or directories. Repeatable. | | --dry-run | Show the planned analysis and file selection without writing output. | | --json | Output structured JSON instead of Markdown. | | --force | Overwrite an existing RepoBrief output file. | | -h, --help | Show usage. | | -v, --version | Show the package version. |

Examples:

repobrief generate . --max-files 20 --max-chars 80000
repobrief generate . --include "src/**" --exclude "**/*.test.js"
repobrief generate ../other-repo --output ./other-brief.md
repobrief generate . --dry-run

Exit codes

| Code | Meaning | | --- | --- | | 0 | Success. | | 1 | Completed, but an error occurred (for example, unreadable files or a failed write). | | 2 | Invalid arguments, invalid target or configuration error (for example, unsafe output path). |

Warnings (such as a file excluded for a possible secret) are printed to stderr prefixed with warning: and do not change the exit code. Errors are prefixed with error:.

How files are selected

Files are ordered deterministically by priority, then by directory depth, then by path:

  1. Project configuration (package.json, tsconfig.json, linter/formatter and build configs, ...)
  2. README and architecture/documentation files
  3. Application entry points (main, bin, exports in package.json, or files such as index.js, main.js, server.js near the root)
  4. Route definitions and API handlers (routes/, api/, controllers/, handlers/, ...)
  5. Shared modules (lib/, utils/, shared/, services/, ...)
  6. Remaining text files

Whole files are added in that order until --max-files or --max-chars is reached; then selection stops. Files are never truncated. Files left out are listed in an Omitted Files notice in the brief.

Size reporting shows the exact character count and an approximate token count, estimated as characters / 4. RepoBrief does not ship a tokenizer, so the real token count for your model will differ.

Ignore configuration

RepoBrief combines these rules:

  1. .gitignore files (root and nested), using familiar gitignore syntax.

  2. .repobriefignore in the repository root, same syntax. Use it for files that are in git but not useful as AI context:

    # .repobriefignore
    docs/legacy/
    *.snap
    fixtures/**/*.json
  3. --include / --exclude patterns from the command line. When --include is used, only matching files are considered.

  4. Built-in exclusions:

    • Directories: node_modules, .git, dist, build, coverage, .next, .nuxt, vendor, .cache, plus a few other common build and cache folders.
    • Binary files (by extension or content), and files larger than 100 KB.
    • Lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml, ...) unless matched by --include.
    • Generated output (repobrief.md, repobrief.json, any previous brief) and the output file itself.

Supported pattern syntax: *, **, ?, [...], leading / to anchor to the root, trailing / for directories, and ! to re-include.

Privacy and secret protection

  • RepoBrief never sends repository content anywhere. It makes no network requests and uses only Node.js filesystem APIs (no shell commands).
  • Sensitive files are always excluded: .env and .env.*, private keys and certificates (*.pem, *.key, *.p12, id_rsa, ...), and credential files (credentials.json, .npmrc, .netrc, ...).
  • Every file is checked for common secret patterns (private key blocks, AWS, GitHub, Slack, Stripe, Google, npm and OpenAI-style keys, and long literal values assigned to names like API_KEY, token or password). If a match is found, the entire file is excluded.
  • Secret values are never printed in warnings, errors or JSON output — only the file path and "possible secret detected".
  • Symlinks pointing outside the repository are not followed; symlinked directories are skipped.

Pattern-based detection cannot catch every secret. Review the generated brief before sharing it.

Output safety

  • RepoBrief only writes the single output file. It never edits source files or AI assistant configuration files.
  • It refuses to overwrite a file in the repository that is not a previous RepoBrief output.
  • Replacing an existing brief requires --force.
  • The default output location is the target directory; any other location must be passed explicitly with --output, and its directory must already exist.

Limitations

  • Framework and tool detection is based on package.json (and requirements.txt / pyproject.toml for a few Python frameworks). Other ecosystems get language and file-structure detection only.
  • Entry point and route detection outside package.json is inferred from file names and paths and is labelled as inferred.
  • Gitignore support covers common syntax but not every edge case of git's implementation; global git excludes are not read.
  • Files larger than 100 KB are skipped rather than partially included.
  • Token counts are estimates.

Contributing

Contributions are welcome. Please open an issue or pull request at github.com/Sameera-MHK/repo-brief.

git clone [email protected]:Sameera-MHK/repo-brief.git
cd repo-brief
npm test
node bin/repobrief.js analyze .
  • Keep the dependency footprint at zero unless there is a strong reason.
  • Add tests for new behaviour; tests create temporary repositories in test/helpers.js.
  • Keep output evidence-based: don't report a framework or convention without a file that supports it.

Author

Maintained by sameera_mhk (@Sameera-MHK).

License

MIT © sameera_mhk