Files
wp-agentic-writer/downloads/README.md

5.1 KiB

Agentic Writer Local Backend

Run unlimited AI content generation on your own machine using your Claude CLI + Z.ai/Anthropic account.

Prerequisites

Before starting, ensure you have:

  • Claude CLI installed and configured
  • Node.js 18+ installed
  • Z.ai Coding Plan or Anthropic API key configured in Claude CLI

Quick Start

1. Extract Package

unzip agentic-writer-local-backend.zip
cd agentic-writer-local-backend

2. Start the Proxy

chmod +x *.sh
./start-proxy.sh

You'll see:

═══════════════════════════════════════════════════
✅ Local Backend Running!
═══════════════════════════════════════════════════

Your Configuration:
  Base URL: http://192.168.1.105:8080
  API Key:  dummy
  Model:    claude-local

3. Configure WordPress Plugin

  1. Open WP AdminAgentic WriterSettingsLocal Backend
  2. Paste the Base URL shown above
  3. API Key: dummy
  4. Click Test Connection → should show
  5. Start generating content!

Commands

./start-proxy.sh       # Start proxy (runs in background)
./stop-proxy.sh        # Stop proxy
./test-connection.sh   # Test if proxy responds
./get-local-ip.sh      # Find your local IP address
tail -f proxy.log      # View real-time logs

Firewall Setup

The proxy needs to accept connections from your WordPress site.

macOS

  1. System SettingsNetworkFirewall
  2. Click OptionsAdd → Select node
  3. Set to Allow incoming connections

Linux (ufw)

sudo ufw allow 8080/tcp
sudo ufw reload

Windows

  1. Windows Defender FirewallAdvanced Settings
  2. Inbound RulesNew Rule
  3. Port → TCP 8080Allow

How It Works

WordPress Plugin → HTTP POST → Local Proxy (port 8080)
                                     ↓
                               Spawns Claude CLI
                                     ↓
                            Returns AI Response

Benefits:

  • 🆓 Free: Uses your existing Z.ai/Anthropic subscription
  • 🔒 Private: Content never leaves your network
  • Fast: LAN latency (~50-200ms)
  • 🚀 Unlimited: No rate limits, no token counting

Troubleshooting

See TROUBLESHOOTING.md for detailed solutions.

Quick Fixes

"Connection failed" in plugin:

# Check proxy is running
ps aux | grep claude-proxy

# Restart if needed
./stop-proxy.sh && ./start-proxy.sh

"Claude CLI not found":

# Verify Claude is installed
which claude
claude --version

# Test Claude works
echo "Hello" | claude

"Wrong IP address":

# Find your correct IP
./get-local-ip.sh

# Or manually:
# macOS:   ipconfig getifaddr en0
# Linux:   ip route get 1 | awk '{print $7}'

Port 8080 already in use:

# Find what's using it
lsof -i :8080

# Change port (edit claude-proxy.js)
PORT=9000 node claude-proxy.js
# Update plugin Base URL to: http://your-ip:9000

Security Notes

  • Proxy binds to 0.0.0.0 (all network interfaces) for LAN access
  • No authentication by design (LAN trust model)
  • All request prompts are logged to proxy.log
  • For internet exposure, use ngrok/reverse proxy with authentication

Environment Variables

# Use different port (default: 8080)
PORT=9000 ./start-proxy.sh

# Production mode
NODE_ENV=production

# Brave Search API (for web search capability)
export BRAVE_SEARCH_API_KEY="your-brave-api-key"

To enable web search in your AI responses:

  1. Get a Brave Search API key from https://brave.com/search/api/

  2. Configure it in one of these ways:

Option 1: Add to .env file (recommended for this proxy)

echo 'BRAVE_SEARCH_API_KEY="BSA03Yj-your-key-here"' > .env

Option 2: Add to Claude Code settings Add to ~/.claude/settings.json:

{
  "env": {
    "BRAVE_SEARCH_API_KEY": "your-key-here"
  }
}

Option 3: Add to shell profile

export BRAVE_SEARCH_API_KEY="your-key-here"
  1. Restart the proxy:
./stop-proxy.sh && ./start-proxy.sh

When the proxy starts, you should see:

Brave Search:
  API Key:      CONFIGURED

Note: Web search must also be enabled in the WordPress plugin settings (Agentic Writer → Settings → General → Search → Enable). The plugin will automatically use search results when planning or researching topics.

Support

License

GPL-2.0+ - Same as WP Agentic Writer plugin