morphy-cli
v0.1.2
Published
✨ Drop-in page transitions for React — works with Next.js, Vite, TanStack Router, and more
Maintainers
Readme
Morphy CLI (morphy)
✨ Drop-in page transitions for React — shadcn-style component distribution.
morphy is the official CLI to scaffold Morphy page transitions directly into your codebase. You own the code; no black-box dependencies.
🚀 Quick Start
1. Initialize Morphy in your project
Works with npm, pnpm, yarn, and bun:
# npm
npx morphy init
# pnpm
pnpm dlx morphy init
# yarn
yarn dlx morphy init
# bun
bunx morphy initThe interactive wizard will:
- Ask you to choose your framework adapter:
- Next.js App Router (
app/directory withFrozenRouter) - Next.js Pages Router (
pages/_app.tsx) - React Router / Vite (
react-router-dom) - TanStack / Universal (framework-agnostic)
- Next.js App Router (
- Ask where to place components (e.g.
components/morphyorsrc/components/morphy) - Let you pick which transitions to install (or select all 33 transitions)
- Check if required dependencies (
react,react-dom,framer-motion) are installed and offer to install missing ones - Scaffold the components and generate barrel exports (
index.ts) with helpful quickstart instructions
📦 Commands
morphy init
Run the full setup wizard to configure Morphy in a project.
npx morphy initmorphy add [transitions...]
Chain-install additional transitions into an existing Morphy setup.
# Add specific transitions
npx morphy add cube flip origami-unfold
# Add all transitions from a category
npx morphy add --category spatial
npx morphy add --category portal
npx morphy add --category flow
# Add all 33 available transitions
npx morphy add --allmorphy list
List all 33 available transitions categorized with descriptions and emoji tags.
npx morphy list🔄 Syncing CLI Templates
For contributors and maintainers:
To synchronize the CLI's templates and transition catalog with the latest source code in frontend/components/morphy:
cd cli
pnpm sync # or: npx tsx scripts/sync.ts
pnpm buildThis will:
- Recursively sync all core files, adapters, and transitions to
cli/templates/ - Re-scan metadata from transition
.tsxfiles - Automatically generate
cli/src/data/transitions.ts - Rebuild the single-file distribution bundle in
cli/dist/
