AI-powered copy editing overlay for marketing sites. Hemingway discovers text elements on your page and generates alternative copy using Claude, with one-click replacement.
npm install hemingway-ainpx hemingway-ai initThis creates hemingway.config.mjs in your project root.
export ANTHROPIC_API_KEY=sk-ant-...Or paste it in Hemingway settings (bottom-left pill) and click Save.
It will be stored locally in .hemingway.local.json (gitignored).
npx hemingway-aiFor Next.js, you can skip this extra process by using the same-app route adapter.
Note: Hemingway reads process.env directly and does not auto-load .env files on its own.
Quick mode selection:
- Next.js App Router: use one-process mode (
hemingway-ai/next+<Hemingway endpoint="/api/hemingway" />) - Everything else: use standalone mode (
npx hemingway-ai+ script tag or<Hemingway />)
Script tag (any framework):
<script src="http://localhost:4800/client.js"></script>React component:
import { Hemingway } from 'hemingway-ai/react'
// Add inside your app (dev mode only)
<Hemingway />By default, the React wrapper tries same-app mode at /api/hemingway first, then falls back to http://localhost:4800.
React component (Next.js same-process mode):
import { Hemingway } from "hemingway-ai/react";
// Use Next route handlers under /api/hemingway/*
<Hemingway endpoint="/api/hemingway" />Press Cmd/Ctrl+Shift+H to toggle overlay mode on/off (or your configured shortcut).
/** @type {import('hemingway-ai').HemingwayConfig} */
const config = {
port: 4800,
model: 'claude-sonnet-4-6',
styleGuide: './docs/style-guide.md',
copyBible: './docs/copy-bible.md',
referenceGuide: './reference/saas-and-services-copy-guide.md',
sourcePatterns: [
'components/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
'src/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
'app/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
'pages/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
'content/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
'site/**/*.{tsx,jsx,ts,js,mdx,md,html,htm}',
],
excludePatterns: ['node_modules', '.next', 'dist', 'build'],
writeAdapter: 'react', // 'react' | 'generic'
shortcut: 'ctrl+shift+h',
notepadShortcut: 'alt+shift+h', // reserved; notepad UI is currently hidden
accentColor: '#3b82f6',
};
export default config;Next.js one-process note:
- Prefer a plain
export default { ... }hemingway.config.mjsobject. - If you need imported/computed config values, mirror them in
package.jsonunderhemingway.
- Click any text to get AI-generated copy alternatives
- Double-click for inline editing with source file writes
- Style guide aware — feed it your brand voice docs
- Framework agnostic — works with any dev server via script tag or React component
- Source mapping — writes changes back to your source files
- Docs Home
- Quickstart
- Integration Modes
- Framework Setup Guides
- Configuration Reference
- API Reference
- Troubleshooting
- Changelog
Detailed, agent-oriented system docs live in:
docs/reference/README.mddocs/reference/architecture.mddocs/reference/server-runtime.mddocs/reference/browser-overlay.mddocs/reference/copy-intelligence.mddocs/reference/operations-and-packaging.md
PolyForm Shield 1.0.0. See LICENSE.