-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add [update,remove,list,version, help] command to npui CLI
- Loading branch information
1 parent
181424d
commit 09ab92f
Showing
3 changed files
with
252 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,120 @@ | ||
# 🧩 npui cli | ||
|
||
**npui** is a CLI tool for easily adding React components from the **npui** component library to your project. It allows developers to download and install specific components from the `npui` GitHub repository directly into their app's local directory. | ||
`npui` is a command-line interface (CLI) tool designed for easy integration of reusable UI components into your projects. Built with simplicity and flexibility in mind, `npui` allows developers to quickly add, update, remove, and list components from the NextProduction repository directly in their own projects. | ||
|
||
## Features | ||
|
||
- Easily download and add individual components from the **npui** component library. | ||
- Creates a local `npui` folder in your project to organize components. | ||
- Simple command-line interface with intuitive usage. | ||
- **Download Components**: Fetch UI components directly from the GitHub repository. | ||
- **Update Components**: Keep your components up to date with the latest changes. | ||
- **Remove Components**: Easily delete components from your project. | ||
- **List Components**: View all downloaded components at a glance. | ||
- **Version Info**: Check the current version of `npui`. | ||
- **Help Command**: Get usage instructions directly from the CLI. | ||
|
||
## Installation | ||
|
||
To use **npui**, you need to have [Node.js](https://nodejs.org/) installed on your machine. | ||
You can install `npui` globally or use it directly with `npx` without installation. | ||
|
||
### Step 1: Install via `npx` | ||
### Using npx | ||
|
||
You don't need to install the package globally. Just use it directly with `npx`: | ||
To use `npui` directly, run the following command: | ||
|
||
```bash | ||
npx npui add <ComponentName> | ||
npx npui <command> <ComponentName> | ||
``` | ||
|
||
### Example: | ||
### Installing Globally | ||
|
||
To download the `Table` component from the npui component library and add it to your project: | ||
If you prefer to install `npui` globally, you can run: | ||
|
||
```bash | ||
npm install -g npui | ||
``` | ||
|
||
## Usage | ||
|
||
Here's a breakdown of available commands: | ||
|
||
### `add <ComponentName>` | ||
|
||
Download a specified component to your project. | ||
|
||
```bash | ||
npx npui add Table | ||
``` | ||
|
||
This will create the following structure in your project: | ||
### `update <ComponentName>` | ||
|
||
Update an existing component to the latest version. | ||
|
||
```bash | ||
npx npui update Table | ||
``` | ||
|
||
### `remove <ComponentName>` | ||
|
||
Remove a specified component from your project. | ||
|
||
```bash | ||
npx npui remove Table | ||
``` | ||
|
||
### `list` | ||
|
||
List all components downloaded to your project. | ||
|
||
```bash | ||
npx npui list | ||
``` | ||
your-app/ | ||
│ | ||
├── npui/ | ||
│ └── Table/ | ||
│ └── Table.tsx | ||
|
||
### `version` | ||
|
||
Display the current version of `npui`. | ||
|
||
```bash | ||
npx npui version | ||
``` | ||
|
||
## How It Works | ||
### `help` | ||
|
||
- When you run the command `npx npui add <ComponentName>`, the CLI will: | ||
- Create an `npui` directory (if it doesn't exist) in your project root. | ||
- Download the specified component from the **npui** GitHub repository. | ||
- Place the component files in the appropriate folder under the `npui` directory. | ||
Show usage instructions for `npui`. | ||
|
||
```bash | ||
npx npui help | ||
``` | ||
|
||
## GitHub Repository | ||
|
||
The **npui** components are hosted on GitHub: | ||
[NextProduction/npui](https://github.com/NextProduction/npui) | ||
## Example | ||
|
||
You can browse the available components and their code in the repository. | ||
Here's a complete example of how to use `npui`: | ||
|
||
## Commands | ||
1. **Add a component**: | ||
```bash | ||
npx npui add Button | ||
``` | ||
|
||
- **Add a component:** | ||
2. **List downloaded components**: | ||
```bash | ||
npx npui list | ||
``` | ||
|
||
```bash | ||
npx npui add <ComponentName> | ||
``` | ||
3. **Update a component**: | ||
```bash | ||
npx npui update Button | ||
``` | ||
|
||
Downloads the specified component from the **npui** library and places it in your project. | ||
4. **Remove a component**: | ||
```bash | ||
npx npui remove Button | ||
``` | ||
|
||
## Contributing | ||
## Contribution | ||
|
||
We welcome contributions! If you'd like to contribute to the **npui** library, please feel free to submit a pull request on our GitHub repository. | ||
Contributions are welcome! If you have suggestions for improvements or want to report bugs, feel free to create an issue or submit a pull request on the [GitHub repository](https://github.com/NextProduction/npui). | ||
|
||
## License | ||
|
||
This project is licensed under the GPL-3.0-or-later License. | ||
|
||
--- | ||
## Acknowledgments | ||
|
||
**Maintained by [NextProduction](https://github.com/NextProduction)** | ||
Created by [Mahdi Hazrati](https://github.com/mahdi-hazrati) | ||
- Thanks to [Node.js](https://nodejs.org/) for providing a powerful platform for building command-line applications. | ||
- Inspired by the open-source community for fostering collaboration and innovation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters