site-index
v0.1.5
Published
CLI for generating sitemap and robots.txt artifacts from site-index modules.
Maintainers
Readme
site-index
CLI for creating site-index modules and generating/checking sitemap and robots.txt artifacts.
Install
npm install -D site-indexRequirements:
- Node.js
>=22
When to use
Use site-index when you want command-line workflows for:
- scaffolding
*.site-index.*modules - generating sitemap and robots.txt artifacts
- validating site-index modules in CI
When not to use
- Use
@site-index/vite-pluginfor Vite-native integration. - Use
@site-index/corefor custom programmatic pipelines.
Global options
--quiet: suppress informational output--verbose: enable verbose logging
Commands
make
site-index make <filePath> [--format <format>] [--force]Behavior:
- creates a new site-index module template
- supports
--format ts - supports
--format esm - defaults format to
ts - refuses to overwrite existing files unless
--forceis used - normalizes output filenames to:
<name>.site-index.ts<name>.site-index.mjs
build
site-index build --site-url <url> [--root <path>] [--out <dir>] [--config <path>]Behavior:
- generates site-index artifacts
- writes artifacts to
--out(default:dist) - requires
--site-url - validates
--site-urlas a valid URL - validates
--outresolves within--root - uses Vite config when
--configis provided --rootdefaults to current working directory--configmust resolve within--root
check
site-index check --site-url <url> [--root <path>] [--config <path>]Behavior:
- validates discovered site-index modules for CI
- requires
--site-url - fails when warnings are produced
- uses Vite config when
--configis provided --rootdefaults to current working directory--configmust resolve within--root
Examples
npx site-index make src/pages.site-index.ts --format ts
npx site-index make src/pages.site-index.mjs --format esm
npx site-index build --site-url https://example.com
npx site-index check --site-url https://example.comLocal monorepo development:
npm run cli -- build --site-url https://example.comHow it fits in the monorepo
site-index is the user-facing CLI package built on:
