Rhythm UI CLI

@rhythm-ui/cli - A command-line interface tool for bootstrapping Vite and Next.js projects with Rhythm UI framework.

Prerequisites

  • Node.js version 16 or higher

Usage

Before running @rhythm-ui/cli, you need to add the following configuration to your .npmrc file located in your home directory:

copy
@rhythm-ui:registry=https://gitlab.com/api/v4/projects/{project_id}/packages/npm/
//gitlab.com/api/v4/projects/{project_id}/packages/npm/:_authToken={auth_token}

Replace {project_id} with the ID of your GitLab project and {auth_token} with your authentication token. If you don't have these values, please contact your project administrator.

To modify or create the .npmrc file, follow the instructions based on your operating system:

Windows

  1. Open a command prompt.

  2. Run the following command to navigate to your home directory:

copy
cd %USERPROFILE%
  1. Check if the .npmrc file already exists by running the following command:
copy
if exist .npmrc (
  echo .npmrc file exists
) else (
  echo .npmrc file does not exist
)
  1. If the file exists, run the following command to append the configuration to the file:
copy
echo @rhythm-ui:registry=https://gitlab.com/api/v4/projects/{project_id}/packages/npm/ >> .npmrc
echo //gitlab.com/api/v4/projects/{project_id}/packages/npm/:_authToken={auth_token} >> .npmrc
  • If the file doesn't exist, run the following command to create it with the configuration:
copy
echo @rhythm-ui:registry=https://gitlab.com/api/v4/projects/{project_id}/packages/npm/ > .npmrc
echo //gitlab.com/api/v4/projects/{project_id}/packages/npm/:_authToken={auth_token} >> .npmrc

Mac and Linux

  1. Open a terminal.

  2. Run the following command to navigate to your home directory:

copy
cd ~
  1. Check if the .npmrc file already exists by running the following command:
copy
if [ -f .npmrc ]; then
  echo .npmrc file exists
else
  echo .npmrc file does not exist
fi
  1. If the file exists, run the following command to append the configuration to the file:
copy
echo @rhythm-ui:registry=https://gitlab.com/api/v4/projects/{project_id}/packages/npm/ >> .npmrc
echo //gitlab.com/api/v4/projects/{project_id}/packages/npm/:_authToken={auth_token} >> .npmrc
  • If the file doesn't exist, run the following command to create it with the configuration:
copy
echo @rhythm-ui:registry=https://gitlab.com/api/v4/projects/{project_id}/packages/npm/ > .npmrc
echo //gitlab.com/api/v4/projects/{project_id}/packages/npm/:_authToken={auth_token} >> .npmrc

After setting up the npmrc file, you can run the following command to start the CLI:

copy
npx @rhythm-ui/cli

The CLI will prompt you with questions, and once you've answered them, it will generate a new project with all the necessary setup.