@labmgm/cli
v0.1.0
Published
The `ds` CLI for the MGM Laboratory Design System — scaffold a Next.js 15 app (`ds init`), copy typed components into a project (`ds add`), and manage themes / tokens / icons / health (`ds theme/token/icon/doctor`).
Maintainers
Readme
@labmgm/cli
The ds CLI for the MGM Laboratory Design System. Single binary, three modes.
Run it
pnpm dlx @labmgm/cli init my-app
# or
npx @labmgm/cli init my-appAfter install, ds is on your path:
cd my-app
ds add button card dialog
ds doctorCommands
ds init [name]
Scaffolds a Next.js 15 App Router app pre-wired with the design system.
ds init my-app
ds init my-app --lead-color yellow --package-manager pnpm
ds init my-app -y # accept defaults, no promptsGenerated layout:
app/layout.tsxmounts<ThemeProvider>+<ThemeScript />(SSR-safe, no FOUC).app/globals.cssimports@labmgm/tokens/css/{light,dark}and the base CSS layer.tailwind.config.tsconsumes@labmgm/stylesas a preset.next/fontself-hosts Geist + Bricolage Grotesque + Geist Mono.- A sample landing page using
@labmgm/reactcomponents.
ds add <component…>
Shadcn-style copy. Fetches each component's source from the registry served by ds-web at /registry/<name>.json, writes it into components/ui/, resolves transitive dependencies, and installs declared npm deps with your project's package manager.
ds add button card dialog
ds add table --overwrite
ds add accordion --skip-install
ds add button --dir src/components/uiComponents are copied source you own, not a runtime dependency. Modify freely.
ds theme create | use <name>
Generate or activate a theme variant.
ds theme create --name warm-yellow --lead-color yellow
ds theme use warm-yellow # tracks system preference still
ds theme use warm-yellow --force # force it regardless of OS prefds token list [filter]
List every token from the consumer's installed @labmgm/tokens package.
ds token list # everything
ds token list brand # only tokens whose name contains "brand"ds icon search <query>
Search the consumer's installed @labmgm/icons manifest.
ds icon search arrow
ds icon search labds doctor
Sanity-checks a consumer project. Exits non-zero on any failure so CI catches drift.
Checks:
- Design-system packages (
@labmgm/tokens,@labmgm/styles,@labmgm/themes,@labmgm/react) are installed. tailwind.config.*references the@labmgm/stylespreset.app/layout.tsxmounts<ThemeProvider>and<ThemeScript />.app/globals.cssimports@tailwind base,@labmgm/tokens,@labmgm/styles.
Configuration
Override the registry root (useful for self-hosted docs / local testing):
DS_REGISTRY_URL=http://localhost:3000/registry ds add buttonLicense
MIT © MGM Laboratory.
