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 🙏

© 2025 – Pkg Stats / Ryan Hefner

metamafia-cli

v1.1.0

Published

Metamafia CLI to add AI-generated metadata and files to Next.js projects

Readme

🚀 Metamafia CLI

Metamafia CLI automates the addition of AI-generated metadata, manifest.json, and robots.txt to Next.js 15 apps.
Easily optimize SEO and improve performance with zero hassle.


🎯 Features

✅ Fetches metadata automatically from Metamafia API using documentId.
✅ Inserts AI-generated metadata into app/layout.js or src/app/layout.js.
✅ Generates manifest.json and robots.txt in the public/ directory.
✅ Compatible with Next.js 15 and modern web apps.


📦 Installation

You don't need to install it globally. Simply run the command using npx:

npx metamafia <documentId>

Note:

  • documentId is the ID returned after generating metadata from Metamafia.
  • Your Next.js project should be open in the terminal where the command is run.

📝 Usage

Basic Command:

npx metamafia <documentId>

Example:

npx metamafia 67e8f17694a073819a301914

What Happens After Running the Command:

  1. 🎯 Metadata: Adds export const metadata = {...} to app/layout.js or src/app/layout.js.
  2. 📄 manifest.json: Creates public/manifest.json with app name, icons, and display settings.
  3. 🤖 robots.txt: Generates public/robots.txt with crawl directives and sitemap.

📚 Folder Structure After Execution

/my-nextjs-app
├── /app
│   └── /layout.js (Updated with metadata)
├── /public
│   ├── manifest.json (Created/Updated)
│   └── robots.txt (Created/Updated)
└── /src
    └── /app
        └── /layout.js (Updated with metadata if layout found here)

⚡️ How It Works

  1. 🎯 Fetch Metadata
    Retrieves metadata from the Metamafia API using the documentId provided.

  2. 📄 Add Metadata to Layout
    Inserts export const metadata at the top of layout.js in the app/ or src/app/ directory.

  3. 🤖 Generate Manifest & Robots

    • manifest.json is created with basic PWA information.
    • robots.txt is configured with appropriate crawl settings.

📚 Advanced Options

Re-run with a New documentId

To update the metadata, manifest, and robots with a new document:

npx metamafia 67e8f17694a073819a301914

🚩 Troubleshooting

1. Error: No layout.js found

  • Ensure that layout.js exists in either /app or /src/app directory.

2. Error: Failed to fetch metadata

  • Check if the API URL in api.js is correct and that the API server is running.

3. Permission Denied

  • Ensure you have write access to the project directory.

📜 License

MIT © 2025 Webrizen