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

@402md/cli

v0.1.7

Published

CLI to install and manage 402.md skills for AI agents

Downloads

733

Readme

@402md/cli

CLI to install and manage 402.md skills across 30+ AI agents.

Quick start

# Initialize per-project config
npx @402md/cli init --mode wallet-pay --api-key sk_xxx --wallet 0xabc

# Install a skill
npx @402md/cli add ditto

# Search the marketplace
npx @402md/cli search "sentiment analysis"

Global install

npm i -g @402md/cli
402md add <skill>

Project Setup

Run init to create a .402md/ directory in your project:

npx @402md/cli init --mode wallet-pay --api-key sk_xxx --wallet 0xabc --network base-sepolia

For x402 mode (self-custody):

npx @402md/cli init --mode x402 --key 0xYOUR_PRIVATE_KEY --network base

This creates:

.402md/
├── config.json       # project config (network, agents, budget)
├── .secrets.json     # secrets (apiKey, walletPrivateKey, walletAddress) — auto-gitignored
├── installed.json    # installed skills manifest
└── skills/           # per-skill SKILL.md files

Secrets (apiKey, walletPrivateKey, walletAddress) are stored in .402md/.secrets.json with restricted file permissions (0600). The CLI automatically adds .402md/.secrets.json to your .gitignore.

The CLI walks up from the current directory to find .402md/. Falls back to ~/.402md/ if not found.

Agent Setup

On first add, an interactive selector lets you choose which agents to install to.

To configure your wallet and MCP server:

npx @402md/cli setup --key 0xabc123... --network base

The CLI automatically configures:

  • Skills across all selected agents
  • MCP server on supported agents (e.g. Claude Code)

Supported agents

Universal (.agents/skills) — always included: Amp, Cline, Codex, Cursor, Gemini CLI, GitHub Copilot, Kimi Code CLI, OpenCode

Additional (selectable during setup): Antigravity, Augment, Claude Code, OpenClaw, CodeBuddy, Command Code, Continue, Cortex Code, Crush, Droid, Goose, Junie, iFlow CLI, Kilo Code, Kiro CLI, Kode, MCPJam, Mistral Vibe, Mux, OpenHands, Pi, Qoder, Qwen Code, Roo Code, Trae, Windsurf, Zencoder, Neovate, Pochi, AdaL

Commands

| Command | Description | |---------|-------------| | init | Initialize .402md/ in the current project | | add <skill> | Install a skill from the marketplace | | remove <name> | Remove a skill | | list | List locally installed skills | | search <query> | Search the marketplace | | setup --key <0x...> | Select agents + configure wallet and MCP server | | update [name] | Update installed skill(s) |

Examples

npx @402md/cli init --mode wallet-pay --api-key sk_xxx --wallet 0xabc
npx @402md/cli search sentiment
npx @402md/cli add sentiment-analysis
npx @402md/cli list
npx @402md/cli remove sentiment-analysis
npx @402md/cli update

Library Usage

The CLI also exports its modules for programmatic use:

import { loadConfig, createPaymentClient, searchSkills } from '@402md/cli'

const config = loadConfig()
const client = createPaymentClient(config)

const result = await client.callSkill('ditto', '/test', {
  body: { message: 'hello' }
})

See @402md/agent-tools for the recommended high-level integration.

Secrets Management

Since v0.2.0, secrets are stored separately from project config:

  • .402md/config.json — safe to commit (network, agents, budget, apiBaseUrl)
  • .402md/.secrets.json — contains apiKey, walletPrivateKey, walletAddress (auto-gitignored)

When you run init or setup, the CLI:

  1. Writes secrets to .402md/.secrets.json with 0600 permissions
  2. Adds .402md/.secrets.json to .gitignore

loadConfig() merges both files transparently, so existing code doesn't need changes.

If you have an older .402md/config.json with secrets inside, they'll migrate to .secrets.json automatically on the next init or saveConfig() call.

Payment Modes

| Mode | Config fields | Description | |------|---------------|-------------| | x402 | walletPrivateKey | Signs USDC transfers on-chain directly | | wallet-pay | apiKey + walletAddress | Backend pays on your behalf (gasless) |

Custom API URL

For local development:

npx @402md/cli init --api-url http://localhost:3001 --network base-sepolia

Or edit .402md/config.json:

{
  "apiBaseUrl": "http://localhost:3001",
  "network": "base-sepolia"
}

License

MIT