Back to Home

Documentation

Everything you need to set up automated SEO content generation with the IndexYourNiche CLI.

Quick Start

Get started with IndexYourNiche in under a minute. This guide assumes you have Node.js 18+ installed.

Terminal
# 1. Get your API key from the dashboard
#    https://indexyourniche.com/dashboard/settings

# 2. Set your API key
export INDEXYOURNICHE_API_KEY=iyn_your_key_here

# 3. Initialize in your project
npx @indexyourniche/cli init

# 4. Scan your website
iyn scan

# 5. Discover topics
iyn topics --discover

# 6. Generate your first article
iyn generate

Tip: Use the -y flag for non-interactive mode, perfect for CI/CD pipelines and AI coding agents.

Installation

You can use the CLI directly with npx (recommended) or install it globally.

Using npx (Recommended)

npx @indexyourniche/cli init

Global Installation

npm install -g @indexyourniche/cli

# Now you can use 'iyn' directly
iyn --help

Supported Frameworks

The CLI automatically detects and configures for:

  • Next.js (App Router & Pages Router)
  • Remix
  • Astro
  • Nuxt
  • Any Node.js project with package.json

API Key Setup

You need an API key to use the CLI. Get one from your dashboard.

  1. Sign up at indexyourniche.com/signup
  2. Go to Dashboard → Settings → API Keys
  3. Click Generate New Key
  4. Copy the key (starts with iyn_)

Setting the API Key

Option 1: Environment variable (recommended)

# Add to your .env.local or shell profile
export INDEXYOURNICHE_API_KEY=iyn_your_key_here

Option 2: Inline with command

INDEXYOURNICHE_API_KEY=iyn_xxx npx @indexyourniche/cli init

iyn init

Initialize IndexYourNiche in your project. Creates a seo.config.json file and registers your website with the platform.

Usage
iyn init [options]

Options:
  -d, --domain <domain>      Website domain
  -n, --name <name>          Website name
  -l, --language <language>  Content language (default: en-US)
  -y, --yes                  Non-interactive mode (accept defaults)

Examples

# Interactive setup
iyn init

# Non-interactive setup
iyn init -y -d example.com -n "My Website"

# Specify language
iyn init -y -d example.com -l nl-NL

What it does

  • Detects your project framework (Next.js, Remix, etc.)
  • Finds existing Supabase and AI credentials in .env files
  • Creates seo.config.json with your settings
  • Registers your website with the IndexYourNiche platform

iyn scan

Analyze your website to understand your niche, content themes, and target keywords. This data is used to generate relevant topics.

Usage
iyn scan [options]

Options:
  -f, --force    Force a fresh scan (ignore cached results)

Output

The scan provides:

  • Niche Description: AI-generated summary of your website's focus
  • Content Themes: Main topics your website covers
  • Keywords: Target keywords for SEO optimization

iyn topics

Manage content topics. Discover new ideas with AI or list existing topics.

Usage
iyn topics [options]

Options:
  -d, --discover        Discover new topics using AI
  -c, --count <number>  Number of topics to discover (default: 10)
  -l, --list            List existing topics

Examples

# List all topics
iyn topics

# Discover 20 new topics
iyn topics --discover -c 20

# Add a specific topic manually
iyn topic:add "How to optimize Next.js for SEO"

iyn generate

Generate a GEO-optimized article from a topic. The article is automatically saved to your target database.

Usage
iyn generate [options]

Options:
  -t, --topic <topic>  Topic title or ID to use
  -y, --yes            Skip confirmation prompts

GEO Optimization

Generated articles include features optimized for AI search engines:

  • TL;DR: 50-75 word summary for quick AI extraction
  • FAQ Section: Structured Q&A with schema markup
  • Cited Statistics: Data points with sources
  • Expert Quotes: Attribution for credibility
  • JSON-LD Schema: Article and FAQ structured data

iyn blog

Scaffold blog pages in your project. Creates listing and article pages with GEO optimization built-in.

Usage
iyn blog [options]

Options:
  -p, --path <path>  Blog URL path (default: /blog)
  -y, --yes          Non-interactive mode

Generated Files

For Next.js App Router:

