@shipseo/init
v0.1.0
Published
One-shot CLI that scaffolds SEO files (sitemap.ts, robots.ts, metadata) for AI-built Next.js projects
Downloads
142
Maintainers
Readme
@shipseo/init
One-shot CLI that seeds a Next.js 15 App Router project with the SEO files an AI-scaffolded starter usually forgets: app/sitemap.ts, app/robots.ts, and metadata inside app/layout.tsx.
Zero-config. Interactive. Backs up before it overwrites.
Usage
npx @shipseo/initRuns a short prompt, detects your framework, scaffolds the missing files, and prints a snippet for any file it doesn't own (like app/layout.tsx).
Flags
-f, --force Overwrite existing files (originals go to .shipseo-backup/)
-n, --dry-run Print what would change without writing anything
-y, --yes Skip prompts, take default answers
--sdk Use @shipseo/next dynamic metadata (default: static)
-h, --help Show help
-v, --version Show versionWhat it creates
| File | Content |
|---|---|
| app/sitemap.ts | Next.js sitemap route — serves /sitemap.xml with a BASE_URL from NEXT_PUBLIC_APP_URL |
| app/robots.ts | Next.js robots route — serves /robots.txt, points at the sitemap, disallows /api/ + /admin/ |
| app/layout.tsx | Only if missing. Minimal layout with metadata export |
If app/layout.tsx exists, the CLI:
- Detects whether you already export
metadataorgenerateMetadata - If yes → says "no changes needed"
- If no → prints a snippet you can paste (
--sdktoggles between static metadata and@shipseo/nextdynamic metadata)
We deliberately don't do AST surgery on your files — too many false positives on non-trivial layouts.
Idempotent by design
Run it twice, get the same result the second time. Existing files are skipped unless you pass --force, in which case the previous version is copied to <project>/.shipseo-backup/<name>.<ISO-timestamp>.bak before being overwritten. Nothing is ever destroyed.
Supported today
- Next.js 15 App Router (
app/at root or undersrc/)
Coming next:
- Next.js Pages Router
- Astro
- Nuxt
- SvelteKit
The CLI detects these frameworks today but exits early with a clear message + link to the roadmap.
After running
- Set
NEXT_PUBLIC_APP_URL=https://your-domain.comin.envso the sitemap/robots URLs are correct. - Optional: install
@shipseo/nextfor runtime-editable metadata + Core Web Vitals from real users.
License
MIT
