From 31840da9e7d659c060702adb20f2d259734b23f1 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 5 Feb 2026 12:12:56 +0100 Subject: [PATCH] feat: Enable global CLI linking and direct `mintel` command execution, updating installation instructions and project path resolution. --- packages/cli/README.md | 27 ++++++++++++++++++++++++--- packages/cli/src/index.ts | 3 ++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/cli/README.md b/packages/cli/README.md index 645d35a..2335c6b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -4,10 +4,30 @@ The Mintel CLI is the primary automation tool for managing the monorepo and ensu ## 🚀 Installation -The CLI is intended to be used within the monorepo: +### Using npx (Recommended) + +Run the CLI without installing it globally. This always uses the latest version from the registry: ```bash -pnpm install +npx @mintel/cli init apps/my-new-website.com +``` + +### Global Installation + +Install the CLI globally from the Mintel registry: + +```bash +npm install -g @mintel/cli +``` + +### Development (Local Link) + +If you are contributing to the CLI, you can link it locally: + +```bash +cd packages/cli +pnpm build +npm link ``` ## 🛠 Commands @@ -17,10 +37,11 @@ pnpm install Scaffolds a new, production-ready client website in the specified path. ```bash -pnpm --filter @mintel/cli start init apps/my-new-website.com +mintel init apps/my-new-website.com ``` #### What it does: + 1. **Project Structure**: Creates a modern Next.js directory layout. 2. **Shared Configs**: Generates `package.json`, `tsconfig.json`, and `eslint.config.mjs` that extend the `@mintel` shared packages. 3. **Localization**: Sets up a localized routing structure (`src/app/[locale]`) with `next-intl` pre-configured. diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 45bf521..a9afb73 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env node import { Command } from "commander"; import fs from "fs-extra"; import path from "path"; @@ -87,7 +88,7 @@ program .action(async (projectPath) => { const fullPath = path.isAbsolute(projectPath) ? projectPath - : path.resolve(process.cwd(), "../../", projectPath); + : path.resolve(process.cwd(), projectPath); const projectName = path.basename(fullPath); console.log(chalk.blue(`Initializing new project: ${projectName}...`));