1.0.6 • Published 8 months ago

@mayurgodhani/ecomtools-cli v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

ecomTools

A comprehensive Shopify e-commerce toolkit for AI assistants that provides helpful utilities and code generation for e-commerce development.

npm version License: MIT

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 start

This 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-cli

Then run it with:

ecomtools start

Usage 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.99

2. 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 here

The 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 install

Run locally:

npm start

Publishing

To publish to npm:

  1. Update the version in package.json
  2. Run npm login to log in to your npm account
  3. Run npm publish --access public

License

MIT

Credits

This project was built with:

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago