druta-cli
v1.0.2
Published
A CLI tool which helps you to add snippets files for react and next js projects.
Readme
Druta CLI (drt)
A command-line interface (CLI) tool for quickly generating and removing components for React Native, Expo, and Next.js projects.
Features
- Create components for React Native, Expo, and Next.js
- Remove components from your projects
- Simple and minimal file structure generation
- Creates components exactly where you run the command
Installation
Global Installation
npm install -g druta-cliUsing with npx
npx druta-cli expo add login
# or with the shorthand
npx drt expo add loginUsage
drt <platform> <action> <name>Platforms
expo- For Expo projectsnext- For Next.js projectsreact-native- For React Native projects
Actions
add- Create a new component or pageremove- Remove an existing component or page
Examples
# Create components for a login screen in Expo
drt expo add login
# Create a Next.js page with page.tsx and layout.tsx
drt next add dashboard
# Add a component to React Native
drt react-native add profile
# Remove components
drt expo remove login
drt next remove dashboardInteractive Mode
Just run drt without any arguments to enter interactive mode with a friendly UI.
Generated File Structure
Next.js
componentName/
├── page.tsx
└── layout.tsxExpo
componentName/
├── index.tsx
└── styles.jsReact Native
componentName/
├── index.jsx
└── styles.jsRequirements
- Node.js >= 14.16
Local Development
To test locally:
# Clone the repository
git clone https://github.com/yourusername/druta-cli.git
cd druta-cli
# Install dependencies
npm install
# Link the package locally
npm link
# Now you can use the command
drt next add loginLicense
MIT
