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

@morpho-dev/router-cli

v0.1.13

Published

CLI to run an opinionated Morpho Router.

Readme

@morpho-dev/router-cli

Status: Alpha – this CLI is under active development and interfaces/behavior are subject to change.

CLI to run a router that serves offers and performs validations.

Install

  • Global install
pnpm add -g @morpho-dev/router-cli
  • One-off (no install)
pnpx @morpho-dev/router-cli --help
# or
pnpm dlx @morpho-dev/router-cli --help

Running router api

Use router-cli to run a Router:

  • Router starts on http://localhost:7891 by default
  • Seed random offers with --seed for testing
  • Enable validation with --validation flag
  • Load offers from JSON file with --file
  • Start a local UI alongside the Router with --ui
  • --db-offer-endpoint plug the router on top of a postgres

Examples:

# Router with seeded random offers and UI
router-cli start --seed 100 --ui 

# Router with postgres database
router-cli start --db-offer-endpoint <db url>

# Router with validation enabled
router-cli start --validation

# Router with offers loaded from file
router-cli start --file offers.json

# Router with custom port
router-cli start --router-port 8080

Standalone UI

You can also run the UI without starting a local Router server, pointing it to any Router endpoint.

  • By default, it targets the staging Router URL.
  • Override the target with --router-url.
# UI against default remote Router (https://router.morpho.dev)
router-cli ui

# UI against a custom Router endpoint (e.g., local)
router-cli ui --router-url http://localhost:7891

The Router API is available at http://localhost:7891 (or your custom port) and supports the same endpoints as the production Router.

CLI reference

Global

Usage: router-cli [options] [command]

CLI to run an opinionated Morpho Router.

Options:
  -V, --version      output the version number
  -h, --help         display help for command

Commands:
  start [options]    Start a Router server.
  tunnel [options]   Expose the local Router via ngrok
  mempool [options]  Start a local chain with the mempool contract
  help [command]     display help for command

start

Usage: router-cli start [options]

Start a Router server.

Options:
  --port <n>            (default: 7891, env: ROUTER_PORT)
  --chain <chain>       (choices: "ethereum", "base",
                       "ethereum-virtual-testnet", "anvil", default: "ethereum",
                       env: ROUTER_CHAIN)
  --rpc-url <url>       (env: ROUTER_RPC_URL)
  --router-url <url>    (default: "https://router.morpho.dev", env:
                       ROUTER_REMOTE_URL)
  --store <type>        (choices: "pglite", "pg", default: "pglite", env:
                       ROUTER_STORE)
  --db-endpoint <url>   (env: ROUTER_DB_ENDPOINT)
  --log-level <level>   (choices: "trace", "debug", "info", "warn", "error",
                       "fatal", "silent", default: "info", env:
                       ROUTER_LOG_LEVEL)
  --block-window <n>   Block window to get logs from (default: 100)
  --seed <n>           Seed random offers to router (default: 0)
  --file <path>        Seed offers from a JSON file
  --ui                 Start minimal UI (default: false)
  -h, --help           display help for command

tunnel

Usage: router-cli tunnel [options]

Expose the local Router via ngrok

Options:
  --port <n>                  (default: 7891, env: ROUTER_PORT)
  --ngrok-authtoken <token>   (env: NGROK_AUTHTOKEN)
  -h, --help                 display help for command

mempool

Usage: router-cli mempool [options]

Start a local chain with the mempool contract

Options:
  --port <port>             (default: 8545, env: MEMPOOL_PORT)
  --fork-url <url>          (default: "https://ethereum-rpc.publicnode.com",
                           env: MEMPOOL_FORK_URL)
  --block-number <number>   (default: 0)
  -h, --help               display help for command