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

mext-cli

v1.0.0

Published

MEXT CLI for managing blocks and repositories

Readme

MEXT CLI

Command-line interface for managing MEXT blocks and repositories.

Installation

From Source (Development)

# Navigate to the CLI directory
cd cli

# Install dependencies
npm install

# Build the CLI
npm run build

# Link for global usage (optional)
npm link

Global Installation (Future)

npm install -g mext-cli

Prerequisites

  • Node.js 16+ installed
  • Git installed and configured
  • MEXT server running (default: http://localhost:3001)
  • GitHub access for repository operations

Commands

mext-cli login

Authenticate with MEXT (currently a placeholder).

mext-cli login

mext-cli create <name>

Create a new block and clone its repository locally.

# Basic usage
mext-cli create "My Block"

# With options
mext-cli create "My Block" --description "My custom block description" --type custom

Options:

  • -d, --description <description>: Block description
  • -t, --type <type>: Block type (default: custom)

What it does:

  1. Creates a new block on the MEXT server
  2. Automatically creates a GitHub repository (if configured)
  3. Clones the repository to your local machine
  4. Provides next steps for development

mext-cli fork <blockId>

Fork an existing block and pull its content locally.

mext-cli fork 507f1f77bcf86cd799439011

What it does:

  1. Creates a fork of the specified block on the MEXT server
  2. Creates a new GitHub repository for the fork
  3. Clones the forked repository to your local machine

mext-cli delete <blockId>

Delete a block from the MEXT server.

mext-cli delete 507f1f77bcf86cd799439011

What it does:

  1. Shows block information for confirmation
  2. Prompts for confirmation
  3. Deletes the block from the server
  4. Note: GitHub repository needs to be deleted manually if desired

mext-cli sync

Manually sync the block registry and update named exports (automatically done after publish).

mext-cli sync

What it does:

  1. Fetches the latest registry from the MEXT server
  2. Updates the mext-block package's named exports
  3. Shows available components and their metadata
  4. Regenerates TypeScript definitions for new components

When to use:

  • After someone else publishes a block and you want to use it as a named component
  • On a different computer than where the block was published
  • To manually refresh the registry if components seem outdated

Note: This command is automatically executed after a successful mext-cli publish on the same machine, so you typically don't need to run it manually unless you're on a different computer or want to get components published by others.

mext-cli publish

Publish the current block after pushing changes to GitHub.

# In your block repository directory
mext-cli publish

What it does:

  1. Checks if you're in a valid block repository
  2. Shows repository status and detects the block ID
  3. Checks for uncommitted changes
  4. Prompts you to push changes to GitHub
  5. Triggers the build and bundle process on the server
  6. Provides feedback on the build status
  7. Automatically syncs the registry to make your block available as a named component

Workflow

Creating a New Block

# 1. Create and clone the block
mext-cli create "My Amazing Block"

# 2. Navigate to the repository
cd block-<block-id>

# 3. Make your changes
# Edit files, add features, etc.

# 4. Commit your changes
git add .
git commit -m "Add amazing features"

# 5. Push to GitHub
git push origin main

# 6. Publish the block (automatically syncs registry)
mext-cli publish

Forking an Existing Block

# 1. Fork and clone the block
mext-cli fork 507f1f77bcf86cd799439011

# 2. Navigate to the repository
cd block-<new-block-id>

# 3. Make your modifications
# Customize the forked block

# 4. Follow steps 4-6 from "Creating a New Block"
# Note: publish automatically syncs the registry

Multi-Developer Team Workflow

Developer A (Publishing a new block):

mext-cli create "Team Component"
cd block-<id>
# Make changes...
git add . && git commit -m "Add team component"
git push origin main
mext-cli publish  # Automatically syncs registry locally

Developer B (Using the new block on different computer):

# First, sync to get the latest components
mext-cli sync

# Then use in your React app
import { TeamComponent } from 'mextblock';
<TeamComponent props={{ data: "value" }} />

Configuration

The CLI uses the following default settings:

  • Server URL: http://localhost:3001
  • Timeout: 30 seconds for API requests

Troubleshooting

"Network Error: Could not reach MEXT server"

Make sure the MEXT server is running on the expected port (default: 3001).

"GitHub repository creation failed"

Check that the server has proper GitHub configuration:

  • GITHUB_TOKEN environment variable
  • GITHUB_USERNAME environment variable

"Could not determine block ID from repository"

This happens when running mext-cli publish in a directory that's not a valid block repository. Make sure you're in a directory created by mext-cli create or mext-cli fork.

Permission Issues

If you get permission errors, you may need to:

  1. Set up GitHub SSH keys properly
  2. Ensure your GitHub token has the necessary permissions
  3. Check repository access rights

Development

Building

npm run build

Development Mode

npm run dev

Project Structure

cli/
├── src/
│   ├── commands/          # Individual CLI commands
│   │   ├── login.ts
│   │   ├── create.ts
│   │   ├── fork.ts
│   │   ├── delete.ts
│   │   └── publish.ts
│   ├── utils/
│   │   ├── api.ts         # API client for MEXT server
│   │   └── git.ts         # Git operations utility
│   └── index.ts           # Main CLI entry point
├── dist/                  # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

License

MIT