Documentation
Complete reference for Spikes — feedback your AI agent can act on. CLI commands, widget configuration, and data formats.
Installation
Widget
Add a single script tag to your HTML file:
<script src="https://spikes.sh/widget.js"></script>
CLI — Install Script
Download and install the CLI with a single command:
curl -fsSL https://spikes.sh/install.sh | sh
CLI — Cargo
Or install via Cargo if you have Rust installed:
cargo install spikes
Quick Start
Get feedback on your mockups in under a minute:
# Inject widget into all HTML files in a directory
spikes inject ./mockups/
# Start local server
spikes serve
# → http://localhost:3847
# Share URL with reviewer, collect feedback, then:
spikes list # See all feedback
spikes list --rating no # Find problems
spikes hotspots # Most-spiked elements
spikes list --json | jq '...' # Feed to agents
Tip: First-time reviewers are prompted for their name. All spikes are tagged with reviewer identity.
CLI Commands
All commands support --json for machine-readable output, making Spikes perfect for scripting and AI agents.
init
Create a .spikes/ directory in the current project to store feedback data.
Creates .spikes/feedback.jsonl for storing spike data (one spike per line).
list
List all feedback with optional filtering.
- --json
- Output as JSON array
- --page <PAGE>
- Filter by page URL or filename
- --reviewer <NAME>
- Filter by reviewer name
- --rating <RATING>
- Filter by rating (love, like, meh, no)
- --type <TYPE>
- Filter by type (page, element)
# List all negative feedback
spikes list --rating no
# Get JSON for a specific page
spikes list --page index.html --json
show
Display details for a single spike.
- --json
- Output as JSON object
spikes show abc123xyz
export
Export all feedback in various formats for processing.
- --format <FORMAT>
- Output format: json, csv, jsonl (default: json)
- --output <FILE>
- Write to file instead of stdout
# Export as CSV for spreadsheets
spikes export --format csv --output feedback.csv
# Export as JSONL for streaming processing
spikes export --format jsonl
hotspots
Find elements with the most feedback — useful for identifying problem areas.
- --json
- Output as JSON array
- --limit <N>
- Number of hotspots to show (default: 10)
spikes hotspots --limit 5 --json
reviewers
List all reviewers who have submitted feedback.
- --json
- Output as JSON array
inject
Add the Spikes widget script to HTML files in a directory.
- --project <NAME>
- Set project key for grouping feedback
- --endpoint <URL>
- Set sync endpoint for multi-reviewer mode
- --recursive
- Process subdirectories
- --dry-run
- Show what would be changed without modifying files
# Add widget to all HTML files
spikes inject ./mockups/ --recursive
# Preview changes first
spikes inject ./mockups/ --dry-run
serve
Start a local development server for reviewing mockups.
- --port <PORT>
- Port to listen on (default: 3847)
- --dir <DIR>
- Directory to serve (default: current)
spikes serve --port 8080 --dir ./mockups/
deploy
Scaffold deployment configuration for your own backend.
- cloudflare
- Generate Cloudflare Worker + D1 scaffolding
# Generate Cloudflare Worker project
spikes deploy cloudflare
cd spikes-worker
npx wrangler deploy
pull / push
Sync feedback with a remote endpoint.
- --endpoint <URL>
- Remote endpoint URL (or use SPIKES_ENDPOINT env var)
# Fetch remote feedback
spikes pull --endpoint https://my-worker.workers.dev/spikes
# Upload local feedback
spikes push --endpoint https://my-worker.workers.dev/spikes
dashboard
Launch interactive TUI dashboard for browsing feedback.
Widget Configuration
Configure the widget with data attributes on the script tag:
<script
src="https://spikes.sh/widget.js"
data-project="my-project"
data-position="bottom-left"
data-color="#3498db"
data-endpoint="https://my-worker.workers.dev/spikes"
data-reviewer="alice"
></script>
| Attribute | Default | Description |
|---|---|---|
data-project |
hostname | Project key for grouping feedback across pages |
data-position |
bottom-right |
Button position: bottom-right, bottom-left, top-right, top-left |
data-color |
#e74c3c |
Button background color (any CSS color) |
data-endpoint |
— | POST endpoint for multi-reviewer sync. When set, feedback is sent to this URL. |
data-reviewer |
— | Pre-set reviewer name (skip the name prompt) |
Data Format
Every spike follows this structure:
interface Spike {
id: string; // nanoid
type: "page" | "element";
projectKey: string;
page: string;
url: string;
reviewer: { id: string; name: string };
selector?: string; // Element spikes only
elementText?: string; // Element spikes only
boundingBox?: { x, y, width, height };
rating: "love" | "like" | "meh" | "no" | null;
comments: string;
timestamp: string; // ISO 8601
viewport: { width, height };
}
Storage: Feedback is stored in .spikes/feedback.jsonl — one spike per line in JSON Lines format.
Multi-Reviewer Sync
By default, feedback lives in each reviewer's browser (localStorage). For team reviews, deploy your own backend:
Deploy to Cloudflare
# Generate Cloudflare Worker scaffolding
spikes deploy cloudflare
# Deploy to your Cloudflare account
cd spikes-worker
npx wrangler deploy
Configure Widget
Add the endpoint to your widget configuration:
<script
src="https://spikes.sh/widget.js"
data-endpoint="https://your-worker.workers.dev/spikes"
></script>
Sync from CLI
Use pull and push to sync feedback between local storage and your remote endpoint:
# Fetch all remote feedback
spikes pull
# Upload local feedback
spikes push
Tip: Set the SPIKES_ENDPOINT environment variable to avoid passing --endpoint every time.