The SectionFlow CLI (sectionflow-cli) is the recommended way to add transitions to your project. It automatically sets up the required core files, installs dependencies, and manages your transition registry.
init
Initializes SectionFlow in your project by setting up the core architecture and installing necessary dependencies.
npx sectionflow-cli initWhat it does
- Auto-detects framework: Identifies whether you are using Next.js (App or Pages router), Vite, or Create React App to determine the optimal file paths.
- Installs dependencies: Installs
framer-motionif it's not already in yourpackage.json. - Scaffolds core files: Creates the foundational
SectionFlowengine inside your components directory:core/types.ts— Type definitions for transitions and sections.core/section-flow.tsx— The main persistent-layer stage component.core/registry.ts— An empty transition registry that maps slugs to components.
Usage
Run this command at the root of your project before adding any transitions. You only need to run this once.
add
Adds one or more transitions to your project.
npx sectionflow-cli add [transition-slug...]Examples
Add a single transition:
npx sectionflow-cli add card-stackAdd multiple transitions at once by space-separating their slugs:
npx sectionflow-cli add card-stack circular-portal wave-revealWhat it does
- Downloads components: Fetches the source code for the requested transitions and places them in the
components/sectionflow/transitions/directory. - Updates registry: Automatically appends import statements and registers the new components in
core/registry.ts. - Installs extra dependencies: If a specific transition requires an additional package (e.g.,
gsapfor certain complex SVGs), the CLI will prompt you to install it.
list
Lists all available transitions that you can add to your project.
npx sectionflow-cli listWhat it does
Displays a grouped list of all production-ready transitions available in the SectionFlow library. This is useful for browsing transition slugs directly from your terminal without needing to visit the documentation.
Transitions are categorized by pattern (e.g., Overlays, Reveals, Transforms) making it easy to find what you need.
Package Manager Support
The CLI can be invoked using your preferred package manager. It supports npm, pnpm, yarn, and bun.
| Manager | Command |
|---|---|
| npm | npx sectionflow-cli <command> |
| pnpm | pnpm dlx sectionflow-cli <command> |
| yarn | yarn dlx sectionflow-cli <command> |
| bun | bunx sectionflow-cli <command> |