> ## Documentation Index
> Fetch the complete documentation index at: https://docs.htflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cursor Extension

> Install and use HTFlow extension in Cursor

## Overview

The HTFlow Cursor extension provides a visual interface for all HTFlow CLI commands, making it easy to manage HTFlow projects without touching the terminal.

<Info>Works with both **Cursor** and compatible forks</Info>

## Prerequisites

Before installing the HTFlow extension:

<CardGroup cols={2}>
  <Card title="Cursor 1.99.0+" icon="window">
    Download from [cursor.sh](https://cursor.sh/)
  </Card>

  <Card title="Node.js 16+" icon="node-js">
    Required for HTFlow CLI Download from [nodejs.org](https://nodejs.org/)
  </Card>
</CardGroup>

## Installation

### Step 1: Open Cursor

Launch Cursor on your computer

### Step 2: Open Extensions Panel

Press `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (Mac)

<Tip>You can also click the Extensions icon in the Activity Bar</Tip>

### Step 3: Search for HTFlow

In the search bar, type **"Htflow Html to Webflow"**

<Frame>
  <iframe width="560" height="315" src="https://www.youtube.com/embed/MBBAj5EaKSg" title="HTFlow Extension Tutorial" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />
</Frame>

### Step 4: Install Extension

Click the **Install** button next to the HTFlow extension

### Step 5: Reload Cursor

Reload Cursor to activate the extension

<Check>HTFlow icon should appear in the Activity Bar</Check>

## How HTFlow Cursor Extension Works

After installing the extension, install the HTFlow CLI:

<Tabs>
  <Tab title="Via Extension (Recommended)">
    ### Step 1: Open HTFlow Panel

    <Card title="1. Open HTFlow Panel" icon="window">
      Click the HTFlow icon in Activity Bar or press `Ctrl+Shift+H` / `Cmd+Shift+H`

      <Frame>
        <img src="https://mintcdn.com/htflow/ZMG4-tTIy5izghvR/images/image_cursor_start.png?fit=max&auto=format&n=ZMG4-tTIy5izghvR&q=85&s=0642e3c4e33e0b605a0138397a05200a" alt="HTFlow Extension Panel" width="3360" height="2100" data-path="images/image_cursor_start.png" />
      </Frame>
    </Card>

    ### Step 2: Install HTFlow CLI globally

    <Card title="2. Install HTFlow CLI" icon="download">
      In the HTFlow panel, click **"Install HTFlow CLI"** button

      <Frame>
        <img src="https://mintcdn.com/htflow/UzoYIGn8s-rEm5j_/images/image_install-htflow-cli.png?fit=max&auto=format&n=UzoYIGn8s-rEm5j_&q=85&s=70d0c4e4e70abc17c544b4a4010dfa6c" alt="Install htflow Cli" width="3360" height="2100" data-path="images/image_install-htflow-cli.png" />
      </Frame>
    </Card>

    ### Step 3: Initialize Project

    <Card title="3. Initialize Project" icon="folder-plus">
      In the HTFlow panel, click **"Initialize Project"** button

      <Frame>
        <img src="https://mintcdn.com/htflow/OXZWD25JgOBzvijh/images/image_cursor-init.png?fit=max&auto=format&n=OXZWD25JgOBzvijh&q=85&s=e994457020936b40b6c322194914913c" alt="Initialize htflow project in cursor" width="3360" height="2100" data-path="images/image_cursor-init.png" />
      </Frame>

      **Project Structure Created:**

      After initializing the project, HTFlow will create the following file and folder structure:

      ```text theme={null}
      .cursor/
      └── rules/
          ├── examples/
          │   ├── htflow-css-examples.mdc
          │   ├── htflow-html-examples.mdc
          │   └── htflow-js-examples.mdc
          ├── htflow-css-essentials.mdc
          ├── htflow-html-essentials.mdc
          ├── htflow-js-essentials.mdc
          ├── .htflowrc.json
          └── AI_PROMPTS.md
      ```

      **What Each File Contains:**

      * **htflow-html-essentials.mdc**: Essential HTML rules and guidelines for HTFlow compatibility
      * **htflow-css-essentials.mdc**: CSS best practices and HTFlow-specific styling rules
      * **htflow-js-essentials.mdc**: JavaScript guidelines for HTFlow conversion
      * **htflow-html-examples.mdc**: HTML code examples and templates
      * **htflow-css-examples.mdc**: CSS examples and styling patterns
      * **htflow-js-examples.mdc**: JavaScript code examples
      * **.htflowrc.json**: HTFlow configuration file
      * **AI\_PROMPTS.md**: Pre-configured prompts for AI agents to generate HTFlow-compatible code
    </Card>

    ### Step 4: AI Build

    <Card title="4. AI Build" icon="robot">
      Create your HTML webpage using an AI agent. We've shown the default Cursor AI in this example,
      but you can use any AI agent you prefer, such as Claude Code, GPT Code, Gemini CLI, or any other AI coding assistant.

      **Key Requirements:**

      * Instruct your AI agent to follow the HTFlow rules that were established during the project initialization step
      * Provide the `.cursor` folder, `htflowrc.json`, and `AI_prompt.md` files as context to your AI agent (Cursor AI or others)
      * This ensures the AI agent will generate HTML, CSS, and JavaScript code that is compatible with Webflow and Droip conversion requirements

      **Best Practices:**

      * Start with a clear description of your website requirements
      * Ask the AI to follow the HTFlow rules from the configuration files
      * Iterate on the design until you're satisfied with the result
      * Save your files before proceeding to the audit step

      **Example AI Prompts for HTFlow Development**

      ```text theme={null}
      "Create a modern SaaS landing page using HTFlow-compatible
      HTML, CSS, and JavaScript.
      Follow ALL HTFlow rules strictly and include the following sections:

      **Hero Section:**
      - Compelling headline with value proposition
      - Subheading explaining the product benefits
      - Primary CTA button and secondary button
      - Hero image or illustration
      - Trust indicators (logos, badges, or stats)

      **Product Features Section:**
      - 3-4 key features with icons
      - Feature titles and descriptions
      - Visual elements (icons, images, or graphics)
      - Grid layout for feature cards

      **Testimonials Section:**
      - 3 customer testimonials
      - Customer names, titles, and company logos
      - Star ratings or review scores
      - Professional headshots or avatars

      **Pricing Section:**
      - 3 pricing tiers (Basic, Pro, Enterprise)
      - Clear pricing with currency symbols
      - Feature lists for each plan
      - CTA buttons for each pricing tier
      - Popular plan highlighting

      **Call-to-Action Section:**
      - Compelling headline
      - Urgency or benefit-focused copy
      - Primary CTA button
      - Supporting text or trust signals

      **Footer Section:**
      - Company logo and tagline
      - Navigation links (About, Features, Pricing, Contact)
      - Social media icons
      - Copyright and legal links
      - Newsletter signup form

      **Technical Requirements:**
      - Use semantic HTML5 elements
      - Implement responsive design (mobile-first)
      - Include smooth scrolling and animations
      - Add hover effects and micro-interactions
      - Ensure accessibility compliance
      - Use modern CSS Grid and Flexbox
      - Include JavaScript for interactive elements

      **HTFlow Compliance:**
      - Follow HTFlow HTML, CSS and JavaScript rules inside .cursor folder

      **Style Guides:**
      -Use a single container acrross the website
      -Keep all the similar heading size same accross the website

      Make the design modern, professional, and conversion-focused."
      ```
    </Card>

    ### Step 5: Audit and Validation

    <Card title="5. Audit and Validation" icon="shield-check">
      Once you're satisfied with your AI-generated design, run the audit to validate your code against HTFlow rules.

      In the HTFlow panel, click on the **"Validation"** tab and then click the **"Audit Project"** button.
      HTFlow will execute the `npx htflow audit` command in the terminal.

      **What the Audit Does:**

      * Scans your HTML, CSS, and JavaScript files for rule violations
      * Displays all compatibility issues that need to be fixed
      * Provides detailed error messages and suggestions

      **Fixing Errors:**

      If you encounter any errors, simply copy the entire terminal output and paste it into your AI agent's chat box,
      asking the AI to fix the issues. The AI will resolve all the errors for you.
      You can run the audit repeatedly until you achieve zero errors.

      <Frame>
        <img src="https://mintcdn.com/htflow/YA_rfNRk2ZWHBv11/images/image_cursor-audit.png?fit=max&auto=format&n=YA_rfNRk2ZWHBv11&q=85&s=9e66b21aa318ee03f9409d0645d7bf65" alt="HTFlow Cursor Audit" width="3360" height="2100" data-path="images/image_cursor-audit.png" />
      </Frame>

      <Info>
        See the <a href="/htflow/tutorial" target="_blank">complete tutorial</a> to learn how to build a full website with HTFlow from start to finish.
      </Info>
    </Card>

    ### Step 6: Development Server

    <Card title="6. Development Server" icon="server">
      In the HTFlow panel, click the **"Server"** tab where you'll see two server options:

      * **HTFlow Serve Dev (Development Server)**: For testing and development
      * **HTFlow Serve Start (Production Server)**: For final deployment and production use

      **Why Use a Development Server?**

      The development server is essential for several reasons:

      1. **Live Preview**: You can see your website changes in real-time as you develop
      2. **Hot Reloading**: Automatic browser refresh when you save files
      3. **HTFlow Chrome Extension Integration**: Enables website inspection capabilities

      **How It Works:**

      When you click the **"Start Dev Server"** button, HTFlow launches a local development server that:

      * Serves your website on a local port (typically [http://localhost:3050](http://localhost:3050))
      * Enables real-time file watching and automatic reloading
      * Provides development-specific features and debugging tools
      * Integrates with the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome extension</a> for enhanced inspection

      **Chrome Extension Benefits:**

      With the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome extension</a> installed, development mode provides:

      * **Website Inspection**: Analyze your HTML structure and styling
      * **AI-Prompt Generation**: Generate prompts for AI agents to improve your design
      * **Design Analysis**: Get suggestions for layout and styling improvements
      * **Code Optimization**: Identify areas for better performance and compatibility

      <Frame>
        <img src="https://mintcdn.com/htflow/DlxTB8BKyN-9_15b/images/image__dev.png?fit=max&auto=format&n=DlxTB8BKyN-9_15b&q=85&s=f654e4bd9404bb77ef22fe63e6af689d" alt="HTFlow Dev Server" width="3360" height="2100" data-path="images/image__dev.png" />
      </Frame>

      <Info>
        The HTFlow development server is strongly recommended for development mode, as the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome extension</a> only functions properly with this server type. This ensures full compatibility and access to all development features.
      </Info>
    </Card>

    ### Step 7: Production Server

    <Card title="7. Production Server" icon="rocket">
      In the HTFlow panel, click the **"Server"** tab where you'll see two server options:

      * **HTFlow Serve Dev (Development Server)**: For testing and development
      * **HTFlow Serve Start (Production Server)**: For final deployment and production use

      **When to Use the Production Server:**

      The production server is essential for several reasons:

      1. **Final Testing**: Test your website in production-like conditions
      2. **Performance Optimization**: See how your site performs with optimized settings
      3. **Deployment Preparation**: Ensure your site is ready for live deployment
      4. **Conversion Ready**: Prepare for Webflow or Droip conversion processes

      **How It Works:**

      When you click the **"Start Production Server"** button, HTFlow launches a production server that:

      * Serves your website with production-optimized settings
      * Enables minification and compression for better performance
      * Provides production-specific configurations
      * Prepares your site for deployment and conversion

      **Production Server Benefits:**

      With the production server running, you get:

      * **Optimized Performance**: Faster loading times and better resource management
      * **Conversion Compatibility**: Ensures compatibility with Webflow and Droip conversion tools
      * **Deployment Ready**: Your site is prepared for live deployment
      * **Production Testing**: Test your site as it will appear to end users

      <Frame>
        <img src="https://mintcdn.com/htflow/2YLLiJqrn9yWmm6v/images/image__htflow-start-server.png?fit=max&auto=format&n=2YLLiJqrn9yWmm6v&q=85&s=ec1ca71cd6f9e1da5c121d9f70ae3ada" alt="HTFlow production server" width="3360" height="2100" data-path="images/image__htflow-start-server.png" />
      </Frame>

      <Info>
        The production server intentionally disables JavaScript to preserve the original HTML structure.
        This ensures compatibility with the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome Extension</a>
        for Webflow and Droip conversion. Please note that in production mode, JavaScript functionality will not work - this is specifically designed for conversion purposes.
      </Info>
    </Card>

    ### Step 8: Build for Conversion

    <Card title="8. Build for Conversion" icon="hammer">
      In the HTFlow panel, click the **"Build"** tab and then click the **"Build Project"** button.

      This will create a folder in your project root called **htflow-copyable** and organize each HTML file
      as a separate folder containing the copyable HTML, CSS, and JS codes. These files can be used to convert
      into Webflow or Droip using the HTFlow Webflow app or HTFlow web app:

      * <a href="https://htflow.com/html-to-webflow" target="_blank">HTML to Webflow</a>
      * <a href="https://htflow.com/html-to-droip" target="_blank">HTML to Droip</a>

      **Example folder structure after build:**

      ```text theme={null}
      htflow-copyable/
      ├── index/
      │   ├── index.html
      │   ├── index.css
      │   └── index.js
      └── about/
          ├── about.html
          ├── about.css
          └── about.js
      ```

      <Frame>
        <img src="https://mintcdn.com/htflow/U0cd0tJWXT2_vVRn/images/image_cursor-build.png?fit=max&auto=format&n=U0cd0tJWXT2_vVRn&q=85&s=c44bf1643e3a1e953c3f2fff3a73891b" alt="HTFlow cursor build" width="3360" height="2100" data-path="images/image_cursor-build.png" />
      </Frame>
    </Card>

    ### Step 9: Use Webflow App for Conversion

    <Card title="9. Use Webflow App for Conversion" icon="puzzle-piece">
      Once you have your HTML and CSS code ready, you can convert them to Webflow using the **HTFlow Webflow App**.

      **How to Use the HTFlow Webflow App:**

      1. **Install the App**: Go to your Webflow design canvas and install the **HTFlow** app
      2. **Login**: Once you log in to the app, you'll see the **"HTML to WF"** tab
      3. **Input Your Code**: The tab contains HTML and CSS input areas:
         * Paste your HTML code in the **HTML** area
         * Paste your CSS code in the **CSS** area
      4. **Convert**: Click the **"Convert & Copy"** button
      5. **Paste in Webflow**: Once converted, simply paste into Webflow using:
         * **Mac**: `Cmd + V`
         * **Windows**: `Ctrl + V`

      **Benefits:**

      * Seamless conversion from HTML/CSS to Webflow elements
      * Preserves styling and layout structure
      * Direct integration with Webflow's design canvas
      * Maintains responsive design properties

      <Frame>
        <img src="https://mintcdn.com/htflow/ix2Y1pJXDgfzeXmp/images/image__webflow-app.png?fit=max&auto=format&n=ix2Y1pJXDgfzeXmp&q=85&s=6ef8df2b3e8d4174de5e1aef3051ad99" alt="HTFlow Webflow App" width="3358" height="1927" data-path="images/image__webflow-app.png" />
      </Frame>

      <Info>
        **JavaScript Code Integration:** You need to copy and paste the JavaScript code separately into your Webflow page.
        You can do this by either:

        * **Page Settings**: Go to your page settings and paste the code in the "Custom Code" area
        * **Embed Element**: Add an Embed element to your page and paste the JavaScript code including the `<script>` tags

        This ensures your interactive features work properly in the final Webflow site.
      </Info>
    </Card>

    ### Step 10: Use Chrome Extension for Conversion

    <Card title="10. Use Chrome Extension for Conversion" icon="puzzle-piece">
      Convert your HTML website to Webflow using the **HTFlow Chrome Extension** for seamless integration.

      **Prerequisites:**

      * Ensure you have the production server running (as described in **Step 7**)
      * Have the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome Extension</a> installed

      **How to Use the Chrome Extension:**

      1. **Start Production Server**: Run the production server as described in Step 7
      2. **Open Website**: Your local website will open in Chrome browser with the production server
      3. **Activate Extension**: Click on the **HTFlow Chrome Extension** icon in your browser toolbar
      4. **Extract Code**: Click the **"Extract for Webflow"** button in the extension side panel
      5. **Convert**: The extension will extract all HTML, CSS, and JavaScript code
      6. **Final Conversion**: Click the **"Convert for Webflow"** button
      7. **Paste in Webflow**: Go to your Webflow project's design canvas and paste using:
         * **Mac**: `Cmd + V`
         * **Windows**: `Ctrl + V`

      **Benefits:**

      * Direct browser integration for seamless conversion
      * One-click conversion process
    </Card>

    ### Step 11: Conversion for Droip (WordPress)

    <Card title="11. Conversion for Droip (WordPress)" icon="wordpress">
      Convert your HTML website to Droip (Wordpress) using the **HTFlow Chrome Extension** for seamless integration.

      **Prerequisites:**

      * Ensure you have the production server running (as described in **Step 7**)
      * Have the <a href="https://chromewebstore.google.com/detail/htflow-html-to-webflow-cu/nnkbaccknjdofhmijbddaohboaenbpci" target="_blank">HTFlow Chrome Extension</a> installed

      **How to Use the Chrome Extension:**

      1. **Start Production Server**: Run the production server as described in Step 7
      2. **Open Website**: Your local website will open in Chrome browser with the production server
      3. **Activate Extension**: Click on the **HTFlow Chrome Extension** icon in your browser toolbar
      4. **Extract Code**: Click the **"Extract for Droip"** button in the extension side panel
      5. **Convert**: The extension will extract all HTML, CSS, and JavaScript code
      6. **Final Conversion**: Click the **"Convert for Webflow"** button
      7. **Paste in Droip**: Go to your Droip project's design canvas and paste using:
         * **Mac**: `Cmd + V`
         * **Windows**: `Ctrl + V`

      **Benefits:**

      * Direct browser integration for seamless conversion
      * One-click conversion process
    </Card>
  </Tab>

  <Tab title="Via Terminal">
    htflow-cli installation:

    ```bash theme={null}
    npm install -g htflow-cli
    ```

    Verify installation:

    ```bash theme={null}
    npx htflow version
    ```

    Project Initialization:

    ```bash theme={null}
    npx htflow init
    ```
  </Tab>
</Tabs>

## Next Steps

<Card title="Cursor Extension" icon="sparkles" href="/htflow/cursor-extension" horizontal>
  Learn about HTFlow with Cursor AI
</Card>

<Card title="Quick Start" icon="bolt" href="/htflow/quick-start" horizontal>
  Create your first HTFlow project
</Card>
