Standalone SearXNG CLI for coding agents
AI-powered search for your terminal, code, and AI assistants
An AI-enhanced command-line interface, Python library, and MCP server for the SearXNG privacy-respecting metasearch engine. Research topics with AI assistance, search the web from your terminal, integrate into Python projects, or connect AI assistants with support for 180+ search engines.
🔍 CLI tool - Search from your terminal with AI-enhanced research capabilities
🤖 AI chat - Ask questions and get comprehensive research using 180+ search engines
🐍 Python library - Programmatic search and AI-powered content retrieval
🔌 MCP server - AI assistant integration with advanced research tools
📦 Standalone binaries - Pre-built executables for Linux and macOS
The recommended install path is to download the pre-built binary for your platform from the GitHub releases page.
The source install path has to build and vendor a pinned SearXNG wheel before
the CLI can run, so it is slower and more involved than a normal uv tool install. Use the binary unless you are developing the project or intentionally
updating the pinned upstream SearXNG version.
Release binaries are currently published for Linux and macOS. Windows binaries are disabled for now because the current pybin Windows package launcher is not native yet.
After downloading, make the binary executable and put it somewhere on your
PATH:
chmod +x searxng-ai-kit-* ./searxng-ai-kit-* --help
Use this path when you want to develop the project, inspect the vendored SearXNG build, or update the pinned SearXNG commit.
Prerequisites:
# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh git clone https://github.com/nikvdp/searxng-ai-kit cd searxng-ai-kit # Build the pinned SearXNG wheel and set up the local environment uv run python dev-setup.py # Install as a uv tool uv tool install . # Verify searxng --help
# Clone and set up for development git clone https://github.com/nikvdp/searxng-ai-kit cd searxng-ai-kit # Build SearXNG wheel, generate configs, sync dependencies python dev-setup.py # Test uv run searxng search "test" --engines duckduckgo
The build system automatically:
str | Exception)# Simple search with default engines searxng search "python tutorial" # Search with specific engines searxng search "machine learning" --engines duckduckgo,startpage # Search in specific category searxng search "neural networks" --category science
# List all available engines (compact overview) searxng engines # List common engines only (clean 4-column layout) searxng engines --common # List engines in specific category searxng engines --category general # List only common engines in a category searxng engines --category general --common # Search while disabling specific engines searxng search "web development" --disable google,bing
# Human-readable output (default) searxng search "AI research" # JSON output for scripting searxng search "data science" --format json # JSON output with specific engines searxng search "rust programming" --engines duckduckgo --format json > results.json
# Search with language preference searxng search "tutorial python" --lang fr # Search with safe search enabled searxng search "programming" --safe 1 # Search recent results only searxng search "tech news" --time week --category news # Search specific page searxng search "javascript" --page 2
# Fetch content from a single URL searxng fetch-urls "https://example.com" # Fetch content from multiple URLs in parallel searxng fetch-urls "https://site1.com" "https://site2.com" "https://site3.com" # Human-readable output (default) searxng fetch-urls "https://example.com" # JSON output for scripting searxng fetch-urls "https://docs.python.org" --format json > content.json # Control concurrency for rate limiting searxng fetch-urls url1 url2 url3 --concurrent 2
# List all search categories searxng categories # Get help for any command searxng search --help searxng engines --help
⭐ Most Popular:
duckduckgo - Privacy-focused searchstartpage - Google results without trackingbrave - Independent search indexgoogle - Google searchbing - Microsoft searchqwant - European search engine# Test categories listing uv run searxng categories # Or: searxng categories # Test clean engine listing (shows popular engines in 4 columns) uv run searxng engines --common # Or: searxng engines --common # Test engine overview (compact category summary) uv run searxng engines # Or: searxng engines # Test simple search uv run searxng search "test query" --engines duckduckgo # Or: searxng search "test query" --engines duckduckgo
# Test human-readable output uv run searxng search "python" --engines duckduckgo | head -20 # Or: searxng search "python" --engines duckduckgo | head -20 # Test JSON output uv run searxng search "programming" --engines duckduckgo --format json | jq . # Or: searxng search "programming" --engines duckduckgo --format json | jq .
# Test with multiple engines uv run searxng search "web development" --engines duckduckgo,startpage # Or: searxng search "web development" --engines duckduckgo,startpage # Test engine filtering uv run searxng search "javascript" --category general --disable google,bing # Or: searxng search "javascript" --category general --disable google,bing
# Test different categories uv run searxng search "machine learning" --category science --engines arxiv # Or: searxng search "machine learning" --category science --engines arxiv uv run searxng search "react tutorial" --category it --engines github # Or: searxng search "react tutorial" --category it --engines github uv run searxng search "funny cats" --category images --engines duckduckgo_images # Or: searxng search "funny cats" --category images --engines duckduckgo_images
To create a standalone executable:
# Sync development dependencies (includes PyInstaller) uv sync # Build with PyInstaller (no code signing) uv run pyinstaller searxng.spec # Test the executable ./dist/searxng --help ./dist/searxng search "test" --engines duckduckgo
For distribution on macOS, you can optionally enable code signing if you have a valid Developer ID certificate:
# Set environment variables for code signing export PYINSTALLER_CODESIGN_IDENTITY="Developer ID Application: Your Name" export PYINSTALLER_ENTITLEMENTS_FILE="entitlements.plist" # optional # Build with code signing uv run pyinstaller searxng.spec
Note: The executable may have some engine loading issues. The Python version is recommended for full functionality.
SearXNG AI Kit includes an AI assistant feature that combines web search capabilities with powerful language models. The assistant can perform parallel searches and fetch content from multiple URLs to provide comprehensive research and answers.
# Ask a question using the default model searxng ask "What are the latest developments in quantum computing?" # Use a model from the registry searxng ask "Research renewable energy trends" --model "opencode/big-pickle" # Use a LiteLLM model string directly searxng ask "Explain AI" --model "openai/gpt-4o-mini" # Get JSON output for programmatic use searxng ask "Compare Python vs JavaScript" --format json # Read prompt from stdin for longer questions echo "Analyze the current state of renewable energy adoption globally, including recent policy changes and technological breakthroughs" | searxng ask # Interactive stdin mode searxng ask # (then type your question and press Ctrl+D) # Pipe from file searxng ask < my_research_question.txt
# Start an interactive chat session (uses default model) searxng chat # Use a model from the registry searxng chat --model "opencode/glm-4.7" # Use a LiteLLM model string directly searxng chat --model "openai/gpt-4o-mini" # Use OpenRouter models searxng chat --model "openrouter/anthropic/claude-3.5-sonnet" # Use custom API endpoint searxng chat --base-url "https://api.openai.com/v1"
The chat command maintains conversation history and allows follow-up questions:
You: What's the weather like in Tokyo?
Assistant: [searches for current Tokyo weather information] You: How about tomorrow?
Assistant: [remembers we're discussing Tokyo weather and searches for tomorrow's forecast] You: What should I wear?
Assistant: [provides clothing recommendations based on the weather information from previous searches]
Chat Features:
o3) instead of generic "Assistant"exit, quit, bye, or press Ctrl+C to endChat History Location:
~/.local/share/searxng-ai-kit/chats/ (XDG Base Directory spec)chat-YYYY-MM-DD_HH-MM-SS-modelname.mdchat-2025-06-29_14-30-15-o3.mdSearXNG AI Kit uses a model registry to manage AI model configurations. Models from various providers can be imported and used with simple names.
# List all models in registry searxng models list # Show details for a specific model searxng models show "opencode/big-pickle"
# Set a default model (used when --model not specified) searxng models set-default "opencode/big-pickle" # Show current default searxng models set-default
If you use OpenCode, you can import your configured models:
# Preview what would be imported searxng models import opencode --dry-run # Import models from OpenCode config searxng models import opencode
This imports models from ~/.config/opencode/opencode.jsonc and ~/.local/share/opencode/auth.json.
# Use a model from the registry searxng ask "What is quantum computing?" --model "opencode/big-pickle" # Use with chat searxng chat --model "opencode/glm-4.7" # If default is set, just run without --model searxng ask "Explain machine learning"
The --model flag accepts:
opencode/big-pickle, cli-proxy-api/claude-sonnet-4openai/gpt-4o, anthropic/claude-3-5-sonnet# Add a model manually searxng models add "my-model" --type openai --model-id gpt-4o --api-key "sk-..." # Remove a model searxng models remove "my-model" # Edit models file directly searxng models edit
Models are stored in ~/.config/searxng/models.toml.
Set one of these environment variables (used when model doesn't have stored API key):
# OpenAI (recommended) export OPENAI_API_KEY="your-openai-key" # OpenRouter (access to many models) export OPENROUTER_API_KEY="your-openrouter-key" # Anthropic export ANTHROPIC_API_KEY="your-anthropic-key" # Google export GOOGLE_API_KEY="your-google-key"
OpenRouter provides access to many AI models through a single API. SearXNG Kit has native OpenRouter support:
# Set OpenRouter API key export OPENROUTER_API_KEY="your-openrouter-key" # Use OpenRouter models with native prefix searxng ask "Analyze market trends" --model "openrouter/openai/gpt-4o-mini" searxng ask "Technical research" --model "openrouter/anthropic/claude-3.5-sonnet" # Use custom base URL (alternative method) searxng ask "Question" --base-url "https://openrouter.ai/api/v1" --model "openai/gpt-4o-mini"
SearXNG AI Kit integrates with CLI Proxy API to provide access to multiple AI providers through their OAuth and subscription plans - no API keys needed! Use your existing Claude Pro, ChatGPT Plus, or Gemini Advanced subscriptions.
Download the latest release from GitHub:
# macOS (Apple Silicon) curl -L https://github.com/router-for-me/CLIProxyAPI/releases/latest/download/cli-proxy-api-darwin-arm64 -o cli-proxy-api chmod +x cli-proxy-api sudo mv cli-proxy-api /usr/local/bin/ # macOS (Intel) curl -L https://github.com/router-for-me/CLIProxyAPI/releases/latest/download/cli-proxy-api-darwin-amd64 -o cli-proxy-api chmod +x cli-proxy-api sudo mv cli-proxy-api /usr/local/bin/ # Linux (x64) curl -L https://github.com/router-for-me/CLIProxyAPI/releases/latest/download/cli-proxy-api-linux-amd64 -o cli-proxy-api chmod +x cli-proxy-api sudo mv cli-proxy-api /usr/local/bin/
Or build from source: https://github.com/router-for-me/CLIProxyAPI