mhdd24-cli
v1.0.6
Published
Custom developer CLI
Readme
mhdd24-cli
Personal developer CLI (mhdd24) for git workflows, deploy helpers, automatic framework detection, Vercel domain setup, and a local dashboard that summarizes the current project.
Install
npm install -g .
# or from npm when published
npm install -g mhdd24-cliGlobal tools used by some commands (install as needed):
| Tool | Used for |
|------|----------|
| Vercel CLI | vercel, vercel-setup, domain-add |
| GitHub CLI gh | Picking a repo in vercel-setup |
Quick start
cd your-repo
mhdd24 init # creates .mhdd24rc (+ optional .env) with auto framework detection
mhdd24 doctor # Node/npm versions + binary paths, git, Mongo, framework
mhdd24 dashboard # local web panel → http://127.0.0.1:3847/Configuration (.mhdd24rc)
Stored at the repository root. Common fields:
| Field | Purpose |
|-------|---------|
| build | Command run by mhdd24 build / deploy step (default from framework detection) |
| deploy | Command run by mhdd24 deploy-only / deploy step |
| framework | Output of auto detection (id, label, packageManager, buildCommand, …) |
| vercel.project | Vercel project name (from vercel-setup) |
| vercel.githubRepo | owner/repo connected for Git deployments |
| vercel.domains | Domains added via domain-add (bookkeeping + docs) |
| vercel.cliDeployAfterPush | If true, runs vercel deploy --prod --yes after push / deploy / smart-commit |
Auto framework detection
The CLI inspects package.json (dependencies and scripts), lockfiles, and common config files to infer your stack.
Supported signals (non-exhaustive): Next.js, Remix, Nuxt, SvelteKit, Astro, Angular, Create React App, Vite (+ React variant), Expo, generic Node when package.json exists.
Package manager is inferred from pnpm-lock.yaml, yarn.lock, or bun.lock / bun.lockb (otherwise npm).
Commands
mhdd24 detect # prints detection JSON, writes framework → .mhdd24rc, optional sync of "build"mhdd24 init runs the same detector when package.json is present and seeds build + framework accordingly.
Auto domain setup (Vercel)
Attach a domain you control to the linked Vercel project (run mhdd24 vercel-setup first if needed).
mhdd24 domain-add app.example.com- Uses
vercel domains addwith your project name from.mhdd24rc→vercel.projectwhen set. - Appends the domain to
vercel.domainsin.mhdd24rc. - Afterward, configure DNS at your registrar or DNS host so traffic reaches Vercel. See Vercel: Domains.
Dashboard (web panel)
Read-only local UI for the current working directory (run it inside a project repo). The panel uses a dark theme (gradient mesh, glass-style cards, DM Sans + JetBrains Mono via Google Fonts when online).
mhdd24 dashboard # default port 3847
mhdd24 dashboard 9000 # custom port
MHDD_DASH_PORT=9000 mhdd24 dashboard- Binds to 127.0.0.1 only (not exposed on the LAN).
- Cards: detected framework, git branch / origin / short dirty preview, full
.mhdd24rcJSON, Vercel link status (reads.vercel/project.jsonif present), tool versions. - Live refresh about every 8 seconds.
- On macOS, tries to
openthe URL in your browser. - The page includes a CLI reference (every command, short description, and copy-paste examples).
JSON API: GET http://127.0.0.1:3847/api/status
Hosted dashboard on Vercel
The same UI can be deployed as a static site plus a serverless GET /api/status (so the page is not raw index.js).
- Connect this repo to Vercel (import Git project).
- Build command:
npm run build(runsbuild.js, which copieslib/dashboard-ui.html→public/index.html). - Output directory:
public(already set invercel.json). - Deploy. Open your deployment URL:
/is the dashboard (including the CLI commands & examples block),/api/statusis JSON for this deployment’s filesystem (framework + tooling for the checked-outmhdd24-clitree). A banner explains the difference frommhdd24 dashboardon your laptop.
The public/ folder is gitignored; Vercel generates it on each build. api/status.js reuses collectStatus from the package.
Vercel workflow
mhdd24 vercel-setup # choose GitHub repo (gh or manual), vercel link, vercel git connect
mhdd24 vercel # production deploy now (vercel deploy --prod --yes)With vercel.cliDeployAfterPush: true, pushes from mhdd24 push, mhdd24 deploy, or mhdd24 smart-commit also trigger a Vercel production deploy via the CLI after git push.
All commands (reference)
Core
mhdd24 push "message"— add, commit, push; optional Vercel per rcmhdd24 deploy "message"— push (+ optional Vercel),build,deployscripts from rcmhdd24 release— standard-version, push, tags, npm publish (OTP)mhdd24 version— wrapsnpm versionto bumppackage.jsonsemver:mhdd24 versionormhdd24 version patch— patch bump (default)mhdd24 version minor/major— explicit levelmhdd24 version auto— auto-matched bump from git history since the latest tag (or last 30 commits if no tag):feat:→ minor,type!:/BREAKING CHANGE→ major, otherwise patch- Add
--no-git-tag-versionanywhere on the command line to only changepackage.json(no version commit/tag from npm)
Vercel & domains
mhdd24 vercel-setupmhdd24 vercelmhdd24 domain-add <domain>
Insight
mhdd24 detectmhdd24 dashboard [port]
Dev
mhdd24 doctor— printsnode/npmversions and theirPATHlocations (command -v)mhdd24 logs—tail -f logs/app.logmhdd24 analyze— source-map-explorermhdd24 rollback— soft reset last commitmhdd24 smart-commit
Env
mhdd24 env KEY VALUE— append to.env
Git
mhdd24 branch <name>,switch <name>,pull,status,clean-git
Project
mhdd24 init,open,open-url <url>mhdd24 build,deploy-only,clean
Other
mhdd24 seed [langs]— Mongo seed helper for specific project layout
License
MIT
Author
Mohammed Rafi
