Installation & Usage
You can run the CLI directly usingnpx
to ensure you’re always using the latest version:
data-line-numbers=false
data-line-numbers=false
Available Commands
create
The create
command is essential for starting new Weaverse Hydrogen projects. It:
- Creates a new project directory
- Downloads and extracts the selected template
- Sets up environment variables
- Installs necessary dependencies (optional)
- Starts the development server (optional)
Available Templates
Weaverse CLI currently supports the following templates:Template | Description |
---|---|
pilot | A modern and clean template for your Weaverse store |
naturelle | A beautiful and elegant template for your Weaverse store |
Options
Option | Description | Required | Default |
---|---|---|---|
--template | Template name (pilot or naturelle ) | Yes | - |
--project-id | Your Weaverse project ID | Yes | - |
--project-name | Name for your project directory | No | my-weaverse-hydrogen-project |
--commit | Specific Git commit hash to use | No | Latest from main branch |
--no-install | Skip dependency installation and dev server start | No | false |
Usage Examples
Basic usage with the Pilot template:data-line-numbers=false
data-line-numbers=false
data-line-numbers=false
data-line-numbers=false
Workflow
When you run thecreate
command, the CLI will:
- Download the selected template from GitHub
- Extract the template to your specified project directory
- Configure environment variables (including your Weaverse project ID)
- Install dependencies using npm (unless
--no-install
is specified) - Start the development server (unless
--no-install
is specified)
Best Practices
It is recommended to create your project within the Weaverse app first. Doing so will allow you to copy the full command, complete with the project ID and project name, ensuring accuracy.
Troubleshooting
Common Issues
Template Download Fails- Check your internet connection
- Verify that the specified commit hash is valid (if using
--commit
) - Try again with the default template without specifying a commit
- Try running
npm install --legacy-peer-deps
manually in the project directory - Ensure you have the latest version of Node.js installed (v16+)
- Check for errors in your project’s package.json
- Make sure all required environment variables are set
- Check that you’ve pulled Shopify environment variables with
npx shopify hydrogen env pull
- Verify port 3456 is available on your system