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

@mdcms/cli

v0.2.2

Published

CLI for MDCMS content workflows

Downloads

381

Readme

@mdcms/cli

CLI for MDCMS content workflows — pull content to local Markdown files, edit with any tool, and push changes back.

Install

Install globally to use the mdcms command anywhere:

npm install -g @mdcms/cli

Or add it as a project dependency and run via npx:

npm install @mdcms/cli
npx mdcms pull

Configuration

Create a mdcms.config.ts in your project root:

import { defineConfig, defineType, reference } from "@mdcms/cli";
import { z } from "zod";

export default defineConfig({
  project: "marketing-site",
  environment: "staging",
  serverUrl: "http://localhost:4000",
  contentDirectories: ["content"],
  types: [
    defineType("Author", {
      directory: "content/authors",
      fields: {
        name: z.string().min(1),
      },
    }),
    defineType("BlogPost", {
      directory: "content/blog",
      localized: true,
      fields: {
        title: z.string().min(1),
        author: reference("Author"),
      },
    }),
  ],
  locales: {
    default: "en-US",
    supported: ["en-US", "fr"],
  },
});

Environment files

The CLI loads .env* files from the directory containing the nearest mdcms.config.ts, mdcms.config.js, or mdcms.config.mjs before it imports the config. This lets mdcms.config.ts read values from process.env.

Put local developer values in .env.local next to mdcms.config.ts:

MDCMS_SERVER_URL=http://localhost:4000
MDCMS_PROJECT=marketing-site
MDCMS_ENVIRONMENT=staging
MDCMS_API_KEY=mdcms_key_local

Loading order, highest precedence first:

| Order | File | When loaded | | ----- | ----------------------- | --------------------------- | | 1 | .env.{NODE_ENV}.local | Always | | 2 | .env.local | Except when NODE_ENV=test | | 3 | .env.{NODE_ENV} | Always | | 4 | .env | Always |

NODE_ENV defaults to development for CLI runs. In this table, NODE_ENV is only the dotenv file selector; it is not the same thing as the MDCMS environment field or MDCMS_ENVIRONMENT. For example, NODE_ENV=production makes the CLI look for .env.production and .env.production.local, while MDCMS_ENVIRONMENT=staging tells MDCMS which content environment to target.

Shell-exported variables override all file values. Use --no-env-file or MDCMS_DOTENV=0 to disable auto-loading for a run.

Commands

| Command | Description | | ------------------- | -------------------------------------------------------- | | mdcms login | Authenticate via browser-based OAuth flow | | mdcms logout | Revoke credentials and clear local profile | | mdcms pull | Pull content from the server to local Markdown files | | mdcms push | Push local content changes back to the server | | mdcms schema sync | Sync your local schema definition to the server registry |

Pull

mdcms pull              # Interactive mode — prompts before overwriting
mdcms pull --force      # Skip overwrite prompts
mdcms pull --dry-run    # Preview changes without writing files
mdcms pull --published  # Fetch published snapshots instead of drafts

Push

mdcms push              # Interactive mode — prompts before uploading
mdcms push --force      # Skip confirmation prompt
mdcms push --dry-run    # Preview changes without uploading

Global Flags

| Flag | Env Variable | Description | | --------------- | ------------------- | ------------------------------------------------ | | --project | MDCMS_PROJECT | Target project name | | --environment | MDCMS_ENVIRONMENT | Target environment name | | --server-url | MDCMS_SERVER_URL | Server URL | | --api-key | MDCMS_API_KEY | API key (for headless/CI use) | | --config | | Path to config file (default: mdcms.config.ts) | | --no-env-file | MDCMS_DOTENV=0 | Disable automatic .env* loading |

Documentation

Full CLI reference at docs.mdcms.ai.