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, including your
WEAVERSE_PROJECT_IDand a generatedSESSION_SECRET - Installs necessary dependencies (optional)
- Starts the development server (optional — prompted interactively, opt-in with
--devin non-interactive runs)
Available Templates
Weaverse CLI currently supports the following templates:Options
The CLI also runs non-interactively on its own when stdin isn’t a TTY (piped
input, CI, or a coding agent), or when
CI=true is set — --yes/--ci just
force that mode explicitly.Usage Examples
Basic usage with the Pilot template:data-line-numbers=false
data-line-numbers=false
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)
- Generate a secure local
SESSION_SECRET - Install dependencies using npm (unless
--no-installis specified) - Start the development server — in interactive mode the CLI asks first; in
non-interactive mode it only starts when
--devis passed, so agent and CI runs return instead of hanging on a blocking server
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-depsmanually in the project directory - Ensure you have a supported version of Node.js installed. The current Pilot template declares Node.js
>=22.12.0; the@weaverse/hydrogenpackage itself declares Node.js>=20 - Check for errors in your project’s package.json
- Make sure all required environment variables are set
- Stores on a Shopify plan: install the Hydrogen sales channel (https://apps.shopify.com/hydrogen), create one Hydrogen storefront project, then run
npx shopify hydrogen env pull. If needed, copy values from Hydrogen sales channel → Storefront Settings → Environments and variables. - Development stores or stores without a Shopify plan: install the Headless sales channel (https://apps.shopify.com/headless), then copy the Storefront API values into
.env. - Verify port 3456 is available on your system