Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Magic UI CLI, Superset of shadcn-ui #85

Closed
wants to merge 0 commits into from

Conversation

rajatsandeepsen
Copy link
Contributor

@rajatsandeepsen rajatsandeepsen commented May 26, 2024

magicui-cli

A CLI for adding magic ui components to your project. Superset of shadcn-ui.

Screenshot 2024-05-26 154458

Enhancement: #49

Usage

Use the init command to initialize dependencies for a new project.

The init command installs dependencies (framer-motion), adds the cn util, configures tailwind.config.js, and CSS variables for the project.

npx magicui-cli init

shadcn-ui project

If your project is already using the shadcn-ui, don't worry! You can still use magicui.

npx shadcn-ui init

Just add these two lines to your components,json file and install framer-motion

npm install framer-motion
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "default",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "app/globals.css",
    "baseColor": "slate",
    "cssVariables": true
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
+   "ui": "@/components/ui",
+   "magicui": "@/components/magicui"
  }
}

add

Use the add command to add components to your project.

The add command adds a component to your project and installs all required dependencies.

npx magicui-cli add [component]

Example

npx magicui-cli add bento-grid

You can also use the optional --all flag to install all components:

npx magicui-cli add --all

You can also use the --exmaple flag to select and install example & demo you saw on webside:

npx magicui-cli add --example

You can also run the command without any arguments to view a list of all available components:

npx magicui-cli add

shadcn-ui

You can also use the same CLI for selecting & installing shadcn-ui components:

npx magicui-cli add --shadcn button
npx magicui-cli add --shadcn --all

Magic UI Premium Components

If user has the "env", just login the CLI and enjoy the premium components

npx magicui-cli auth --login <secret-env>

Use --pro tag to list premium components from pro webside

npx magicui-cli add --pro 

CLI also supports the premium project templates. It will download the private repo as zip file

npx magicui-cli project

TODO

  1. Update CLI docs
  2. Solve org support with team ENV

Copy link

vercel bot commented May 26, 2024

@rajatsandeepsen is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@itsarghyadas
Copy link
Collaborator

Do you have any video recordings of how it works in a real codebase?

@rajatsandeepsen
Copy link
Contributor Author

Do you have any video recordings of how it works in a real codebase?

magicui-pro.mp4

@rajatsandeepsen
Copy link
Contributor Author

If user is logged in

magicui-pro.2.mp4

if user is not logged in

image

@rajatsandeepsen
Copy link
Contributor Author

How to login & logout in Magic UI CLI

magicui-login.mp4

@dillionverma
Copy link
Collaborator

this is incredible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants