Skip to content

Commit ab48c5a

Browse files
committed
chore: update package manager version in package.json and refresh documentation timestamps
1 parent 0e5d775 commit ab48c5a

5 files changed

Lines changed: 422 additions & 34 deletions

File tree

docs/dev-tools/weaverse-cli.md

Lines changed: 88 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,119 @@
22
title: Weaverse CLI
33
description: The Weaverse CLI facilitates tasks such as project setup, theme scaffolding, and other common developer operations.
44
publishedAt: November 20, 2023
5-
updatedAt: January 17, 2024
5+
updatedAt: July 20, 2024
66
order: 0
77
published: true
88
---
99

1010
For developers crafting Weaverse Hydrogen themes, the Weaverse CLI is a simple yet powerful aid, streamlining project
1111
setup and management tasks directly from the command line.
1212

13-
## Usage
13+
## Installation & Usage
1414

15-
You can run it directly using **`npx`** to ensure you're always using the latest version:
15+
You can run the CLI directly using **`npx`** to ensure you're always using the latest version:
1616

1717
```txt data-line-numbers=false
1818
npx @weaverse/cli@latest [command]
1919
```
2020

21-
## Commands
21+
To view available commands and options:
2222

23-
#### `create`
23+
```txt data-line-numbers=false
24+
npx @weaverse/cli@latest --help
25+
```
26+
27+
## Available Commands
28+
29+
### `create`
30+
31+
The `create` command is essential for starting new Weaverse Hydrogen projects. It:
32+
33+
- Creates a new project directory
34+
- Downloads and extracts the selected template
35+
- Sets up environment variables
36+
- Installs necessary dependencies (optional)
37+
- Starts the development server (optional)
38+
39+
#### Available Templates
2440

25-
The \`create\` command in the Weaverse CLI is essential for starting new Weaverse Hydrogen projects. It creates a new
26-
project directory, sets it up with a basic template, and installs necessary dependencies. After setting up, it
27-
initializes the project and starts the development server, making sure your project is ready for development
28-
immediately.
41+
Weaverse CLI currently supports the following templates:
2942

30-
**Options**
43+
| Template | Description |
44+
| --- | --- |
45+
| **pilot** | A modern and clean template for your Weaverse store |
46+
| **naturelle** | A beautiful and elegant template for your Weaverse store |
3147

32-
- **`--template`**: Specifies the template to be used when creating the project. Currently, the only supported template
33-
is **`'pilot'`**.
48+
#### Options
3449

35-
- **`--project-id`**: This is the unique identifier for your project, which should correspond with the project ID in the
36-
Weaverse app.
50+
| Option | Description | Required | Default |
51+
| --- | --- | --- | --- |
52+
| **`--template`** | Template name (`pilot` or `naturelle`) | Yes | - |
53+
| **`--project-id`** | Your Weaverse project ID | Yes | - |
54+
| **`--project-name`** | Name for your project directory | No | my-weaverse-hydrogen-project |
55+
| **`--commit`** | Specific Git commit hash to use | No | Latest from main branch |
56+
| **`--no-install`** | Skip dependency installation and dev server start | No | false |
3757

38-
- **`--project-name`**: Defines the name of your project, used as the directory name and within configuration files.
58+
#### Usage Examples
3959

40-
**Usage**
60+
**Basic usage with the Pilot template:**
4161

42-
To create a new project, you would use a command like this:
62+
```txt data-line-numbers=false
63+
npx @weaverse/cli@latest create --template=pilot --project-id=clocwvm3y08j2r79n3c44uhjh --project-name=my-store
64+
```
65+
66+
**Using the Naturelle template:**
4367

4468
```txt data-line-numbers=false
45-
npx @weaverse/cli@latest create --template=pilot --project-id=clocwvm3y08j2r79n3c44uhjh --project-name=my-hydrogen-storefront
69+
npx @weaverse/cli@latest create --template=naturelle --project-id=clocwvm3y08j2r79n3c44uhjh --project-name=naturelle-store
4670
```
4771

48-
**Best Practices**
72+
**Using a specific commit version:**
4973

50-
It is recommended to create your project within the Weaverse app first. Doing so will allow you to copy the full
51-
command, complete with the project ID and project name, ensuring accuracy.
74+
```txt data-line-numbers=false
75+
npx @weaverse/cli@latest create --template=pilot --project-id=clocwvm3y08j2r79n3c44uhjh --commit=a1b2c3d4
76+
```
77+
78+
**Creating project without installing dependencies:**
79+
80+
```txt data-line-numbers=false
81+
npx @weaverse/cli@latest create --template=pilot --project-id=clocwvm3y08j2r79n3c44uhjh --no-install
82+
```
83+
84+
## Workflow
85+
86+
When you run the `create` command, the CLI will:
87+
88+
1. Download the selected template from GitHub
89+
2. Extract the template to your specified project directory
90+
3. Configure environment variables (including your Weaverse project ID)
91+
4. Install dependencies using npm (unless `--no-install` is specified)
92+
5. Start the development server (unless `--no-install` is specified)
93+
94+
After completion, you'll see instructions for the next steps to take.
95+
96+
## Best Practices
97+
98+
It is recommended to create your project within the Weaverse app first. Doing so will allow you to copy the
99+
full command, complete with the project ID and project name, ensuring accuracy.
52100

53101
![](https://cdn.shopify.com/s/files/1/0838/0052/3057/files/CLI-newProject.png?v=1743412008)
102+
103+
## Troubleshooting
104+
105+
### Common Issues
106+
107+
**Template Download Fails**
108+
- Check your internet connection
109+
- Verify that the specified commit hash is valid (if using `--commit`)
110+
- Try again with the default template without specifying a commit
111+
112+
**Dependency Installation Fails**
113+
- Try running `npm install --legacy-peer-deps` manually in the project directory
114+
- Ensure you have the latest version of Node.js installed (v16+)
115+
- Check for errors in your project's package.json
116+
117+
**Development Server Won't Start**
118+
- Make sure all required environment variables are set
119+
- Check that you've pulled Shopify environment variables with `npx shopify hydrogen env pull`
120+
- Verify port 3456 is available on your system

docs/dev-tools/weaverse-mcp.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
title: Weaverse MCP
3+
description: The Weaverse MCP server enhances AI assistants by providing tools to search Weaverse documentation for accurate, contextual help.
4+
publishedAt: July 20, 2024
5+
updatedAt: July 20, 2024
6+
order: 2
7+
published: true
8+
---
9+
10+
The Weaverse MCP (Managed Capability Provider) server enables AI assistants like Claude and GitHub Copilot to search Weaverse documentation directly, delivering accurate, context-aware assistance for developers working with Weaverse products.
11+
12+
## What is an MCP?
13+
14+
MCP stands for Managed Capability Provider - a protocol that allows AI assistants to access external tools and data sources. By implementing the MCP protocol, Weaverse provides AI models with direct access to our documentation, enabling them to give precise, up-to-date answers about Weaverse functionality.
15+
16+
## Setup
17+
18+
You can run the Weaverse MCP server easily using npx:
19+
20+
```txt data-line-numbers=false
21+
npx -y @weaverse/mcp@latest
22+
```
23+
24+
The server will start locally and listen for requests from compatible AI assistants.
25+
26+
## Integration with AI Assistants
27+
28+
### Cursor
29+
30+
To integrate Weaverse MCP with Cursor, add the following configuration to your Cursor settings:
31+
32+
1. Open Cursor and go to Settings (⚙️) > Extensions
33+
2. Select "MCPs" from the sidebar
34+
3. Add a new MCP with the following configuration:
35+
36+
```json data-line-numbers=false
37+
{
38+
"mcpServers": {
39+
"weaverse-mcp": {
40+
"command": "npx",
41+
"args": [
42+
"-y",
43+
"@weaverse/mcp"
44+
]
45+
}
46+
}
47+
}
48+
```
49+
50+
After saving, restart Cursor and the Weaverse MCP will be available to your AI assistant.
51+
52+
### Claude Desktop
53+
54+
To integrate with Claude Desktop:
55+
56+
1. Open Claude Desktop settings
57+
2. Navigate to the MCP configuration section
58+
3. Add the same configuration as shown above
59+
4. Restart Claude Desktop
60+
61+
Refer to the Claude Desktop MCP guide for specific details on accessing and modifying the settings file.
62+
63+
## Available Tools
64+
65+
The Weaverse MCP server currently provides the following tool:
66+
67+
| Tool Name | Description |
68+
| --- | --- |
69+
| search_weaverse_docs | Search Weaverse.io documentation for specific information |
70+
71+
## Common Use Cases
72+
73+
The Weaverse MCP is particularly useful for:
74+
75+
- **Learning about Weaverse components**: Ask about specific Weaverse components and get documentation directly
76+
- **Troubleshooting errors**: Share error messages to receive relevant documentation
77+
- **Implementation guidance**: Get step-by-step instructions for implementing Weaverse features
78+
- **API reference**: Query specific API endpoints, parameters, and return values
79+
80+
### Example Queries
81+
82+
Here are some example questions you can ask your AI assistant with the Weaverse MCP enabled:
83+
84+
```
85+
How do I set up a new Weaverse Hydrogen theme?
86+
What props does the ProductMedia component accept?
87+
How can I customize the slideshow component in Weaverse?
88+
What are the options for the collection-list element?
89+
```
90+
91+
## How It Works
92+
93+
When you ask a question about Weaverse, the AI assistant:
94+
95+
1. Recognizes that your question is about Weaverse
96+
2. Calls the Weaverse MCP server with your query
97+
3. The MCP server searches the Weaverse documentation
98+
4. Relevant documentation is returned to the AI assistant
99+
5. The AI assistant formulates a response based on the documentation
100+
101+
This process ensures that responses are accurate and based on official Weaverse documentation.
102+
103+
## Troubleshooting
104+
105+
### Common Issues
106+
107+
**MCP Not Responding**
108+
- Ensure the MCP server is running (you should see a confirmation in your terminal)
109+
- Check that you've configured your AI assistant correctly
110+
- Verify your network connection
111+
112+
**Irrelevant Results**
113+
- Be specific in your queries
114+
- Include relevant Weaverse terms like component names or specific features
115+
- Try rephrasing your question
116+
117+
**Installation Problems**
118+
- Make sure you have Node.js version 16 or higher installed
119+
- Check for any error messages in your terminal
120+
- Try running with the `--verbose` flag: `npx -y @weaverse/mcp@latest --verbose`
121+
122+
## Benefits
123+
124+
- **Accurate Information**: AI assistants can access up-to-date Weaverse documentation
125+
- **Contextual Responses**: Get answers tailored to Weaverse's specific implementation and ecosystem
126+
- **Reduced Development Time**: Quick access to accurate documentation means less time spent searching for answers
127+
- **Seamless Integration**: Works with popular AI coding assistants with minimal configuration
128+
129+
## Future Enhancements
130+
131+
The Weaverse team is actively working on expanding MCP capabilities to include:
132+
133+
- Additional search filters and options
134+
- Code example generation for common Weaverse patterns
135+
- Theme setup assistance and troubleshooting
136+
- Integration with project-specific configuration

0 commit comments

Comments
 (0)