diff --git a/apps/docs/config/routes.json b/apps/docs/config/routes.json index efc13d67db..570099d183 100644 --- a/apps/docs/config/routes.json +++ b/apps/docs/config/routes.json @@ -494,4 +494,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/apps/docs/content/docs/api-references/cli-api.mdx b/apps/docs/content/docs/api-references/cli-api.mdx index fb7a443ba0..b42334e461 100644 --- a/apps/docs/content/docs/api-references/cli-api.mdx +++ b/apps/docs/content/docs/api-references/cli-api.mdx @@ -27,36 +27,41 @@ A command line tool for seamless integration with NextUI Usage: nextui [command] Options: - -v, --version Show the version number - --no-cache Disable cache, by default data will be cached for 30m after the first request - -h, --help Display help for commands + -v, --version Output the current version + --no-cache Disable cache, by default data will be cached for 30m after the first request + -d, --debug Debug mode will not install dependencies + -h --help Display help information for commands Commands: - init [options] [projectName] Start a new NextUI project - add [options] [components...] Add NextUI components to your project - upgrade [options] [components...] Update NextUI components to the latest versions - remove [options] [components...] Remove NextUI components from your project - list [options] Show details of installed components - env [options] Display debug information about the local environment - doctor [options] Diagnose problems in your project - help [command] Get help on a specific command + init [options] [projectName] Initializes a new project + add [options] [components...] Adds components to your project + upgrade [options] [components...] Upgrades project components to the latest versions + remove [options] [components...] Removes components from the project + list [options] Lists all components, showing status, descriptions, and versions + env [options] Displays debugging information for the local environment + doctor [options] Checks for issues in the project + help [command] Display help for command ``` -## init +## Commands -To start a new project, use the init command: +### Init + +Initialize a new NextUI project with official templates. ```codeBlock bash nextui init [projectName] [options] ``` -### Options -- `-t --template [string]` The template to use for the new project e.g. app, pages +#### Init Options + +- `-t --template [string]` The template to use for the new project e.g. app, pages, vite - `-p --package [string]` The package manager to use for the new project (default: `npm`) -### Example +##### Example ```codeBlock bash +# Initialize a new NextUI project with the app template, named my-nextui-app nextui init my-nextui-app -t app ``` @@ -93,28 +98,31 @@ NextUI CLI v0.2.1 โ”” ๐Ÿš€ Get started with npm run dev ``` -## add +### Add + +Add NextUI components to your project. + +#### Features > 1. Auto add the missing required `dependencies` to your project > 2. Auto add the required `tailwindcss.config.js` configuration to your project > 3. Detect whether using pnpm, if so, add the required configuration to your `.npmrc` file -To add components to your project, use the add command: - ```codeBlock bash nextui add [components...] [options] ``` -### Options +#### Add Options - `-a --all` [boolean] Add all the NextUI components (default: `false`) - `-p --packagePath` [string] The path to the package.json file - `-tw --tailwindPath` [string] The path to the tailwind.config file file - `-app --appPath` [string] The path to the App.tsx file -- `--prettier` [boolean] Add prettier format in the add content which required installed prettier - (default: false) +- `--prettier` [boolean] Add prettier format in the add content which required installed prettier - (default: `false`) - `--addApp` [boolean] Add App.tsx file content which required provider (default: `false`) +- `-b --beta` [boolean] Add beta components (default: `false`) -### Example +##### Example Without setting a specific component, the `add` command will show a list of available components. @@ -127,31 +135,36 @@ Output: ```codeBlock bash NextUI CLI v0.2.1 -? Which components would you like to add? โ€บ - Space to select. Return to submit +? Which components would you like to add? โ€บ - Space to select. Return to submit +Instructions: + โ†‘/โ†“: Highlight option + โ†/โ†’/[space]: Toggle selection + [a,b,c]/delete: Filter choices + enter/return: Complete answer Filtered results for: Enter something to filter -โ—ฏ accordion -โ—ฏ autocomplete -โ—ฏ avatar -โ—ฏ badge -โ—ฏ breadcrumbs -โ—ฏ button -โ—ฏ calendar -โ—ฏ card -โ—ฏ checkbox -โ—ฏ โ†“ chip +โ—‰ accordion +โ—ฏ autocomplete +โ—ฏ avatar +โ—ฏ badge +โ—ฏ breadcrumbs +โ—ฏ button +โ—ฏ card +โ—ฏ checkbox +โ—ฏ chip +โ—ฏ code ``` If you want to add a specific component, you can specify the component name. ```codeBlock bash -nextui add button input +nextui add button ``` Output: -```bash +```codeBlock bash NextUI CLI v0.2.1 Adding the required dependencies: @nextui-org/button @@ -171,7 +184,7 @@ Tailwind CSS settings have been updated in: /project-path/tailwind.config.js โœ… Components added successfully ``` -## upgrade +### Upgrade Upgrade the NextUI components to the latest version. @@ -179,13 +192,17 @@ Upgrade the NextUI components to the latest version. nextui upgrade [components...] [options] ``` -### Options +#### Upgrade Options + +- `-p --packagePath` [string] The path to the package.json file +- `-a --all` [boolean] Upgrade all the NextUI components (default: `false`) +- `-w --write` [boolean] Write the upgrade version to package.json file (default: `false`) +- `-b --beta` [boolean] Upgrade beta components (default: `false`) +- `-h --help` Display help for command -- `-p --packagePath` [string] The path to the package.json file. -- `-a --all` [boolean] Upgrade all the NextUI components (default: `false`). -- `-h, --help` Display help for commands. +##### Example -### Example +Upgrade the **Button** component to the latest version. ```codeBlock bash nextui upgrade button @@ -193,51 +210,59 @@ nextui upgrade button Output: -```bash +```codeBlock bash NextUI CLI v0.2.1 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Component โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ @nextui-org/button ^2.0.11 -> ^2.0.31 โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -Required min version: @nextui-org/theme>=2.1.0, tailwindcss>=3.4.0 +Required min version: @nextui-org/theme>=2.1.0, tailwindcss>=3.4.0, react>=18.3.1, react-dom>=18.3.1 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ PeerDependencies โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ @nextui-org/theme 2.0.1 -> 2.1.0 โ”‚ โ”‚ tailwindcss ^3.2.3 -> ^3.4.0 โ”‚ +โ”‚ react Missing -> 18.3.1 โ”‚ +โ”‚ react-dom Missing -> 18.3.1 โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -2 minor, 1 patch +2 major, 2 minor, 1 patch ? Would you like to proceed with the upgrade? โ€บ - Use arrow-keys. Return to submit. โฏ Yes No -pnpm add @nextui-org/button@2.0.31 @nextui-org/theme@2.1.0 tailwindcss@3.4.0 -Already up to date -Progress: resolved 474, reused 465, downloaded 0, added 0, done -Done in 2.9s +pnpm add @nextui-org/button@2.0.31 @nextui-org/theme@2.1.0 tailwindcss@3.4.0 react@18.3.1 react-dom@18.3.1 + +dependencies: +- @nextui-org/theme 2.0.1 ++ @nextui-org/theme 2.1.0 (2.2.3 is available) ++ react 18.3.1 ++ react-dom 18.3.1 + +Done in 1.8s โœ… Upgrade complete. All components are up to date. ``` -## remove +### Remove Remove NextUI components from your project. -> **Note**: If there are no NextUI components after removing, the required content will also be removed._createMdxContent - - ```codeBlock bash - nextui remove [components...] [options] - ``` +> **Note**: If there are no NextUI components after removing, the required content will also be removed + +```codeBlock bash +nextui remove [components...] [options] +``` -### Options +#### Remove Options -- `-p --packagePath` [string] The path to the package.json file. -- `-a --all` [boolean] Remove all the NextUI components (default: `false`). -- `-tw --tailwindPath` [string] The path to the tailwind.config file file. -- `--prettier` [boolean] Add prettier format in the add content which required installed prettier - (default: false). +- `-p --packagePath` [string] The path to the package.json file +- `-a --all` [boolean] Remove all the NextUI components (default: `false`) +- `-tw --tailwindPath` [string] The path to the tailwind.config file file +- `--prettier` [boolean] Add prettier format in the add content which required installed prettier - (default: `false`) +##### Example -### Example +Remove the **Button** component from your project. ```codeBlock bash nextui remove button @@ -245,7 +270,7 @@ nextui remove button Output: -```bash +```codeBlock bash NextUI CLI v0.2.1 โ—๏ธ Components slated for removal: @@ -272,20 +297,20 @@ Remove the removed components tailwind content in file:/project-path/tailwind.co โœ… Successfully removed the specified NextUI components: @nextui-org/button ``` -## list +### List -Show details of installed components. +List all the current installed components. ```codeBlock bash nextui list [options] ``` -### Options +#### List Options - `-p --packagePath` [string] The path to the package.json file - `-r --remote` List all components available remotely -### Example +##### Example ```codeBlock bash nextui list @@ -301,16 +326,22 @@ Current installed components: โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ Package โ”‚ Version โ”‚ Status โ”‚ Docs โ”‚ โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚ -โ”‚ @nextui-org/autocomplete โ”‚ 2.0.10 ๐Ÿš€latest โ”‚ newPost โ”‚ https://nextui.org/docs/components/autocomplete โ”‚ +โ”‚ @nextui-org/autocomplete โ”‚ 2.0.10 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/autocomplete โ”‚ โ”‚ @nextui-org/badge โ”‚ 2.0.24 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/badge โ”‚ โ”‚ @nextui-org/button โ”‚ 2.0.27 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/button โ”‚ โ”‚ @nextui-org/chip โ”‚ 2.0.25 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/chip โ”‚ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ ``` -## doctor +### Doctor -Diagnose problems in your project. +Check whether exist problem in your project by using the `doctor` command. + +```codeBlock bash +nextui doctor [options] +``` + +### Features > 1. Check whether have `redundant dependencies` in the project > 2. Check whether the NextUI components `required dependencies are installed` in the project @@ -318,11 +349,7 @@ Diagnose problems in your project. > 4. Check `.npmrc` is correct when using `pnpm` > 5. Check `peerDependencies with required version` are installed in the project -```codeBlock bash -nextui doctor [options] -``` - -### Options +#### Doctor Options - `-p` `--packagePath` [string] The path to the package.json file - `-tw` `--tailwindPath` [string] The path to the tailwind.config file file @@ -331,8 +358,7 @@ nextui doctor [options] - `-ct` `--checkTailwind` [boolean] Open check tailwind.config file (default: `true`) - `-cp` `--checkPnpm` [boolean] Open check Pnpm (default: `true`) - -### Example +#### Example ```codeBlock bash nextui doctor @@ -340,7 +366,6 @@ nextui doctor Output: - If there is a problem in your project, the `doctor` command will display the problem information. ```codeBlock bash @@ -361,7 +386,7 @@ NextUI CLI v0.2.1 โœ… Your project has no detected issues. ``` -## env +### Env Display debug information about the local environment. @@ -369,11 +394,13 @@ Display debug information about the local environment. nextui env [options] ``` -### Options +#### Env Options + - `-p --packagePath` [string] The path to the package.json file +#### Example -### Example +Display the local environment Information by using the `env` command. ```codeBlock bash nextui env @@ -382,14 +409,14 @@ nextui env Output: ```codeBlock bash -NextUI CLI 0.2.1 +NextUI CLI v0.2.1 Current installed components: โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚ Package โ”‚ Version โ”‚ Status โ”‚ Docs โ”‚ โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚ -โ”‚ @nextui-org/autocomplete โ”‚ 2.0.10 ๐Ÿš€latest โ”‚ newPost โ”‚ https://nextui.org/docs/components/autocomplete โ”‚ +โ”‚ @nextui-org/autocomplete โ”‚ 2.0.10 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/autocomplete โ”‚ โ”‚ @nextui-org/badge โ”‚ 2.0.24 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/badge โ”‚ โ”‚ @nextui-org/button โ”‚ 2.0.27 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/button โ”‚ โ”‚ @nextui-org/chip โ”‚ 2.0.25 ๐Ÿš€latest โ”‚ stable โ”‚ https://nextui.org/docs/components/chip โ”‚ @@ -401,4 +428,4 @@ Environment Info: CPU: arm64 Binaries: Node: v18.18.2 -``` \ No newline at end of file +```