@mayurgodhani/ecomtools-cli v1.0.6
ecomTools
A comprehensive Shopify e-commerce toolkit for AI assistants that provides helpful utilities and code generation for e-commerce development.
Features
- Generate product schema markup for SEO
- Calculate discounts and pricing
- Generate common Shopify components like cart drawers
- Access code snippets and references for e-commerce development
Quick Start
You can run ecomTools using npx without installing:
npx -y @mayurgodhani/ecomtools-cli@latest startThis will start the ecomTools MCP server that can be used with compatible AI assistants.
MCP Configuration
If you're using an IDE or environment that supports Model Context Protocol (MCP), you can add the following configuration to your mcp.json file:
{
"mcpServers": {
"ecomtools-cli": {
"command": "npx",
"args": [
"-y",
"@mayurgodhani/ecomtools-cli@latest start"
]
}
}
}This configuration allows your IDE to automatically start the ecomTools MCP server when needed.
Installation
If you prefer to install globally:
npm install -g @mayurgodhani/ecomtools-cliThen run it with:
ecomtools startUsage with AI Assistants
ecomTools is designed to work with AI assistants that support the Model Context Protocol (MCP). Once the server is running, your AI assistant can leverage it for e-commerce development tasks.
Available Tools and Examples
1. Calculate Discount
Calculate discounted prices with detailed breakdown.
Example:
Calculate the discount for a product with price $99.99 and a 25% discount using ecomTools.Result:
Original price: $99.99
Discount: 25% ($25.00)
Final price: $74.992. Generate Product Schema
Create JSON-LD product schema for SEO.
Example:
My product name is Premium Coffee Maker, description is High-quality automatic coffee maker with timer, price is $149.99. Currency I am selling in is USD. The product image is at https://example.com/images/coffee-maker.jpg. Generate product schema using ecomTools.Result:
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "Premium Coffee Maker",
"description": "High-quality automatic coffee maker with timer",
"image": "https://example.com/images/coffee-maker.jpg",
"offers": {
"@type": "Offer",
"price": 149.99,
"priceCurrency": "USD"
}
}
</script>3. Find Code Snippets
Find code snippets by keywords.
Example:
Find code snippets related to "product card" using ecomTools.Result:
# Shopify Product Card
A responsive product card component for displaying products in collections with image, title, price, and add to cart button.4. Generate Code
Generate common e-commerce components.
Example:
Generate a cart drawer component for mobile view using ecomTools.Result:
# Generated Shopify cart-drawer Code
Based on your requirements: cart drawer component for mobile view
<!-- Cart Drawer HTML -->
<div id="cart-drawer" class="cart-drawer">
...
</div>Extending
ecomTools is designed to be extensible. You can add your own code snippets to the data directory.
Adding Code Snippets
Create a new text file in the data directory with the following format:
Title: Your Code Snippet Title
Description: A brief description of what this code does
Code:
// Your actual code hereThe file name should reflect the type of snippet (e.g., cart-drawer.txt).
Development
To set up the development environment:
git clone https://github.com/mayur2010/ecomtools-cli.git
cd ecomtools-cli
npm installRun locally:
npm startPublishing
To publish to npm:
- Update the version in
package.json - Run
npm loginto log in to your npm account - Run
npm publish --access public
License
MIT
Credits
This project was built with: