Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions plugins/Fectivnfy112357/searxng-search/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Fectivnfy112357

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
83 changes: 83 additions & 0 deletions plugins/Fectivnfy112357/searxng-search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# searxng-search

Search the web through **your own self-hosted SearXNG instance** with a
zero-dependency Python script: categories, engines, time range, language and
safe-search filters, plus bearer/basic auth and TOML or JSON config.

## The problem

Web search inside an agent usually means a vendor API with credentials and
quotas. If you already run SearXNG (a privacy-respecting metasearch engine),
this skill gives the agent a first-class search tool against it — one config
file, no vendor SDK, no tracking.

## Try it

Install from `/plugins` → **Local**, configure your instance, then ask:

```text
search the web for the latest SearXNG documentation
```

**Expected result**: a formatted list of results (title, URL, snippet) from
your SearXNG instance, filtered by the requested category / time range /
language.

Direct usage:

```text
python3 scripts/search.py -c news -t day "latest tech news"
python3 scripts/search.py -e google,duckduckgo -p 2 "rust programming"
python3 scripts/search.py -l zh-CN -n 10 "开源搜索引擎"
```

## Requirements

- A **self-hosted SearXNG instance** reachable over HTTP(S) — you provide it;
no public instance is bundled.
- Python 3.11+ (TOML config; legacy JSON config works on older Python).
- A config file at `~/.config/agents/searxng.toml` (or `$XDG_CONFIG_HOME`);
see `skills/searxng-search/references/configuration.md` for all fields.

## Data and network

This skill has **two levels of network destinations**; the difference matters.

### Direct destination (the script itself)

The script makes a single HTTPS (or loopback HTTP) request to **your
configured SearXNG instance** — the `base_url` in your config. The
script does not contact any other host. It never follows HTTP
redirects: a 30x response is an error, because following a redirect
could forward the Authorization header to an unexpected host. Point
`base_url` directly at the final endpoint.

### Downstream destinations (the SearXNG instance, not the script)

Your SearXNG instance then forwards the **query string**, **language
code**, and **selected categories** to the upstream **engines** it has
been configured with (Google, Bing, DuckDuckGo, Brave, Baidu, etc., as
enabled by the instance operator). Those engines receive the request
content from your instance — the script does not see or control that
hop.

**Practical implication:** anything you put in the search query
(personal context, project names, internal jargon) reaches the engines
your instance is configured to use. This is true of any SearXNG client,
not something this skill introduces. If that is a concern, configure
your instance to use only engines you trust, or self-host engines
locally.

### Credentials and config

- Credentials for your instance (bearer token / basic auth, if any) live
in your local config file. They are sent only to your instance — the
script never sends them anywhere else.
- Use `$ENV_VAR` references in the config instead of writing tokens in
plaintext, and `chmod 600` the file on POSIX systems. See
`skills/searxng-search/references/configuration.md`.
- No telemetry, no third-party services run by this script.

## License

