Edit live pages straight into source.
Select elements on your Vite dev server; Glide writes atomic diffs.
Watch the code change live.
Scrub real clips of token rewrites, component scopes, and refusals.
Updates only text-brand-500 in App.tsx.
Rewrites md:text-7xl; comments stay intact.
Targets one usage, definition, or variant.
Refuses unsafe edits across four frameworks.
- Exact targeting
- File, line, column, JSX hash.
- Stale-file guard
- SHA-256 blocks stale edits.
- Class expressions
- cn, clsx, cva, template strings.
- Local loopback
- 127.0.0.1 + session token.
Attach Glide to Vite.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';
export default defineConfig({
plugins: [react(), glideSourceStamping()],
});import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';
export default defineConfig({
plugins: [vue(), glideSourceStamping()],
});import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';
export default defineConfig({
plugins: [svelte(), glideSourceStamping()],
});import { defineConfig } from 'astro/config';
import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';
export default defineConfig({
vite: {
plugins: [glideSourceStamping()],
},
});import { defineConfig } from 'vite';
import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';
export default defineConfig({
plugins: [glideSourceStamping()],
});Install and configure Glide (@srivarsank/glide), the local code-native visual editor, in this project so live canvas edits write atomic AST diffs directly to source.
Follow these steps strictly in order:
1. Preflight checks:
- Run `node -v` and confirm Node.js >= 22.22.0.
- Inspect `package.json` to confirm this is a Vite-based project (Vite 6/7/8 with React, Vue, Svelte/SvelteKit, Astro, or plain Vite HTML). If it uses Webpack or Next.js, stop and report that Glide requires Vite.
- Detect the package manager from lockfiles (`pnpm-lock.yaml` -> pnpm, `yarn.lock` -> yarn, `bun.lock`/`bun.lockb` -> bun, otherwise npm).
2. Install `@srivarsank/glide` as a devDependency using the detected package manager (e.g. `npm install -D @srivarsank/glide`).
3. Register the Vite plugin without disturbing any existing configuration:
- Exact import: `import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';` (never import `{ glide }`).
- In `vite.config.{ts,js,mjs,mts}`: append `glideSourceStamping()` to the existing `plugins` array while keeping all existing plugins (`react()`, `vue()`, `svelte()`, Tailwind, etc.) intact.
- In `astro.config.{mjs,ts,js}`: add `glideSourceStamping()` inside `vite: { plugins: [...] }`, preserving existing Vite plugins.
- Note: `glideSourceStamping()` is a dev-only no-op in production builds.
4. Update `.gitignore`: append `glide-components.json` if it is not already ignored.
5. Verify before reporting done:
- Confirm the config typechecks/parses cleanly and no existing options or plugins were removed.
- Start (or restart) the dev server and confirm terminal output includes `[Glide] Editor: http://127.0.0.1:<port>/__glide/`.
- Confirm `glide-components.json` is generated in the project root.
6. Report back with:
- Modified files (`package.json`, Vite/Astro config, `.gitignore`).
- Exact `http://127.0.0.1:<port>/__glide/` editor URL (remind me to use `127.0.0.1`, not `localhost`, for origin isolation).
- Quick verification step: select an element on the canvas, tweak one style, and confirm the source diff lands via HMR. If `/__glide/` cannot be served directly, provide the fallback `npx @srivarsank/glide <port>`.| File type | Styles, text | Structure |
|---|---|---|
| JSX / TSX | Yes | Yes |
| Vue, Svelte, Astro | Yes | Refused |
| Plain HTML | Yes | Refused |
Trace the HMR-to-AST write loop.
- 01
Source files
.tsx .vue .svelte .astro .htmlRepo stays single source.
- 02
Vite stamping
glideSourceStamping()Stamps file, line, column.
- 03
Browser canvas
127.0.0.1:5173/__glide/Sends loopback edit transaction.
- 04
Atomic write
SHA-256 + temp renamePatches token; triggers HMR.
- 01
Session trust
Host + Origin + tokenBlocks untrusted origins and sockets.
- 02
Digest match
STALE_DIGESTRefuses externally edited files.
- 03
Node identity
STALE_NODEVerifies JSX hash before edits.
- 04
Exact AST edit
All or nothingRefuses spreads; leaves disk untouched.
Hand canvas selections to MCP.
Click any command or prompt to copy.
Install Glide's official AI agent skills and MCP server configuration in this project, then verify the setup so you can inspect live canvas selections and write Glide-safe source edits.
Follow these steps strictly in order:
1. Install all three official Glide skills (`glide`, `glide-component-segregator`, `glide-setup`):
- Run `npx -y @srivarsank/glide install-skills --agent all` from the project root.
- This writes `.agents/skills/` (Antigravity, Codex, Cursor, Windsurf), `.claude/skills/` (Claude Code), and `.cursor/rules/glide.mdc` (when Cursor config exists) with the latest skill files.
2. Register the Glide MCP stdio server for project coding agents:
- Run `npx -y @srivarsank/glide mcp install --agent all` to merge the `glide` server into `.mcp.json`, `.cursor/mcp.json`, and `.vscode/mcp.json` without overwriting existing servers.
- If OpenAI Codex CLI is available, also run `codex mcp add glide -- npx -y @srivarsank/glide mcp`.
3. Ensure `glide-components.json` is ignored in `.gitignore` (append if missing; never create `glide-components.json` manually).
4. Verify installation:
- Run `node .agents/skills/glide/scripts/verify-setup.mjs` and confirm `@srivarsank/glide`, `glideSourceStamping`, and installed skills pass.
- Confirm `.agents/skills/glide/SKILL.md`, `.agents/skills/glide-component-segregator/SKILL.md`, and `.agents/skills/glide-setup/SKILL.md` exist and MCP JSON configs parse cleanly.
5. Follow these operating rules on every UI task in this repo (read the installed `SKILL.md` files first):
- When Glide MCP tools are connected, call `get_guide` once, inspect canvas focus with `get_selection`, and apply changes through Glide MCP tools (`update_styles`, `set_text`, `insert_markup`, etc.) so edits follow project style conventions and join canvas undo history.
- Look up targets in `glide-components.json` or via `node .agents/skills/glide/scripts/query-components.mjs --name <Component>` instead of scanning the file tree.
- Edit only the requested property: keep responsive/state variants (`md:`, `hover:`), keep static classes and links literal so the canvas stays editable, never delete `{false && <... data-gl-workspace-id="...">}` pasteboard blocks, and instruct me to re-select on the canvas if `STALE_DIGEST` occurs.
6. Report installed skill paths, updated MCP config files, verifier output, and remind me to reload/restart the agent session so the Glide MCP tools connect.Install and configure Glide (@srivarsank/glide), the local code-native visual editor, in this project so live canvas edits write atomic AST diffs directly to source.
Follow these steps strictly in order:
1. Preflight checks:
- Run `node -v` and confirm Node.js >= 22.22.0.
- Inspect `package.json` to confirm this is a Vite-based project (Vite 6/7/8 with React, Vue, Svelte/SvelteKit, Astro, or plain Vite HTML). If it uses Webpack or Next.js, stop and report that Glide requires Vite.
- Detect the package manager from lockfiles (`pnpm-lock.yaml` -> pnpm, `yarn.lock` -> yarn, `bun.lock`/`bun.lockb` -> bun, otherwise npm).
2. Install `@srivarsank/glide` as a devDependency using the detected package manager (e.g. `npm install -D @srivarsank/glide`).
3. Register the Vite plugin without disturbing any existing configuration:
- Exact import: `import { glideSourceStamping } from '@srivarsank/glide/vite-plugin';` (never import `{ glide }`).
- In `vite.config.{ts,js,mjs,mts}`: append `glideSourceStamping()` to the existing `plugins` array while keeping all existing plugins (`react()`, `vue()`, `svelte()`, Tailwind, etc.) intact.
- In `astro.config.{mjs,ts,js}`: add `glideSourceStamping()` inside `vite: { plugins: [...] }`, preserving existing Vite plugins.
- Note: `glideSourceStamping()` is a dev-only no-op in production builds.
4. Update `.gitignore`: append `glide-components.json` if it is not already ignored.
5. Verify before reporting done:
- Confirm the config typechecks/parses cleanly and no existing options or plugins were removed.
- Start (or restart) the dev server and confirm terminal output includes `[Glide] Editor: http://127.0.0.1:<port>/__glide/`.
- Confirm `glide-components.json` is generated in the project root.
6. Report back with:
- Modified files (`package.json`, Vite/Astro config, `.gitignore`).
- Exact `http://127.0.0.1:<port>/__glide/` editor URL (remind me to use `127.0.0.1`, not `localhost`, for origin isolation).
- Quick verification step: select an element on the canvas, tweak one style, and confirm the source diff lands via HMR. If `/__glide/` cannot be served directly, provide the fallback `npx @srivarsank/glide <port>`.Common questions.
Direct answers on production output, AST safety, MCP agents, and open-source licensing.
Does Glide ship any runtime code or attributes to production?
No. glideSourceStamping() is a dev-only Vite plugin. Production builds emit zero data-gl-source attributes, zero bridge scripts, and zero editor assets.
Which frameworks and build tools does Glide support?
Glide works with Vite 6, 7, and 8 projects using React (JSX/TSX), Vue, Svelte, Astro, and plain HTML. JSX/TSX supports full style, text, and structural edits (insert, move, group, extract); Vue, Svelte, Astro, and HTML support class, inline style, and text edits. Webpack and Next.js are not supported.
Will Glide reformat my files or strip Tailwind variants like md: and hover:?
No. Glide splices only the edited token directly into your original source text so indentation, quotes, and comments stay untouched. For Tailwind, it replaces only the utility prefix in the active breakpoint or pseudo-state scope, preserving responsive variants, arbitrary values, and theme tokens.
Why does Glide refuse edits with STALE_DIGEST, STALE_NODE, or UNSUPPORTED_OPERATION?
Refusals are intentional safety gates so Glide never guesses in source code. STALE_DIGEST or STALE_NODE means the file changed externally after selection—re-select the element on the canvas. UNSUPPORTED_OPERATION means the target uses a computed binding (:class, class:list, {...spread}) or unsupported structural edit; edit that binding directly in source.
Why does the editor open on 127.0.0.1 instead of localhost?
For browser origin isolation. The editor serves on 127.0.0.1 while the preview iframe loads your app on localhost, preventing scripts running inside your app from reading the editor page or issuing write transactions.
How do Claude Code, Cursor, Antigravity, and Codex work with Glide?
Install Glide’s three bundled skills and register the stdio MCP server (14 tools including get_selection, get_source, update_styles, and insert_markup). Agents write through the same local transaction server, matching your style format and joining canvas undo history.
What is {false && <div data-gl-workspace-id="...">} in my JSX?
That is Glide’s pasteboard. Dragging an element off the canvas stores it as a non-rendering draft in source so you can drag it back later without losing JSX structure or styling. Do not delete it as dead code.
Is Glide free and open source? How can I contribute?
Yes. Glide is 100% open source under the Apache 2.0 license with no accounts, cloud sync, or telemetry. Pull requests for framework adapters, AST edge cases, canvas UX, docs, and tests are welcome on GitHub or via the Contact & Contribute page.
Open source. Built with contributors.
Apache 2.0 licensed. Star the repo, open an issue, or contribute adapters, AST fixes, and agent skills.
