Medusa Developer CLI

2.13.6 · active · verified Wed Apr 22

medusa-dev-cli is a command-line interface (CLI) tool designed to provide development-specific helpers for contributors working on the Medusa e-commerce platform. It is part of the larger Medusa monorepo and is primarily intended for tasks like building, watching, and other development workflows within the Medusa ecosystem, rather than for direct programmatic library consumption in end-user projects. The current stable version is 2.13.6, with frequent patch and minor releases aligning with Medusa's rapid development cycle. Its key differentiator is its specific focus on developer experience for core Medusa contributors, providing specialized commands not typically exposed in the main `medusa-cli` for merchant projects. It relies on `ts-node` and `tsconfig-paths` for its execution environment.

Common errors

Warnings

Install

Quickstart

Demonstrates how to invoke a Medusa Developer CLI command ('build') using `npx`.

import { exec } from 'node:child_process';

async function runMedusaDevCommand() {
  console.log('Running Medusa Dev CLI build command...');
  // Typically, this CLI is run via `npx medusa-dev <command>`
  // This example demonstrates programmatic execution, but direct terminal usage is more common.
  const command = 'npx medusa-dev build';

  return new Promise((resolve, reject) => {
    exec(command, (error, stdout, stderr) => {
      if (error) {
        console.error(`exec error: ${error}`);
        reject(error);
        return;
      }
      if (stderr) {
        console.error(`stderr: ${stderr}`);
      }
      console.log(`stdout: ${stdout}`);
      resolve(stdout);
    });
  });
}

runMedusaDevCommand().catch(console.error);

view raw JSON →