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

@cookieyes/cli

v0.3.4

Published

CLI for setting up the CookieYes consent SDK

Readme


Once scaffolded, see the decision tree for which API to use to read consent status in your code.

Why use the CLI?

Setting up consent by hand means installing the right package, creating a "use client" consent-manager module, calling initCookieYes(...), and mounting the components in your layout or entry file. The CLI does all of that in ~30 seconds:

  • Detects your framework — Next.js (App or Pages Router), React (Vite/CRA), or vanilla JS.
  • Detects your package manager — npm, pnpm, yarn, or bun.
  • Installs the right adapter — @cookieyes/nextjs, @cookieyes/react, or @cookieyes/core.
  • Scaffolds a working consent manager — using the canonical initCookieYes({...}) config, so freshly generated code is already on the current API (no deprecation warnings).
  • Wires it in — patches your layout.tsx / _app.tsx / entry file to render the banner.

Prefer to wire it yourself? Every adapter README has a manual quick start.

Prerequisites

  • Node.js ≥ 20
  • An existing project (Next.js, React, or vanilla). The CLI adds consent to a project you already have — it does not scaffold a new app.

Quick start

Run it with your package manager's "dlx" runner — no global install needed:

npx @cookieyes/cli init      # npm
pnpm dlx @cookieyes/cli init # pnpm
yarn dlx @cookieyes/cli init # yarn
bunx @cookieyes/cli init     # bun

init is the default command, so npx @cookieyes/cli (no argument) does the same thing.

Commands

| Command | Description | |---------|-------------| | init | (default) Set up the CookieYes SDK in the current project — detect, install, scaffold, and wire in the consent manager. |

Global flags

| Flag | Description | |------|-------------| | -v, --version | Print the CLI version and exit. | | -h, --help | Print usage and the command list. |

What to expect

init is interactive. It asks a short series of questions, then reports every file it creates or edits so you can confirm it worked:

$ npx @cookieyes/cli init

  CookieYes

◆  Which framework are you using?
│  ● Next.js (detected)
│  ○ React
│  ○ Vanilla JS / Other
│
◆  Backend mode?
│  ● Cookie-only — no backend — stored in a browser cookie
│  ○ Self-hosted — sync consent to your backend
│
◆  Which privacy regulation applies?
│  ● GDPR — European Union — opt-in
│  ○ CCPA — California / US — opt-out
│
◆  Color scheme
│  ● Light   ○ Dark
│
◆  Extra languages? (space to toggle, English always included)
│  ◻ Spanish (es)   ◻ French (fr)   ◻ German (de)
│
◆  Install @cookieyes/nextjs now? › Yes

○  Detected src/ layout · App Router
✔  Created src/components/consent-manager/provider.tsx
✔  Created src/components/consent-manager/index.ts
✔  Updated src/app/layout.tsx
◒  Installing @cookieyes/nextjs...
✔  Installed @cookieyes/nextjs

●  Support the project
│  ★ Enjoying CookieYes? A GitHub star helps a lot:
│  https://github.com/cookieyes/cookieyes

✓ Done! Docs: https://github.com/cookieyes/cookieyes#readme

The generated provider.tsx calls initCookieYes({ ... }) with the options you chose and renders <CookieBanner />, <CookiePreferences />, and <RecallButton />.

What happens next

  1. Start your dev server. The consent banner appears on first load.
  2. Review the generated consent-manager component and tune the initCookieYes({...}) config — theming, i18n, self-hosted persistence. Full options: Configuration.
  3. For framework-specific details (SSR, Pages Router, CCPA opt-out), see the adapter README: @cookieyes/nextjs · @cookieyes/react.

Telemetry

None. The CookieYes CLI collects no analytics, usage data, or telemetry of any kind. There is nothing to opt out of — it runs entirely locally and only touches your project files.

Troubleshooting

My framework wasn't detected. The CLI infers the framework from your package.json and project layout. If detection is wrong, just pick the correct option at the "Which framework are you using?" prompt — the detected one is only pre-selected, never forced. Run the CLI from your project root (where package.json lives).

No files were created or modified. The CLI skips generated files that already exist and prints … already exists — skipped for each. If you re-ran it, that's expected. To regenerate, remove or rename the existing consent-manager files first. Note this skip applies to the files the CLI generates: your layout or entry file is patched in place instead (reported as Updated <file>), so commit your work before running it. If your entry/layout file couldn't be patched automatically, the CLI prints a manual snippet to paste — follow that note.

The banner doesn't render after install. Confirm <CookieYesRoot /> was mounted in your root layout/entry (the CLI prints where it wired it). Start the dev server and hard-reload. The banner only shows while the user hasn't acted — clear the cookieyes-consent cookie. Framework-specific causes (e.g. "use client") are covered in the adapter README's troubleshooting section.

Still stuck? Open an issue.

Community & support

(A community chat channel is on the roadmap.)

Contributing

Contributions are welcome. Read our Contributing Guidelines and Code of Conduct, then open a pull request.

Security

Found a vulnerability? Do not open a public issue — follow our Security Policy and use GitHub's private vulnerability reporting.

License

MIT — see LICENSE.