app/blog/
├── page.tsx        # Blog listing page
└── [slug]/
    └── page.tsx    # Individual article with GEO features

GEO Setup (robots.txt)

Generative Engine Optimization (GEO) is about making your content visible in AI-powered search engines like ChatGPT, Perplexity, Claude, and Gemini. A key step is configuring your robots.txt to explicitly allow AI crawlers.

Why this matters: Many AI companies only index sites that explicitly permit their bots. Without proper robots.txt configuration, your content may not appear in AI search results.

robots.txt Template for GEO

Add this to your public/robots.txt file:

public/robots.txt
# robots.txt - Optimized for SEO & GEO
# Allow all bots by default
User-agent: *
Allow: /

# AI / LLM Crawlers - Explicitly Allowed
# OpenAI (ChatGPT, GPT)
User-agent: GPTBot
Allow: /

User-agent: ChatGPT-User
Allow: /

# Anthropic (Claude)
User-agent: Claude-Web
Allow: /

User-agent: anthropic-ai
Allow: /

# Google AI (Gemini/Bard)
User-agent: Google-Extended
Allow: /

# Perplexity AI Search
User-agent: PerplexityBot
Allow: /

# Common Crawl (used by many AI companies)
User-agent: CCBot
Allow: /

# Meta AI
User-agent: FacebookBot
Allow: /

User-agent: meta-externalagent
Allow: /

# Amazon (Alexa, AI)
User-agent: Amazonbot
Allow: /

# Apple (Siri, Spotlight)
User-agent: Applebot
Allow: /

# Cohere AI
User-agent: cohere-ai
Allow: /

# You.com AI Search
User-agent: YouBot
Allow: /

# Sitemap
Sitemap: https://yourdomain.com/sitemap.xml

AI Bot Reference

Here are the main AI crawlers and what they're used for:

BotCompanyPurpose
GPTBotOpenAITraining & ChatGPT
ChatGPT-UserOpenAIChatGPT browsing
Claude-WebAnthropicClaude web search
Google-ExtendedGoogleGemini/Bard AI
PerplexityBotPerplexityAI search engine
CCBotCommon CrawlDataset for AI training

Pro tip: The setup prompt in your dashboard includes a ready-to-copy robots.txt template customized with your domain's sitemap URL.

AI Agent Integration

The CLI is designed to work seamlessly with AI coding agents like Claude Code, Cursor, Lovable, and Replit.

For Claude Code / Cursor

Just paste this prompt to your AI agent:

Set up IndexYourNiche SEO for my project.
My API key is iyn_xxx and my domain is example.com.

Run these commands:
1. INDEXYOURNICHE_API_KEY=iyn_xxx npx @indexyourniche/cli init -y -d example.com
2. iyn scan
3. iyn topics --discover -c 10
4. iyn blog -y

Non-Interactive Mode

All commands support the -y flag for non-interactive execution:

# Full autonomous setup
iyn init -y -d example.com
iyn scan
iyn topics --discover -c 20
iyn generate -y
iyn blog -y

Coming Soon: Native MCP (Model Context Protocol) integration for Claude Code will enable even deeper integration without command-line execution.

Configuration

The seo.config.json file stores your project settings.

seo.config.json
{
  "website": {
    "name": "My Website",
    "domain": "example.com",
    "language": "en-US",
    "author": "Team"
  },
  "target": {
    "supabaseUrl": "${NEXT_PUBLIC_SUPABASE_URL}",
    "supabaseServiceKey": "${SUPABASE_SERVICE_ROLE_KEY}"
  },
  "ai": {
    "provider": "anthropic",
    "apiKey": "${ANTHROPIC_API_KEY}"
  },
  "content": {
    "postingFrequency": 3,
    "autoGenerateTopics": false,
    "categories": ["general"]
  },
  "blog": {
    "path": "/blog",
    "productId": "example-com"
  },
  "_meta": {
    "websiteId": "uuid-here",
    "createdAt": "2024-01-01T00:00:00Z"
  }
}

Environment Variables

Values starting with ${...} are automatically interpolated from your environment.

Ready to get started?

Create your free account and start generating GEO-optimized content in minutes.