CLI
Earthling UI provides a command-line interface (CLI) to help you create new projects, eject components, and manage your UI development workflow. The CLI is built to be simple and intuitive, making it easy to get started with Earthling UI.
Installation
The CLI is included when you install the Earthling UI package:
bun add earthling-ui
You can also run it directly using bunx:
bunx earthling-ui <command>
Commands
create
Create a new project with Earthling UI pre-configured.
bunx earthling-ui create [template] [destination]
Arguments:
- template: The template to use (optional, defaults to monorepo)
- destination: The name of the project (and directory) to create
Examples:
# Create a Next.js project
bunx earthling-ui create next my-app
# Create a Vite SPA project
bunx earthling-ui create spa my-spa
# Create a monorepo
bunx earthling-ui create monorepo my-workspace
eject
Eject a component from Earthling UI into your project. This allows you to customize the component to your specific needs.
bunx earthling-ui eject <component>
Arguments:
- component: The name of the component to eject
Example:
bunx earthling-ui eject button
Note: The eject command is currently under development and will be available in a future release.
copy
Copy a component snippet to your clipboard.
bunx earthling-ui copy <snippet>
Arguments:
- snippet: The name of the snippet to copy
Example:
bunx earthling-ui copy button
Best Practices
- Use the create command for new projects to ensure proper setup with Earthling UI
- Choose the right template based on your project needs (Next.js for SSR, Vite for SPAs, etc.)
- Consider using a monorepo for larger projects with multiple apps or packages
- Eject components only when necessary - importing directly is preferred for most use cases