๐บ Watch the Tutorial Video - See InstantCode in action!
After installing the plugin, you can:
- Point directly at any element on your webapp
- Type a short request like "make it bigger", "center it", "change color to blue"
- Wait for AI to modify your code - it automatically finds and updates the source files
- See instant results - your changes appear immediately in the browser
No need to search through files or remember CSS properties - just point and tell!
InstantCode requires Claude Code to provide AI assistance:
# Install Claude Code globally
bun install -g @anthropic-ai/claude-code
# Verify installation
claude --version
The fastest way to get started is using our Vite plugin. This automatically handles everything for you!
npm install --save-dev instantcode
# or
bun add -d instantcode
# or
yarn add -D instantcode
Add the plugin to your vite.config.ts
or vite.config.js
:
import { defineConfig } from 'vite';
import inspectorPlugin from 'instantcode/vite-plugin';
export default defineConfig({
plugins: [
// Your existing plugins...
inspectorPlugin(),
],
});
npm run dev
# or
bun dev
# or
yarn dev
That's it! The InstantCode toolbar will automatically appear in your application.
The Vite plugin accepts these options:
inspectorPlugin({
port: 7318, // Port to run server on (default: 7318)
listenAddress: 'localhost', // Server binding address (default: 'localhost')
publicAddress: 'https://ai.example.com', // Public URL for reverse proxy (optional)
verbose: false, // Enable detailed logging (default: false)
mock: false, // Enable mock mode (default: false)
})
Basic Setup (default):
- Server listens on
localhost:7318
- Toolbar uses
http://localhost:7318
Reverse Proxy Setup:
inspectorPlugin({
listenAddress: 'localhost', // Server binds to localhost
publicAddress: 'https://ai.mysite.com' // Toolbar uses public URL
})
Listen on All Interfaces:
inspectorPlugin({
listenAddress: '0.0.0.0', // Allow external connections
port: 7318
})
Set mock: true
in the plugin options to develop UI without Claude Code installed or external calls. The server will stream a deterministic series of frames that mimic actual responses (including a sample "๐ข Vue component found" message). You can also enable mock mode via environment variable when running the standalone server:
INSTANTCODE_MOCK=true bunx instantcode
InstantCode works with all Vite-supported frameworks:
- โ๏ธ React - Detects components, props, and state
- ๐ข Vue - Understands composition/options API
๐ ฐ๏ธ Angular - Recognizes components and directives- ๐ Svelte - Identifies components and stores
- ๐ Vanilla JS - Works with plain HTML/CSS/JS
If you prefer manual control or aren't using Vite:
# Navigate to your project directory first (important for context!)
cd /path/to/your/project
# Start the server (basic)
bunx instantcode@latest
# With custom port
bunx instantcode --port 8080
# Listen on all interfaces
bunx instantcode --listen 0.0.0.0
# Use with reverse proxy
bunx instantcode --listen localhost --public-address https://ai.example.com
# Enable verbose logging
bunx instantcode --verbose
# Enable mock mode
bunx instantcode --mock
-p, --port <number>
- Port to run server on (default: 7318)-l, --listen <address>
- Address to bind server to (default: localhost)-a, --public-address <url>
- Public URL for reverse proxy scenarios-V, --verbose
- Enable verbose logging-m, --mock
- Enable mock mode (skip Claude Code)-h, --help
- Show help message-v, --version
- Show version
Add to your HTML:
<!-- Default setup -->
<script src="http://localhost:7318/inspector-toolbar.js"></script>
<!-- With custom port -->
<script src="http://localhost:8080/inspector-toolbar.js"></script>
<!-- With reverse proxy -->
<script src="https://ai.yourdomain.com/inspector-toolbar.js"></script>
- Make sure you're running
npm run dev
(or equivalent) - Check that InstantCode is in your
vite.config.ts
- Restart your dev server
- Check console for error messages
- Ensure Vite dev server is running
- Check browser console for errors
- Verify port 7318 isn't blocked
- Try refreshing the page
- Run from your project root - this gives AI better context
- Be specific about what you want to achieve
- Select the exact element you're asking about
- Try rephrasing your question
The server automatically checks port availability. If you see this error:
- Use a different port:
bunx instantcode --port 8080
- Stop any existing InstantCode servers
- Check what's using the port:
lsof -i :7318
- Kill the process or restart your machine
For production deployments behind nginx, Apache, or cloud load balancers:
# Server listens locally, toolbar uses public URL
bunx instantcode --listen localhost --public-address https://ai.yourdomain.com
Example nginx config:
location /instantcode/ {
proxy_pass http://localhost:7318/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
Happy coding! ๐ Frontend Context is here to make your web development journey smoother and more enjoyable.