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

@xyd-js/opencli-remark

v0.1.0-build.0

Published

The package includes a remark plugin for generating OpenCLI documentation from variables in markdown files.

Readme

xyd-opencli-remark

The package includes a remark plugin for generating OpenCLI documentation from variables in markdown files.

Usage

import { remarkOpencliDocs } from '@xyd-js/opencli-remark';
import remarkFrontmatter from 'remark-frontmatter';
import remarkStringify from 'remark-stringify';
import { remark } from 'remark';

// Configure multiple CLI specs
remark()
  .use(remarkFrontmatter)
  .use(remarkOpencliDocs, {
    xyd: { source: './xyd-cli.json' },
    npm: { source: './npm-cli.json' },
    // Add more CLIs as needed
  })
  .use(remarkStringify)
  .process(markdown);

Configuration

The plugin accepts an object where each key represents a CLI identifier, and the value contains the spec configuration:

{
  [cliKey: string]: {
    source: string; // Path to OpenCLI spec JSON file (relative to markdown file) or URL
  }
}

Example:

remarkOpencliDocs({
  xyd: { source: './xyd-cli.json' },
  npm: { source: 'https://example.com/npm-cli.json' }
})

Frontmatter Configuration

In your markdown frontmatter, specify which CLI to use and the command path:

---
xyd.opencli.xyd: "dev"
---

The CLI key (e.g., xyd) must match a key in your plugin configuration. The command path is relative to the CLI root (no CLI name prefix needed).

Command Path Examples

  • Root command: Use an empty string ""

    xyd.opencli.xyd: ""
  • Top-level command: Just the command name

    xyd.opencli.xyd: "dev"
  • Nested command: Space-separated path

    xyd.opencli.xyd: "components install"
  • Using aliases: You can use command aliases

    xyd.opencli.xyd: "d"  # if "d" is an alias for "dev"

Indent Style Configuration

You can configure the output format for arguments and options:

---
xyd.opencli.xyd:
  command: "dev"
  indent: list  # or "code" (default)
---
  • code (default): Tab-indented CLI-style format, suitable for code blocks
  • list: Markdown list format with backticks, suitable for regular markdown

Example Markdown

Code Block Format (default)

Input:

---
xyd.opencli.xyd: "dev"
---

```sh
Usage: {opencli.current.usage}

{opencli.current.description}

Arguments:
{opencli.current.arguments}

Options:
{opencli.current.options}

Output:

---
xyd.opencli.xyd: "dev"
---

```sh
Usage: xyd dev [flags]

Run your docs locally in development mode

Options:
	-p, --port <number>            Port to run the dev server on
	-l, --logLevel <string>        Set logging level (e.g. info, debug)
	--verbose                      Enable verbose output
	--debug                        Enable debug output

List Format

Input:

---
xyd.opencli.xyd:
  command: "dev"
  indent: list
---

## Usage
`{opencli.current.usage}`

{opencli.current.description}

## Arguments
{opencli.current.arguments}

## Options
{opencli.current.options}

Output:

---
xyd.opencli.xyd:
  command: "dev"
  indent: list
---

## Usage

`xyd dev [flags]`

Run your docs locally in development mode

## Arguments

## Options

- `-p`, `--port <number>`  Port to run the dev server on
- `-l`, `--logLevel <string>`  Set logging level (e.g. info, debug)
- `--verbose`  Enable verbose output
- `--debug`  Enable debug output

Variables

The following Variables are supported:

| Variable | Description | Format Support | |------------|-------------|----------------| | {opencli.current.usage} | Generates usage line (e.g., xyd dev [flags]) | All formats | | {opencli.current.description} | Command description | All formats | | {opencli.current.commands} | List of available subcommands | All formats | | {opencli.current.arguments} | Command arguments documentation | Code blocks, text (code style), or list nodes (list style) | | {opencli.current.options} | Command options/flags documentation | Code blocks, text (code style), or list nodes (list style) |

Note:

  • {opencli.current.arguments} and {opencli.current.options} work in:
    • Code blocks (always code format)
    • Text nodes (code format when indent: 'code')
    • List nodes (list format when indent: 'list' - automatically converted to markdown lists)

Multiple CLIs

You can configure and use multiple CLI specs in the same project:

remarkOpencliDocs({
  xyd: { source: './xyd-cli.json' },
  npm: { source: './npm-cli.json' },
  git: { source: './git-cli.json' }
})

Then in different markdown files, reference the appropriate CLI:

# File 1: xyd-dev.md
---
xyd.opencli.xyd: "dev"
---

# File 2: npm-install.md
---
xyd.opencli.npm: "install"
---