indexnow-extension
v1.0.0
Published
IndexNow extension for Gemini CLI
Readme
IndexNow Extension
Extension to automate the IndexNow protocol (instant notification to Bing, Yandex, etc.) in AI tools like Gemini CLI and OpenCode.
Key Features
- Smart configuration: detects local IndexNow keys, generates new keys, creates
.txtvalidation file - Health check: tests if URLs are accessible (status 200) before sending
- Differential sending: compares sitemap with history and sends only new/modified URLs
- Sitemap discovery: automatically searches in
robots.txtand standard paths - Send history: tracks already sent URLs to avoid unnecessary resends
- Status dashboard: shows configuration summary, sent URLs, and pending ones
Installation
For OpenCode (Plugin)
Option 1: npx (easiest)
Run the installer directly:
npx indexnow-opencode-pluginOr from npm:
npm install indexnow-opencode-plugin
npx indexnow-installOption 2: Local files
Clone the repository and run the install script:
git clone https://github.com/your-user/indexnow-extension.git cd your-project ../indexnow-extension/install.shOr manually copy:
cp -r indexnow-extension/.opencode .Dependencies will be installed automatically by OpenCode.
Configure
opencode.jsonin your project root (the install script creates it):{ "$schema": "https://opencode.ai/config.json", "plugin": ["./.opencode/plugins/indexnow-plugin.ts"] }
For Gemini CLI (MCP Extension)
Copy the extension files to the Gemini CLI extensions directory.
Install dependencies:
npm installCompile the server:
npm run buildConfigure Gemini CLI to use the extension.
How to Use
In OpenCode
After installing the plugin, OpenCode will automatically load the IndexNow tools and slash commands.
Using slash commands:
/indexnow- Main command (asks what you want to do)/indexnow init- Configure IndexNow/indexnow submit <url>- Send a specific URL/indexnow sitemap [url]- Send URLs from a sitemap/indexnow status- Show status
Or talk directly to the AI:
Configure IndexNow:
Configure IndexNow for my domain example.comSend specific URL:
Send https://example.com/new-post to IndexNowSend all URLs from a sitemap:
Notify IndexNow about all URLs in https://example.com/sitemap.xmlCheck status:
Show IndexNow statusDifferential send (recommended):
Do differential send of sitemap https://example.com/sitemap.xml
In Gemini CLI
Use the /indexnow command with subcommands:
/indexnow init- Configure the extension/indexnow submit <url>- Send a URL/indexnow sitemap [url]- Send URLs from a sitemap/indexnow status- Show status/indexnow help- Show help
Available Tools
The plugin exposes the following tools for the AI:
Configuration
| Tool | Description |
|------|-------------|
| indexnow_get_config | Retrieves the current IndexNow configuration in the project |
| indexnow_save_config | Saves IndexNow configuration (.indexnow.json) |
| indexnow_verify_key | Performs local key verification (.txt) and remote (HTTPS) |
| indexnow_generate_key | Generates a new random 32-character hexadecimal key |
| indexnow_create_key_file | Creates the key file {key}.txt in the project root |
Analysis and Sending
| Tool | Description |
|------|-------------|
| indexnow_health_check | Checks if URLs are accessible (status 200-299) |
| indexnow_parse_sitemap | Parses an XML sitemap and extracts URLs |
| indexnow_discover_sitemap | Attempts to discover the sitemap URL for a host |
| indexnow_submit | Sends URLs to search engines via IndexNow |
| indexnow_submit_differential | Analyzes URLs, compares with history, and offers differential sending options |
History
| Tool | Description |
|------|-------------|
| indexnow_get_history | Queries which URLs have been notified and the last send timestamp |
Configuration Files
.indexnow.json: Project settings (Host, API Key, Sitemap URL).indexnow_history.json: History of sent URLs (URL → Timestamp)<key>.txt: Key validation file (must be hosted on the server)
How Differential Sending Works
- AI receives a list of URLs (e.g., from a sitemap)
- Consults local history (
.indexnow_history.json) - Compares and identifies new URLs vs already sent
- Presents options to the user:
- Send only new URLs (recommended)
- Send all (including already sent)
- Send only already sent (resend)
- Cancel
- After user choice, sends the selected list
- Updates history with sent URLs
Security
- Never include keys or tokens in code
- JSON configuration and history files should be ignored by Git
- Remote key validation via HTTPS to ensure server is configured
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Open a Pull Request
License
MIT
