mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
docs: sync nextui-cli api (#3035)
* docs: sync nextui-cli api * docs: update * chore: update routes.json with new path and set updated flag --------- Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
This commit is contained in:
parent
06ecd213cf
commit
bc759838cd
@ -417,7 +417,8 @@
|
|||||||
"key": "cli-api",
|
"key": "cli-api",
|
||||||
"title": "NextUI CLI",
|
"title": "NextUI CLI",
|
||||||
"keywords": "api references, nextui, api, cli",
|
"keywords": "api references, nextui, api, cli",
|
||||||
"path": "/docs/api-references/cli-api.mdx"
|
"path": "/docs/api-references/cli-api.mdx",
|
||||||
|
"updated": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "nextui-provider",
|
"key": "nextui-provider",
|
||||||
|
|||||||
@ -51,6 +51,7 @@ nextui init [projectName] [options]
|
|||||||
### Options
|
### Options
|
||||||
|
|
||||||
- `-t --template [string]` The template to use for the new project e.g. app, pages
|
- `-t --template [string]` The template to use for the new project e.g. app, pages
|
||||||
|
- `-p --package [string]` The package manager to use for the new project (default: `npm`)
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@ -58,6 +59,38 @@ nextui init [projectName] [options]
|
|||||||
nextui init my-nextui-app -t app
|
nextui init my-nextui-app -t app
|
||||||
```
|
```
|
||||||
|
|
||||||
|
output:
|
||||||
|
|
||||||
|
```codeBlock bash
|
||||||
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
|
┌ Create a new project
|
||||||
|
│
|
||||||
|
◇ Select a template (Enter to select)
|
||||||
|
│ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.)
|
||||||
|
│ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.)
|
||||||
|
│
|
||||||
|
◇ New project name (Enter to skip with default name)
|
||||||
|
│ my-nextui-app
|
||||||
|
│
|
||||||
|
◇ Select a package manager (Enter to select)
|
||||||
|
│ ● npm
|
||||||
|
│ ○ yarn
|
||||||
|
│ ○ pnpm
|
||||||
|
│ ○ bun
|
||||||
|
│
|
||||||
|
◇ Template created successfully!
|
||||||
|
│
|
||||||
|
◇ Next steps ───────╮
|
||||||
|
│ │
|
||||||
|
│ cd my-nextui-app │
|
||||||
|
│ npm install │
|
||||||
|
│ │
|
||||||
|
├────────────────────╯
|
||||||
|
│
|
||||||
|
└ 🚀 Get started with npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
## add
|
## add
|
||||||
|
|
||||||
> 1. Auto add the missing required `dependencies` to your project
|
> 1. Auto add the missing required `dependencies` to your project
|
||||||
@ -79,7 +112,6 @@ nextui add [components...] [options]
|
|||||||
- `--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`)
|
- `--addApp` [boolean] Add App.tsx file content which required provider (default: `false`)
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
Without setting a specific component, the `add` command will show a list of available components.
|
Without setting a specific component, the `add` command will show a list of available components.
|
||||||
@ -91,27 +123,22 @@ nextui add
|
|||||||
Output:
|
Output:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
NextUI CLI v0.1.2
|
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
|
Filtered results for: Enter something to filter
|
||||||
|
|
||||||
◉ accordion
|
◯ accordion
|
||||||
◯ autocomplete
|
◯ autocomplete
|
||||||
◯ avatar
|
◯ avatar
|
||||||
◯ badge
|
◯ badge
|
||||||
◯ breadcrumbs
|
◯ breadcrumbs
|
||||||
◯ button
|
◯ button
|
||||||
|
◯ calendar
|
||||||
◯ card
|
◯ card
|
||||||
◯ checkbox
|
◯ checkbox
|
||||||
◯ chip
|
◯ ↓ chip
|
||||||
◯ code
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to add a specific component, you can specify the component name.
|
If you want to add a specific component, you can specify the component name.
|
||||||
@ -123,7 +150,7 @@ nextui add button input
|
|||||||
Output:
|
Output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NextUI CLI v0.1.2
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
Adding the required dependencies: @nextui-org/button
|
Adding the required dependencies: @nextui-org/button
|
||||||
|
|
||||||
@ -142,7 +169,6 @@ Tailwind CSS settings have been updated in: /project-path/tailwind.config.js
|
|||||||
✅ Components added successfully
|
✅ Components added successfully
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## upgrade
|
## upgrade
|
||||||
|
|
||||||
Upgrade the NextUI components to the latest version.
|
Upgrade the NextUI components to the latest version.
|
||||||
@ -157,27 +183,33 @@ nextui upgrade [components...] [options]
|
|||||||
- `-a --all` [boolean] Upgrade all the NextUI components (default: `false`).
|
- `-a --all` [boolean] Upgrade all the NextUI components (default: `false`).
|
||||||
- `-h, --help` Display help for commands.
|
- `-h, --help` Display help for commands.
|
||||||
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
nextui upgrade button
|
nextui upgrade button
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NextUI CLI v0.1.2
|
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
|
||||||
|
╭───────────────────── PeerDependencies ─────────────────────╮
|
||||||
|
│ @nextui-org/theme 2.0.1 -> 2.1.0 │
|
||||||
|
│ tailwindcss ^3.2.3 -> ^3.4.0 │
|
||||||
|
╰────────────────────────────────────────────────────────────╯
|
||||||
|
2 minor, 1 patch
|
||||||
|
|
||||||
╭───────────────────────────────────────────────────────────╮
|
|
||||||
│ @nextui-org/button 2.0.24 -> 2.0.27 │
|
|
||||||
╰───────────────────────────────────────────────────────────╯
|
|
||||||
? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit.
|
? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit.
|
||||||
❯ Yes
|
❯ Yes
|
||||||
No
|
No
|
||||||
|
|
||||||
pnpm add @nextui-org/button@2.0.27
|
pnpm add @nextui-org/button@2.0.31 @nextui-org/theme@2.1.0 tailwindcss@3.4.0
|
||||||
Already up to date
|
Already up to date
|
||||||
Progress: resolved 474, reused 465, downloaded 0, added 0, done
|
Progress: resolved 474, reused 465, downloaded 0, added 0, done
|
||||||
Done in 2.9s
|
Done in 2.9s
|
||||||
@ -195,7 +227,6 @@ Remove NextUI components from your project.
|
|||||||
nextui remove [components...] [options]
|
nextui remove [components...] [options]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
- `-p --packagePath` [string] The path to the package.json file.
|
- `-p --packagePath` [string] The path to the package.json file.
|
||||||
@ -213,7 +244,7 @@ nextui remove button
|
|||||||
Output:
|
Output:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
NextUI CLI v0.1.2
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
❗️ Components slated for removal:
|
❗️ Components slated for removal:
|
||||||
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
@ -249,8 +280,8 @@ nextui list [options]
|
|||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
- `-p --packagePath` [string] The path to the package.json file.
|
- `-p --packagePath` [string] The path to the package.json file
|
||||||
- `-c --current` List the current installed components.
|
- `-r --remote` List all components available remotely
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@ -261,7 +292,7 @@ nextui list
|
|||||||
Output:
|
Output:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
NextUI CLI v0.1.2
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
Current installed components:
|
Current installed components:
|
||||||
|
|
||||||
@ -283,6 +314,7 @@ Diagnose problems in your project.
|
|||||||
> 2. Check whether the NextUI components `required dependencies are installed` in the project
|
> 2. Check whether the NextUI components `required dependencies are installed` in the project
|
||||||
> 3. Check the required `tailwind.config.js` file and the content is correct
|
> 3. Check the required `tailwind.config.js` file and the content is correct
|
||||||
> 4. Check `.npmrc` is correct when using `pnpm`
|
> 4. Check `.npmrc` is correct when using `pnpm`
|
||||||
|
> 5. Check `peerDependencies with required version` are installed in the project
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
nextui doctor [options]
|
nextui doctor [options]
|
||||||
@ -310,7 +342,7 @@ Output:
|
|||||||
If there is a problem in your project, the `doctor` command will display the problem information.
|
If there is a problem in your project, the `doctor` command will display the problem information.
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
NextUI CLI v0.1.2
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
NextUI CLI: ❌ Your project has 1 issue that require attention
|
NextUI CLI: ❌ Your project has 1 issue that require attention
|
||||||
|
|
||||||
@ -322,7 +354,7 @@ Missing tailwind.config.(j|t)s file. To set up, visit: https://nextui.org/docs/g
|
|||||||
Otherwise, the `doctor` command will display the following message.
|
Otherwise, the `doctor` command will display the following message.
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
NextUI CLI v0.1.2
|
NextUI CLI v0.2.1
|
||||||
|
|
||||||
✅ Your project has no detected issues.
|
✅ Your project has no detected issues.
|
||||||
```
|
```
|
||||||
@ -348,7 +380,7 @@ nextui env
|
|||||||
Output:
|
Output:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
NextUI CLI 0.1.0
|
NextUI CLI 0.2.1
|
||||||
|
|
||||||
Current installed components:
|
Current installed components:
|
||||||
|
|
||||||
|
|||||||
@ -83,19 +83,41 @@ nextui init my-nextui-app
|
|||||||
You will be prompted to configure your project:
|
You will be prompted to configure your project:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
? Select a template › - Use arrow-keys. Return to submit.
|
┌ Create a new project
|
||||||
❯ App
|
│
|
||||||
A Next.js 13 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.
|
◇ Select a template (Enter to select)
|
||||||
Pages
|
│ ● App (A Next.js 14 with app directory template pre-configured with NextUI (v2) and Tailwind CSS.)
|
||||||
A Next.js 13 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.
|
│ ○ Pages (A Next.js 14 with pages directory template pre-configured with NextUI (v2) and Tailwind CSS.)
|
||||||
|
│
|
||||||
|
◇ New project name (Enter to skip with default name)
|
||||||
|
│ my-nextui-app
|
||||||
|
│
|
||||||
|
◇ Select a package manager (Enter to select)
|
||||||
|
│ ● npm
|
||||||
|
│ ○ yarn
|
||||||
|
│ ○ pnpm
|
||||||
|
│ ○ bun
|
||||||
|
│
|
||||||
|
◇ Template created successfully!
|
||||||
|
│
|
||||||
|
◇ Next steps ───────╮
|
||||||
|
│ │
|
||||||
|
│ cd my-nextui-app │
|
||||||
|
│ npm install │
|
||||||
|
│ │
|
||||||
|
├────────────────────╯
|
||||||
|
│
|
||||||
|
└ 🚀 Get started with npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the dependencies to start the local server:
|
Install the dependencies to start the local server:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
cd my-nextui-app && npm install
|
cd my-nextui-app && npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the local server:
|
Start the local server:
|
||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
@ -164,9 +186,16 @@ You will be asked to confirm the upgrade:
|
|||||||
|
|
||||||
```codeBlock bash
|
```codeBlock bash
|
||||||
|
|
||||||
╭───────────────────────────────────────────────────────────╮
|
╭───────────────────────── Component ─────────────────────────╮
|
||||||
│ @nextui-org/button 2.0.24 -> 2.0.27 │
|
│ @nextui-org/button ^2.0.11 -> ^2.0.31 │
|
||||||
╰───────────────────────────────────────────────────────────╯
|
╰─────────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
Required min version: @nextui-org/theme>=2.1.0, tailwindcss>=3.4.0
|
||||||
|
╭───────────────────── PeerDependencies ─────────────────────╮
|
||||||
|
│ @nextui-org/theme 2.0.1 -> 2.1.0 │
|
||||||
|
│ tailwindcss ^3.2.3 -> ^3.4.0 │
|
||||||
|
╰────────────────────────────────────────────────────────────╯
|
||||||
|
2 minor, 1 patch
|
||||||
|
|
||||||
? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit.
|
? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit.
|
||||||
❯ Yes
|
❯ Yes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user