CLI

indxel init

Scaffold SEO configuration files in your Next.js project.

Usage

bash
npx indxel-cli init [--hook] [--force] [--cwd <path>]

What it does

Detects your Next.js project structure and generates:

  • seo.config.ts — Site-wide SEO defaults using defineSEO()
  • sitemap.ts — Next.js App Router sitemap configuration
  • robots.ts — Next.js App Router robots configuration

Flags

ParameterTypeDescription
--hookbooleanInstall a git pre-push hook that runs `indxel check --ci` before every push
--forcebooleanOverwrite existing files without prompting
--cwd <path>stringSet the working directory (defaults to current directory)

Example

Initialize with git hookbash
$ npx indxel-cli init --hook

  ✓ Detected Next.js 15 (App Router)
  ✓ Created seo.config.ts
  ✓ Created app/sitemap.ts
  ✓ Created app/robots.ts
  ✓ Installed pre-push hook → indxel check --ci

  Done. Edit seo.config.ts to set your site name and URL.

Generated seo.config.ts

seo.config.tstypescript
import { defineSEO } from 'indxel'

export default defineSEO({
  siteName: 'My Site',
  siteUrl: 'https://example.com',
  titleTemplate: '%s | My Site',
  defaultDescription: 'Your site description here.',
  defaultOGImage: '/og-default.png',
  locale: 'en_US',
  twitter: {
    handle: '@mysite',
    cardType: 'summary_large_image',
  },
})

Edit after init

The generated config uses placeholder values. Edit seo.config.ts to set your actual site name, URL, and social handles.