MIT
12 changes: 12 additions & 0 deletions plugins/Fectivnfy112357/searxng-search/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "searxng-search",
"version": "1.0.0",
"description": "Search the web through your own self-hosted SearXNG instance: categories, engines, time range, language and safe-search filters via a zero-dependency Python script, with bearer/basic auth and TOML or JSON config. The script contacts only the configured SearXNG instance (HTTPS by default; HTTP only for loopback or explicit opt-in); the instance then forwards the query, language, and categories to its own configured upstream engines (Google, Bing, DuckDuckGo, etc., as enabled by the instance operator). No telemetry, no third-party services run by this script.",
"author": {
"name": "Fectivnfy112357",
"url": "https://github.com/Fectivnfy112357"
},
"license": "MIT",
"keywords": ["searxng", "search", "self-hosted", "privacy", "metasearch"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
101 changes: 101 additions & 0 deletions plugins/Fectivnfy112357/searxng-search/skills/searxng-search/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
name: searxng-search
description: "Search the web using a self-hosted SearXNG instance. Use when users ask to search with SearXNG, or when web search is needed and a SearXNG instance is configured. Supports categories, engines, time range, and language filters."
license: MIT
allowed-tools:
- Bash(python3 scripts/*)
---

# SearXNG Search Skill

Search the web using a SearXNG instance via its API.

## Network destinations

Two levels — both matter:

- **Direct (this script):** the script makes a single request to your
configured `base_url`. HTTPS by default; plain HTTP is allowed only
for loopback hosts (127.0.0.1, ::1, localhost) or for non-loopback
hosts if the config contains `allow_insecure_http = true` (with a
warning). If `auth.type` is set, the Authorization header travels to
that single host and nowhere else. **Redirects are never followed**: a
30x response is an error, because following a redirect could forward
the Authorization header to a host you did not configure. Point
`base_url` directly at the final endpoint (or front the instance
with a same-origin reverse proxy).
- **Downstream (your SearXNG instance):** the instance then forwards
the **query**, **language**, and **categories** to the engines it
itself has been configured with (Google, Bing, DuckDuckGo, Brave,
Baidu, etc., as enabled by the instance operator). This skill does
not control that hop — it is a property of any SearXNG client. If
query contents reaching the upstream engines is a concern, configure
your instance to use engines you trust, or self-host engines locally.

## Configuration issues

This skill depends on a local SearXNG config file. Keep setup details out of this
file and load [references/configuration.md](references/configuration.md) only when needed.

If `scripts/search.py` reports configuration, auth, or instance setup errors,
read [references/configuration.md](references/configuration.md) before retrying. Common examples include:

- `ERROR: Config file not found`
- `ERROR: Invalid TOML ...` / `ERROR: Invalid JSON ...`
- `ERROR: base_url is required`
- `ERROR: Environment variable ... is not set`
- `ERROR: auth.token required for bearer auth`
- `ERROR: auth.user and auth.pass required for basic auth`
- `ERROR: Unknown auth.type ...`
- `ERROR: HTTP 401` / `ERROR: HTTP 403`

## Usage

Run the search script:

```bash
python3 scripts/search.py [OPTIONS] <query>
```

### Options

| Flag | Description |
|---|---|
| `-c, --categories` | Comma-separated categories (`general`, `news`, `images`, `videos`, `music`, `files`, `it`, `science`, `social media`) |
| `-e, --engines` | Comma-separated engines (`google`, `duckduckgo`, `bing`, etc.) |
| `-l, --language` | Language code (`en`, `zh-CN`, `ja`, etc.) |
| `-p, --page` | Page number (default: 1) |
| `-t, --time-range` | Time range: `day`, `month`, `year` |
| `-n, --max-results` | Max results to show (overrides config default) |
| `-s, --safesearch` | Safe search: `0` (off), `1` (moderate), `2` (strict) |

### Examples

```bash
# Basic search
python3 scripts/search.py "SearXNG documentation"

# Search news from the last day
python3 scripts/search.py -c news -t day "latest tech news"

# Search with specific engines, page 2
python3 scripts/search.py -e google,duckduckgo -p 2 "rust programming"

# Search in Chinese with more results
python3 scripts/search.py -l zh-CN -n 10 "开源搜索引擎"
```

## Best Practices

- **Technical topics** (programming, software, science, IT, etc.): Always use **English** as both the query language and search language (`-l en`), regardless of the user's input language. Translate the query to English if needed. English results are more comprehensive and up-to-date for technical content.
- **Chinese lifestyle topics** (food, travel, shopping, local services, social trends, etc.): In addition to the default search, run a **second search** with `-e baidu,sogou -l zh-CN` using a Chinese query to capture China-specific results. Merge and deduplicate results before presenting to the user.

## Workflow

1. User asks to search for something
2. Determine the topic type:
- **Technical**: translate query to English if needed, search with `-l en`
- **Chinese lifestyle**: run the default search first, then an additional search with `-e baidu,sogou -l zh-CN`
3. Run `scripts/search.py` with the query and any relevant filters
4. Present results to the user in a readable format
5. If user wants more results, use `-p` for pagination or `-n` for more per page
Loading