-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ad00d9
commit b380069
Showing
51 changed files
with
519 additions
and
313 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
title: CLI | ||
description: Use the CLI to add components to your project. | ||
--- | ||
|
||
## init | ||
|
||
Use the `init` command to initialize configuration and dependencies for a new project. | ||
|
||
The `init` command installs dependencies, adds the `cn` util, configures `tailwind.config.js`, and CSS variables for the project. | ||
|
||
```bash | ||
npx buidl-cli@latest init | ||
``` | ||
|
||
You will be asked a few questions to configure `components.json`: | ||
|
||
```txt showLineNumbers | ||
Would you like to use TypeScript (recommended)? no/yes | ||
Which style would you like to use? › Default | ||
Which color would you like to use as base color? › Slate | ||
Where is your global CSS file? › › app/globals.css | ||
Do you want to use CSS variables for colors? › no / yes | ||
Where is your tailwind.config.js located? › tailwind.config.js | ||
Configure the import alias for components: › @/components | ||
Configure the import alias for utils: › @/lib/utils | ||
Are you using React Server Components? › no / yes | ||
``` | ||
|
||
### Options | ||
|
||
```txt | ||
Usage: buidl-cli init [options] | ||
initialize your project and install dependencies | ||
Options: | ||
-y, --yes skip confirmation prompt. (default: false) | ||
-c, --cwd <cwd> the working directory. defaults to the current directory. | ||
-h, --help display help for command | ||
``` | ||
|
||
## add | ||
|
||
Use the `add` command to add components and dependencies to your project. | ||
|
||
```bash | ||
npx buidl-cli@latest add [component] | ||
``` | ||
|
||
You will be presented with a list of components to choose from: | ||
|
||
```txt | ||
Which components would you like to add? › Space to select. A to toggle all. | ||
Enter to submit. | ||
◯ address | ||
◯ balance | ||
◯ block-explorer-link | ||
◯ block-number | ||
◯ nonce | ||
◯ transaction | ||
◯ transaction-status | ||
◯ fee-data | ||
◯ sign-message-button | ||
◯ blockie | ||
``` | ||
|
||
### Options | ||
|
||
```txt | ||
Usage: buidl-cli add [options] [components...] | ||
add a component to your project | ||
Arguments: | ||
components the components to add | ||
Options: | ||
-y, --yes skip confirmation prompt. (default: false) | ||
-o, --overwrite overwrite existing files. (default: false) | ||
-c, --cwd <cwd> the working directory. defaults to the current directory. | ||
-p, --path <path> the path to add the component to. | ||
-h, --help display help for command | ||
``` | ||
|
||
## diff (experimental) | ||
|
||
You can use the diff command to check for updates against the registry. | ||
|
||
Run the following command to get a list of components that have updates available: | ||
|
||
```bash | ||
npx buidl-cli diff | ||
``` | ||
|
||
```txt | ||
The following components have updates available: | ||
- address | ||
- /path/to/my-app/components/buidl/address.tsx | ||
- balance | ||
- /path/to/my-app/components/buidl/balance.tsx | ||
- transaction | ||
- /path/to/my-app/components/buidl/transaction.tsx | ||
``` | ||
|
||
Then run `diff [component]` to see the changes: | ||
|
||
```bash | ||
npx buidl-cli diff alert | ||
``` | ||
|
||
```diff /pl-12/ | ||
const alertVariants = cva( | ||
- "relative w-full rounded-lg border", | ||
+ "relative w-full pl-12 rounded-lg border" | ||
) | ||
``` | ||
|
||
### Options | ||
|
||
```txt | ||
Usage: buidl-cli diff [options] [component] | ||
check for updates against the registry | ||
Arguments: | ||
component the component name | ||
Options: | ||
-y, --yes skip confirmation prompt. (default: false) | ||
-c, --cwd <cwd> the working directory. defaults to the current directory. | ||
-h, --help display help for command | ||
``` |
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
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
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
Oops, something went wrong.