HTTP bridge server for ABsmartly Extension to communicate with Claude Code CLI
npm install @absmartly/claude-code-bridgeHTTP bridge server that enables the ABsmartly Browser Extension to communicate with Claude Code CLI for AI-powered A/B testing features.
- Node.js 16+
- Claude Code CLI authenticated: npx @anthropic-ai/claude-code login
``bash`
npx @absmartly/claude-code-bridge
The server will start on http://localhost:3000 by default.
`bash`
npx @anthropic-ai/claude-code login
Follow the prompts to authenticate with your Claude subscription.
`bash`
npx @absmartly/claude-code-bridge
In the extension settings:
1. Select "Claude Subscription" as your AI provider
2. The extension will automatically connect to http://localhost:3000
`bash`
PORT=3001 npx @absmartly/claude-code-bridge
- GET /health - Health check and auth statusGET /auth/status
- - Claude CLI authentication statusPOST /conversations
- - Create new conversationPOST /conversations/:id/messages
- - Send message to ClaudeGET /conversations/:id/stream
- - Stream Claude responses (SSE)POST /conversations/:id/approve
- - Approve tool usePOST /conversations/:id/deny
- - Deny tool use
1. Authentication Check: Reads your Claude credentials from ~/.claude/.credentials.jsonnpx @anthropic-ai/claude-code --json
2. Claude CLI Spawn: Spawns subprocess
3. HTTP Bridge: Provides REST API for the browser extension to communicate
4. Message Forwarding: Routes messages between the extension and Claude CLI
5. Server-Sent Events: Streams Claude responses back to the extension in real-time
Run: npx @anthropic-ai/claude-code login
Either:
- Kill the existing process: pkill -f claude-code-bridgePORT=3001 npx @absmartly/claude-code-bridge
- Or use a different port:
- Ensure the bridge is running: http://localhost:3000/health` should return JSON
- Check the port matches in extension settings
- Restart the extension
MIT