Package detail

smbm

sebaxchen120ISC1.1.35

CLI: --l crea LICENSE.md, --d crea docs/, --ddd genera estructura DDD

smbm, license, docs, puml

readme

smbm

Tiny CLI to spin up projects fast—licenses, docs, DDD scaffolds, environments, i18n, dependencies, a mock server, and OpenAI-powered prompts. Built with ❤️ for smooth DX: spinners, progress bars, and sensible defaults.

npm version weekly downloads node version license: ISC


🔎 Table of Contents


✨ Features

  • --l Create LICENSE.md (ISC/MIT) with author & year.
  • --d Bootstrap docs/ with user-stories.md and a PlantUML diagram.
  • --ddd DDD skeleton: src/<feature>/{application,domain/model,infrastructure,presentation/{components,views}}.
  • --env Generate .env.developer & .env.production and update .gitignore.
  • --lo Create src/locales/en.json & src/locales/es.json (basic structure).
  • --sh Create src/shared/ with infrastructure/ and presentation/{components,views}.
  • --ipr Create root-level i18n.js, pinia.js, router.js.
  • --deps Install Vue + ecosystem deps (auto-detect npm/yarn/pnpm/bun).
  • --s Prepare server/ (JSON Server) with db.json, routes.json, start.sh.
  • --ask OpenAI integration: save API key and ask questions (optional streaming).
  • --all Do it all in one go (with a smooth progress bar).
  • --del Clean up everything created by --all (or just specific parts).

Global: --no-anim disables animations (CI-friendly). Runtime: CommonJS. Node.js ≥ 16 (≥ 18 recommended).


🧰 Requirements

  • Node.js 16+ (18+ recommended)
  • A package manager: npm, yarn, pnpm, or bun (auto-detected)
  • (Optional) OpenAI API key for --ask

🚀 Quick Start

No global install required:

npx smbm --help

Or add locally:

npm i -D smbm
npx smbm --help

🔧 Commands Overview

Command What it does Key options
--l Create LICENSE.md `--type ISC MIT·--author "Your Name"·--year 2025·--out LICENSE.md·--force`
--d Generate docs/ (user-stories.md, diagrama.puml) --dir · --stories · --diagram · --force
--ddd Create DDD skeleton in src/ <FeatureName> · --name · --base
--env Create .env.developer & .env.production, update .gitignore `dev pro all·--dir·--force·--no-ignore`
--lo Create src/locales/{en,es}.json --dir · --force
--sh Create src/shared/{infrastructure,presentation/{components,views}} --base · --name · --force
--ipr Create root i18n.js, pinia.js, router.js --force
--s Prepare server/ for json-server --pm · --dir · --force · --no-install
--deps Install deps (Vue + ecosystem) --pm · --dev · --batch · --verbose
--ask Save OpenAI key or ask a question set "KEY" · --model · --stream
--all Full setup with progress bar <FeatureName> · --deps · --pm · --skip-server
--del Delete output from --all or targeted parts many (see section)

🧩 Examples

# DDD scaffolding
npx smbm --ddd auth
npx smbm --ddd --name users
npx smbm --ddd orders --base src/modules

# Environments
npx smbm --env
npx smbm --env pro --dir config

# Locales & Shared
npx smbm --lo
npx smbm --sh                   # creates src/shared/... (infra + presentation/{components,views})

# Root helpers
npx smbm --ipr                  # creates i18n.js, pinia.js, router.js in project root

# Mock server
npx smbm --s --pm pnpm

# Dependencies (Vue + ecosystem)
npx smbm --deps --pm pnpm --verbose

# Everything in one go (with progress bar)
npx smbm --all Hello --deps

# Clean up (everything created by --all)
npx smbm --del
npx smbm --del --ddd --name Hello
npx smbm --del --docs --sh --env
npx smbm --del --file src/tmp.txt --files dist,coverage

📄 --l · LICENSE.md

npx smbm --l [--type ISC|MIT] [--author "Your Name"] [--year 2025] [--out LICENSE.md] [--force]

📚 --d · Documentation

npx smbm --d [--dir docs] [--stories user-stories.md] [--diagram diagrama.puml] [--force]

Creates:

docs/
  user-stories.md
  diagrama.puml

