Tools
Claw Search
Self-hosted private web search plugin for OpenClaw using SearXNG
Install
openclaw plugins install https://github.com/binglius/claw-search.git
Configuration Example
{
"plugins": {
"entries": {
"claw-search": {
"enabled": true,
"config": {
"baseUrl": "http://localhost:8888",
"maxResults": 10,
"language": "en",
"safesearch": 0,
"timeout": 15
}
}
}
}
}
README
# claw-search ๐ฆ๐
**Self-hosted private web search for OpenClaw**
[](CHANGELOG.md)
[](LICENSE)
[]()
[]()
A complete OpenClaw plugin that provides web search using your own SearXNG instance. Zero tracking, zero API costs, 100% private.
> **Latest:** v1.1.0 major refactoring - extensible architecture + 3 new search tools! See [CHANGELOG](CHANGELOG.md).
## โจ Features
### Search Tools (6 Total)
- ๐ **General search** - Web results from multiple search engines
- ๐ฐ **News search** - Time-filtered news articles
- ๐ผ๏ธ **Image search** - Find images with metadata
- ๐ฌ **Video search** - Search YouTube, Vimeo, and more (NEW!)
- ๐ป **Repository search** - Find code on GitHub, GitLab (NEW!)
- ๐ก **Quick answer** - Get direct answers to questions (NEW!)
### Core Benefits
- ๐ **100% Private** - Your SearXNG, your data
- ๐ฐ **Zero cost** - No API fees
- โก **Fast** - Localhost or self-hosted
- ๐ฏ **Native integration** - Works seamlessly with OpenClaw
- ๐๏ธ **Extensible** - Easy to add new search types
## Requirements
Before installing claw-search, you need:
1. **OpenClaw** installed and running
2. **SearXNG instance** running (provided setup script)
3. **Docker** (for SearXNG)
### Quick Setup (Recommended)
Use the provided deployment script:
```bash
git clone https://github.com/binglius/claw-search.git
cd claw-search
./deploy.sh
```
The script automatically:
- โ
Deploys SearXNG if not running
- โ
Configures JSON API
- โ
Installs the plugin
- โ
Restarts gateway
## Installation
### Quick Install
```bash
openclaw plugins install https://github.com/binglius/claw-search.git
```
### From Local Directory
```bash
git clone https://github.com/binglius/claw-search.git ~/claw-search
openclaw plugins install ~/claw-search
```
### Enable Plugin
```bash
openclaw plugins enable claw-search
openclaw gateway restart
```
## Configuration
The plugin works out-of-the-box with default settings. To customize, edit your OpenClaw config:
```json
{
"plugins": {
"entries": {
"claw-search": {
"enabled": true,
"config": {
"baseUrl": "http://localhost:8888",
"maxResults": 10,
"language": "en",
"safesearch": 0,
"timeout": 15
}
}
}
}
}
```
### Config Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `baseUrl` | string | `http://localhost:8888` | Your SearXNG instance URL |
| `maxResults` | number | `10` | Maximum results per search (1-100) |
| `language` | string | `en` | ISO 639-1 language code (en, zh, de, etc.) |
| `safesearch` | number | `0` | Safe search: 0=off, 1=moderate, 2=strict |
| `timeout` | number | `15` | Request timeout in seconds (5-60) |
## Usage
Once installed, just ask OpenClaw naturally:
- **"Search for quantum computing"** (uses `search`)
- **"Find recent AI news"** (uses `search_news`)
- **"Show me sunset pictures"** (uses `search_images`)
- **"Find Python tutorial videos"** (uses `search_videos`)
- **"Search for React repositories"** (uses `search_repos`)
- **"What is quantum computing?"** (uses `quick_answer`)
OpenClaw will automatically use the appropriate search tool!
## Tools Provided
The plugin registers **6 search tools**:
### 1. `search` ๐
General web search across multiple engines.
**Example queries:**
- "Search for OpenClaw documentation"
- "Find information about SearXNG"
- "Look up Python tutorials"
### 2. `search_news` ๐ฐ
Time-filtered news search.
**Example queries:**
- "Find latest AI news"
- "What's happening in quantum computing?"
- "Recent breakthroughs in medicine"
### 3. `search_images` ๐ผ๏ธ
Image search with URLs and metadata.
**Example queries:**
- "Find sunset images"
- "Show me cat pictures"
- "Search for OpenClaw logo"
### 4. `search_videos` ๐ฌ NEW!
Search for videos from YouTube, Vimeo, and other platforms.
**Example queries:**
- "Find Python tutorial videos"
- "Search for quantum computing lectures"
- "Show me cooking videos"
### 5. `search_repos` ๐ป NEW!
Search code repositories on GitHub, GitLab, and other platforms.
**Example queries:**
- "Find React repositories"
- "Search for Python machine learning projects"
- "Look up Docker alternatives"
### 6. `quick_answer` ๐ก NEW!
Get direct answers to factual questions.
**Example queries:**
- "What is quantum computing?"
### 3. `search_images`
Image search with URLs and metadata.
**Example queries:**
- "Find sunset images"
- "Show me cat pictures"
- "Search for OpenClaw logo"
## ๐๏ธ Architecture
### v1.1.0 - Extensible Design
The plugin uses a **declarative configuration approach** for maximum extensibility:
```typescript
// Core: Generic search function (DRY principle)
async function performSearch(params) { ... }
// Factory: Create tools from config
function createSearchTool(config) { ... }
// Configuration: Easy to extend!
const searchTools = [
{ name: 'search', category: 'general', formatResult: ... },
{ name: 'search_news', category: 'news', formatResult: ... },
// Add new search type = just 5-10 lines!
];
```
### Benefits
- **Zero duplication** - All tools share the same search logic
- **Easy to extend** - New search types require only configuration
- **Consistent behavior** - All tools follow the same pattern
- **Easy to maintain** - Fix once, apply everywhere
### Adding New Search Types
Want to add music search? Just add a configuration object:
```typescript
{
name: 'search_music',
description: 'Search for music tracks and albums',
category: 'music',
formatResult: (result, idx) => `${idx + 1}. ๐ต ${result.title}\n...`
}
```
That's it! No need to copy-paste 60-70 lines of code.
## Requirements
### Must Have
1. **SearXNG instance** running (Docker or native)
2. **JSON API enabled** in SearXNG
3. **OpenClaw >= 2026.2.0**
### SearXNG Quick Setup
Don't have SearXNG? Here's a 2-minute setup:
```bash
# 1. Run SearXNG in Docker
docker run -d \
--name searxng \
--restart=always \
-p 8888:8080 \
searxng/searxng:latest
# 2. Enable JSON API
docker exec searxng sed -i '/formats:/,/- html/{s/- html/- html\n - json/}' /etc/searxng/settings.yml
docker restart searxng
# 3. Test it
curl "http://localhost:8888/search?q=test&format=json" | jq
```
Done! ๐
## Verification
### Check Plugin Status
```bash
# List all plugins
openclaw plugins list
# Check claw-search details
openclaw plugins info claw-search
```
Expected output:
```
claw-search
Self-hosted private web search using SearXNG
Status: loaded
Tools: search, search_news, search_images
Version: 1.0.0
```
### Test Search
Ask OpenClaw:
```
"Search for OpenClaw"
```
You should see formatted search results!
## Troubleshooting
### Plugin Not Loading
**Check installation:**
```bash
openclaw plugins list | grep claw-search
```
**Check for errors:**
```bash
openclaw plugins doctor
```
**Reinstall:**
```bash
openclaw plugins uninstall claw-search
openclaw plugins install ~/claw-search
openclaw gateway restart
```
### Search Fails
**1. Check SearXNG is running:**
```bash
curl http://localhost:8888
```
**2. Check JSON API:**
```bash
curl "http://localhost:8888/search?q=test&format=json" | jq
```
**3. Check baseUrl in config:**
```bash
openclaw config get plugins.entries.claw-search.config.baseUrl
```
**4. Check logs:**
```bash
openclaw logs | grep claw-search
```
### Connection Timeout
- Increase `timeout` in plugin config
- Check network connectivity to SearXNG
- Verify `baseUrl` is correct and accessible
### Empty Results
- Confirm SearXNG has search engines enabled
- Test URL directly in browser: `http://localhost:8888/search?q=test`
- Check SearXNG configuration and logs
## Privacy & Security
โ
**Self-hosted** - All queries to your SearXNG instance
โ
**No tracking** - Zero telemetry
โ
**No third-party APIs** - Complete independence
โ
**No API keys** - Nothing to leak
โ
**Full control** - Your infrastructure, your rules
## Comparison
| Feature | claw-search | Brave API | Google API |
|---------|-------------|-----------|------------|
| Privacy | โ
100% | โ ๏ธ Third-party | โ Tracked |
| Cost | โ
Free | โ $5/month | โ Pay per use |
| Rate Limits | โ
None | โ 2000/month | โ Limited |
| Self-hosted | โ
Yes | โ No | โ No |
| Setup | โก 5 min | ๐ Register | ๐ Register |
## Updates
### Update Plugin
```bash
cd ~/claw-search
git pull
openclaw plugins install .
openclaw gateway restart
```
### Update SearXNG
```bash
docker pull searxng/searxng:latest
docker stop searxng
docker rm searxng
# Re-run docker run command from setup
```
## Uninstall
```bash
openclaw plugins uninstall claw-search
openclaw gateway restart
```
## Project Structure
```
claw-search/
โโโ package.json # NPM manifest
โโโ openclaw.plugin.json # Plugin manifest with config schema
โโโ index.js # Plugin implementation (3 tools)
โโโ SKILL.md # Agent documentation
โโโ README.md # This file
โโโ QUICKSTART.md # Quick start guide
โโโ LICENSE # MIT License
โโโ .gitignore # Git ignore rules
```
## Development
### Local Testing
```bash
# Install from local directory
openclaw plugins install ~/claw-search
# Check it loaded
openclaw plugins list | grep claw-search
# View tools
openclaw plugins info claw-search
# Test with OpenClaw
# Just ask to search for something!
```
### Plugin Architecture
The plugin exports a default function that receives the OpenClaw API:
```javascript
export default function (api) {
// Register tools
api.registerTool({
name: 'search',
description: '...',
parameters: { /* JSON Schema */ },
async execute(_id, params) {
// Tool implementation
return { content: [{ type: 'text', text: '...' }]
... (truncated)
tools
Comments
Sign in to leave a comment