--- title: CLI description: "CLIコマンドを使用してテーマを生成する方法を学ぶ。" --- ## 使い方 :::warning 下記のコマンドを実行する前に、`@yamada-ui/cli`をインストールして`init`コマンドを実行する必要があります。詳しくは、[こちら](https://yamada-ui.com/docs/get-started/cli.md)をご覧ください。 ::: ### テーマを生成する `theme`コマンドを実行すると、指定されたパスにテーマを生成します。 ```bash pnpm yamada-cli theme ``` ```bash npm yamada-cli theme ``` ```bash yarn yamada-cli theme ``` ```bash bun yamada-cli theme ``` :::note パスが指定されない場合は、`./theme`にテーマが生成されます。 ::: ```bash Usage: pnpm yamada-cli theme [options] [path] generate theme to your project Arguments: path path to the theme directory Options: --cwd current working directory -c, --config path to the config file (default: "ui.json") -o, --overwrite overwrite existing directory. (default: false) -j, --js use js instead of ts -f, --format format the output files. -l, --lint lint the output files. -h, --help display help for command ``` ### 差分を確認する `diff`コマンドを実行すると、テーマのローカルとリモートの差分を確認できます。 ```bash pnpm yamada-cli diff theme ``` ```bash npm yamada-cli diff theme ``` ```bash yarn yamada-cli diff theme ``` ```bash bun yamada-cli diff theme ``` ```bash Usage: pnpm yamada-cli diff [options] [component] check for updates against the registry Arguments: component component to check Options: --cwd current working directory -c, --config path to the config file (default: "ui.json") -s, --sequential run tasks sequentially. (default: false) -d, --detail show detailed changes (default: false) -h, --help display help for command ``` ### テーマを更新する `update`コマンドを実行すると、テーマを更新します。 ```bash pnpm yamada-cli update theme ``` ```bash npm yamada-cli update theme ``` ```bash yarn yamada-cli update theme ``` ```bash bun yamada-cli update theme ``` ```bash Usage: pnpm yamada-cli update [options] [components...] update components in your project Arguments: components components to update Options: --cwd current working directory -c, --config path to the config file (default: "ui.json") -i, --install install dependencies (default: false) -s, --sequential run tasks sequentially. (default: false) -f, --format format the output files. -l, --lint lint the output files. -h, --help display help for command ``` ### 型定義を更新する `tokens`コマンドを実行すると、カスタマイズしたテーマの型定義を更新できます。 この型定義は、[Style Props](https://yamada-ui.com/docs/styling/style-props.md)などで使用されます。 ```bash pnpm yamada-cli tokens ``` ```bash npm yamada-cli tokens ``` ```bash yarn yamada-cli tokens ``` ```bash bun yamada-cli tokens ``` :::note パスが指定されない場合は、コンフィグの`theme.path`を参照します。 ::: ```bash Usage: pnpm yamada-cli tokens [options] [path] generate theme typings Arguments: path path to the theme file Options: --cwd current working directory -c, --config path to the config file (default: "ui.json") -o, --out output path -f, --format format the output file -l, --lint lint the output file -h, --help display help for command ```