From c577ee06663fe9be80bf08d24d019081d5d4ebb6 Mon Sep 17 00:00:00 2001 From: JEM Date: Wed, 13 Nov 2024 05:17:11 -0600 Subject: [PATCH] docs(contributing): add CLI usage instructions (#5807) Introduce a detailed workflow for running the CLI locally, ensuring contributors can easily test and develop enhancements in their local environment. This addition helps maintain consistency between CLI and component updates. --- CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f45807d242e..fd64b7878a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,6 +91,42 @@ pnpm --filter=www dev pnpm --filter=shadcn-ui dev ``` +## Running the CLI Locally + +To run the CLI locally, you can follow the workflow: + +1. Start by running the registry (main site) to make sure the components are up to date: + + ```bash + pnpm www:dev + ``` + +2. Run the development script for the CLI: + + ```bash + pnpm shadcn:dev + ``` + +3. In another terminal tab, test the CLI by running: + + ```bash + pnpm shadcn + ``` + + To test the CLI in a specific app, use a command like: + + ```bash + pnpm shadcn -c ~/Desktop/my-app + ``` + +4. To run the tests for the CLI: + + ```bash + pnpm --filter=shadcn test + ``` + +This workflow ensures that you are running the most recent version of the registry and testing the CLI properly in your local environment. + ## Documentation The documentation for this project is located in the `www` workspace. You can run the documentation locally by running the following command: