Download the PHP package indexnowkit/cli without Composer

On this page you can find all versions of the php package indexnowkit/cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cli

IndexNow command line — indexnowkit/cli

Tell Yandex, Bing, Naver and Seznam which URLs changed, from any host that has PHP and from any CI — no framework. One binary, indexnow: check the key file, submit URLs or a whole sitemap (only what is new or changed since the last run), keep the history. Cron on Bitrix, WordPress, MODX, OpenCart or Joomla; a deploy of Hugo, Astro or Jekyll; "just send these ten URLs". Three packagings of the same thing: a Composer package, indexnow.phar, the Docker image ghcr.io/indexnowkit/indexnow — and a GitHub Action on top of the image.

Packagist Downloads CI PHPStan PHP

github.com/indexnowkit/php (the php-* repositories are read-only splits)

Who gets notified

Yandex, Bing (and DuckDuckGo via Bing), Naver, Seznam, Yep, Internet Archive, Amazon — every engine in the IndexNow registry. One request to the shared endpoint reaches all of them; name engines explicitly (INDEXNOW_ENGINES=yandex,bing) only to reach a single one.

Google: no. Google does not support IndexNow; this tool will not pretend otherwise. IndexNow is a notification, not indexing: the engine decides whether and when to crawl.

Install

PHP 8.2+ with pdo_sqlite and xmlreader (the PHAR checks that before it runs; shared hosting without pdo_sqlite cannot keep the state file — --state memory runs without one). No ext-intl needed.

Quick start

…then one line in crontab — only what changed since the last run, whatever <lastmod> says:

Or ten URLs by hand: indexnow submit https://www.example.com/a /b /c.

Any CMS: Bitrix, WordPress, MODX, OpenCart, Joomla

The CLI needs two things every site has: the document root (for key:file) and a sitemap. Bitrix generates sitemap.xml and the index per information block with its own "Search engine optimization" module (since version 14); WordPress has one at /wp-sitemap.xml (5.5+) or from an SEO plugin; MODX (pdoTools, SEO Suite), OpenCart (a sitemap feed) and Joomla (an extension) likewise. Point INDEXNOW_SITEMAP_URL at it when it is not <base_url>/sitemap.xml, or give the file: indexnow sitemap /var/www/site/public/sitemap.xml reads it from disk. No PHP of the CMS runs; the CLI is a separate process on the same host.

Bitrix, step by step

On a BitrixVM the site lives in /home/bitrix/www (the other sites of a multi-site setup in /home/bitrix/ext_www/<site>) and the "Search engine optimization" module writes sitemap.xml right into that document root (Marketing → Search engine optimization → sitemap.xml settings; regenerate it there or by its agent). The CLI needs PHP 8.2+ on the command line — the PHP the VM menu selected.

The sitemap is read from disk, so nothing depends on the web server or on caching; only URLs the state file has not seen with this <lastmod> go out. Nothing is installed into Bitrix, no module, no agent: the CLI is a process of the bitrix user next to the site.

Static sites: on deploy

The GitHub Action indexnowkit/indexnow-action runs check and then sitemap --new-only from the image; the state file lives in .indexnow/ and is cached between runs:

Inputs, outputs and the step summary: docs/action.md. Any other CI runs the image the same way: docker run --rm -v "$PWD:/work" -e INDEXNOW_KEY -e INDEXNOW_BASE_URL ghcr.io/indexnowkit/indexnow sitemap --new-only (docs/docker.md).

The state file

.indexnow/state.sqlite in the working directory (--state, INDEXNOW_STATE), one sqlite file, created on first use in a 0700 directory: the debounce window (debounce.per_url, 10 minutes: a URL announced twice within it is sent once — --force overrides), the 403 counters per host, the submission history (history, status) and the fingerprints of the sitemap URLs announced so far (sitemap --new-only). Everything that makes a scheduled run idempotent, in one file that fits actions/cache; no backup needed (losing it costs one full re-announcement). --state memory keeps nothing between runs — a read-only container, a one-off --dry-run. check prints the state: line; details in docs/state.md.

Configuration

Environment first, file second. Every option of the core and of the three packages is one variable: INDEXNOW_<KEY> for the core (INDEXNOW_KEY, INDEXNOW_BASE_URL, INDEXNOW_ENGINES, INDEXNOW_DEBOUNCE_PER_URL, …), INDEXNOW_<BLOCK>_<KEY> for the blocks (INDEXNOW_SITEMAP_URL, INDEXNOW_SITEMAP_MAX_DEPTH, INDEXNOW_VERIFY_ENABLED, INDEXNOW_HISTORY_PDO_DSN). A .env in the working directory is read when it is there (--env-file, --no-env-file); the process environment wins over it. For the parts that are not one value (a hosts map with per-host key locations) a JSON file in the shape of Config::fromArray(): --config indexnow.json or INDEXNOW_CONFIG; the variables win over the file, INDEXNOW_HOSTS replaces its hosts map whole. Precedence: the command's options, the process environment, .env, --config, the defaults.

Two defaults are the CLI's: debounce.store is state (the state file; memory and none as everywhere) and history.store is pdo over the same file (INDEXNOW_HISTORY_STORE=none switches it off). dispatch is sync or none: a process has no queue. check warns about an INDEXNOW_* variable nothing reads. The tables: docs/configuration.md.

Commands

Command
check [--live] [--host=…] [--json] [--strict] [--sample=<url>] the configuration, the key file of every host over HTTP, the state file, the debounce store, sitemap spool, verify, history; --live sends one probe per engine; --sample fetches a page the way the pre-flight would (console, codes in the core's docs/check-codes.md)
config [--json] the effective configuration, keys masked, plus the cli block (which file, which state); what a bug report pastes
submit <url>… [--force] [--dry-run] [--json] URLs, or paths under base_url, now
sitemap [url|file] [--new-only] [--changed-since=…] [--dry-run] [--no-verify] [--json] the sitemap (index, gzip, text) in batches; --new-only only what the state file has not seen with this lastmod (sitemap)
key:generate [--write-env[=file]] [--force] a key; --write-env puts INDEXNOW_KEY= into .env (mode 0600; --force rotates, keeping the old key as INDEXNOW_PREVIOUS_KEY)
key:file <docroot> [--host=…] [--dry-run] <docroot>/<key>.txt for every configured host (and the previous key during a rotation), or the path key_location names; the one command that exists only here
history [--host=…] [--status=…] [--since=…] [--json] [--purge] what was sent, when, with what answer (history)
status [--json] switches, debounce store, 403 counters per host, the last successful submission, the history size

Global options: --env-file, --no-env-file, --config, --state, -v (the log on stderr). Exit codes: 0, 1 (an engine or the source failed), 2 (bad arguments; --new-only without a state, sitemap.enabled: false). --json keeps stdout machine-readable; the notes go to stderr.

Docker

ghcr.io/indexnowkit/indexnow:<version> (0.1, latest), php:8.3-cli-alpine plus the PHAR, runs as the user indexnow (uid 1000) in /work: mount the directory that holds .indexnow/ and the sitemap files there. The <version>-action tag is the same image without a user for the GitHub Action. docs/docker.md.

Limitations

Other packages

Package Framework
indexnowkit/symfony-bundle Symfony + Doctrine
indexnowkit/laravel Laravel
indexnowkit/yii2, indexnowkit/yii3 Yii
indexnowkit/core plain PHP, the library under all of them

A framework adapter submits the moment a model is committed; this CLI submits when it is run. On a host with a framework, prefer the adapter and use the CLI for what it adds (key:file on a bare host, a sitemap in cron).

Notes for AI assistants

Versioning

SemVer; until 1.0 minor versions may contain breaking changes, listed in CHANGELOG.md. What the compatibility promise covers — the commands, their options and the variables, not the classes: docs/bc.md.

MIT. IndexNow is a trademark of its owner; this project is independent and not affiliated with Microsoft, Yandex or indexnow.org.


All versions of cli with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-pdo Version *
ext-pdo_sqlite Version *
ext-xmlreader Version *
indexnowkit/console Version ^0.5
indexnowkit/core Version ^0.13.1
indexnowkit/history Version ^0.4
indexnowkit/sitemap Version ^0.9
indexnowkit/verify Version ^0.4
nyholm/psr7 Version ^1.8
psr/clock Version ^1.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/log Version ^2.0 || ^3.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
symfony/console Version ^6.4 || ^7.0 || ^8.0
symfony/dotenv Version ^6.4 || ^7.0 || ^8.0
symfony/http-client Version ^6.4 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package indexnowkit/cli contains the following files

Loading the files please wait ...