🏗️ --ddd · DDD Structure

npx smbm --ddd [<FeatureName>] [--name <FeatureName>] [--base src]

Scaffold only (no files):

src/
  <FeatureName>/
    application/
    domain/
      model/
    infrastructure/
    presentation/
      components/
      views/

🌱 --env · Environments

npx smbm --env [dev|pro|all] [--dir .] [--force] [--no-ignore]
  • Writes .env.developer & .env.production to --dir (default .).
  • Adds entries to .gitignore unless --no-ignore.

🌍 --lo · Locales (i18n)

npx smbm --lo [--dir locales] [--force]

Default structure (under src/locales):

src/locales/
  en.json   // { app, nav, pages, actions }
  es.json   // { app, nav, pages, actions }

🧩 --sh · Shared Layer

npx smbm --sh [--base src] [--name shared] [--force]

Creates:

src/shared/
  infrastructure/
  presentation/
    components/
    views/

🧭 --ipr · Root Helpers

npx smbm --ipr [--force]

Generates three root files:

  • i18n.js (imports src/locales/{en,es}.json)
  • pinia.js
  • router.js (with minimal inline routes)

📦 --deps · Vue + Ecosystem

npx smbm --deps [--pm npm|yarn|pnpm|bun] [--dev] [--batch] [--verbose]

Installs:

  • vue-i18n@11, vue-router@4
  • primevue, @primeuix/themes, primeicons, primeflex
  • pinia, axios
  • json-server

Auto-detects the package manager from lockfiles.


🖥️ --s · JSON Server

npx smbm --s [--pm npm|yarn|pnpm|bun] [--dir server] [--force] [--no-install]

Creates:

server/
  db.json
  routes.json
  start.sh

Run:

sh server/start.sh
# or:
npx json-server --watch server/db.json --routes server/routes.json

🤖 --ask · OpenAI

Save API key (stored outside the repo: ~/.smbm/config.json):

npx smbm --ask set "sk-..."

Ask (default model: gpt-4o-mini):

npx smbm --ask "What is DDD?"

Streaming:

npx smbm --ask "Summarize this…" --stream

Note: You need valid OpenAI billing/quota. You can also set OPENAI_API_KEY as an environment variable.


🧪 --all · One-Shot Bootstrap

npx smbm --all <FeatureName> [--deps] [--pm npm|yarn|pnpm|bun] [--dev] [--batch] [--verbose] [--skip-server] [--no-ignore] [--base src] [--sharedName shared] [--docsDir docs] [--envDir .] [--serverDir server]

Orchestrates: license → docs → DDD → shared → locales → env → root helpers → (server) → (deps). Includes a smooth progress bar with friendly status updates.


🗑️ --del · Clean Up

Remove everything created by --all:

npx smbm --del

Targeted deletion:

npx smbm --del --ddd [--name <FeatureName>]
npx smbm --del --docs
npx smbm --del --sh
npx smbm --del --lo
npx smbm --del --env
npx smbm --del --ipr
npx smbm --del --s
npx smbm --del --l

Individual root files or any path(s):

npx smbm --del --i18n
npx smbm --del --pinia
npx smbm --del --router
npx smbm --del --file src/tmp.txt
npx smbm --del --files dist,coverage

Also uninstall deps that --all may have installed:

npx smbm --del --deps [--pm npm|yarn|pnpm|bun]

⚙️ Animations

All operations use spinners and progress bars by default. Turn them off with --no-anim (or set CI=true).


🧯 Troubleshooting

  • npm ERR! Git working directory not clean → commit/stash before npm version.
  • 'smbm' is not recognized → run with npx smbm ... or install locally (npm i -D smbm).
  • Windows & start.sh → use Git Bash/WSL or run the json-server command directly.
  • Secrets → never commit .env*. If a key leaked, revoke & rotate immediately.

📦 Suggested package.json excerpt

{
  "type": "commonjs",
  "bin": { "smbm": "src/cli.js" },
  "files": ["src/**/*", "README.md", "LICENSE.md", "package.json"]
}

🤝 Contributing

PRs are welcome! If you spot a bug or have an idea for a new command, open an issue. Psst… there might be a tiny easter egg hidden in the CLI. 💌


📜 License

ISC — see LICENSE.md for details.