generate Commands

generate Commands

Generate SEO assets like sitemaps, robots.txt, and AI-powered meta tags.

Subcommands

Command Description
generate sitemap Generate sitemap.xml
generate robots Generate robots.txt
generate meta Generate meta tags with AI

generate sitemap

Crawl a site and generate a sitemap.xml file.

Usage

capyseo generate sitemap <target> [options]

Arguments

Argument Required Description
target Yes Directory or URL to crawl

Options

Option Type Default Description
--origin string - Site origin (required for directories)
-o, --output string ./sitemap.xml Output file path
--changefreq string weekly Default change frequency
--priority string 0.5 Default priority (0.0-1.0)

Examples

# From a built directory capyseo generate sitemap ./dist --origin https://example.com # From a live URL capyseo generate sitemap https://example.com # Custom output location capyseo generate sitemap ./dist --origin https://example.com -o ./public/sitemap.xml # Custom frequency and priority capyseo generate sitemap ./dist \ --origin https://example.com \ --changefreq daily \ --priority 0.8

Output

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/</loc> <changefreq>weekly</changefreq> <priority>0.5</priority> </url> <url> <loc>https://example.com/about</loc> <changefreq>weekly</changefreq> <priority>0.5</priority> </url> </urlset>

generate robots

Generate a robots.txt file with crawl rules.

Usage

capyseo generate robots [options]

Options

Option Type Default Description
--sitemap string - Sitemap URL to reference
--disallow string[] - Paths to disallow
--allow string[] - Paths to allow
--crawl-delay number - Crawl delay in seconds
-o, --output string ./robots.txt Output file path

Examples

# Basic with sitemap reference capyseo generate robots --sitemap https://example.com/sitemap.xml # With disallow rules capyseo generate robots \ --sitemap https://example.com/sitemap.xml \ --disallow /admin \ --disallow /api \ --disallow /*.pdf # With allow and crawl delay capyseo generate robots \ --sitemap https://example.com/sitemap.xml \ --allow /public \ --disallow /private \ --crawl-delay 1 # Custom output capyseo generate robots \ --sitemap https://example.com/sitemap.xml \ -o ./public/robots.txt

Output

User-agent: * Allow: /public Disallow: /admin Disallow: /api Disallow: /*.pdf Crawl-delay: 1 Sitemap: https://example.com/sitemap.xml

generate meta

Analyze a page and generate AI-powered meta tag suggestions.

Usage

capyseo generate meta <url> [options]

Arguments

Argument Required Description
url Yes URL to analyze

Options

Option Type Default Description
--title flag false Generate title only
--description flag false Generate description only
--all flag true Generate all suggestions

Requirements

Requires GEMINI_API_KEY environment variable.

Examples

# Set API key export GEMINI_API_KEY=your_key # Generate all suggestions capyseo generate meta https://example.com/page # Title only capyseo generate meta https://example.com --title # Description only capyseo generate meta https://example.com --description

Output

📝 Meta Tag Suggestions for https://example.com/page Title: "Getting Started with React - Complete Beginner's Guide" Description: "Learn React from scratch with this comprehensive guide. Covers components, hooks, state management, and best practices for building modern web applications." Primary Keyword: react tutorial Secondary Keywords: react hooks, react components, web development Readability Score: 72/100 Content Gaps: - Consider adding code examples - Include performance optimization tips - Add troubleshooting section

Integration Examples

Build Process

{ "scripts": { "build": "vite build", "postbuild": "npm run seo:assets", "seo:assets": "capyseo generate sitemap ./dist --origin https://mysite.com && capyseo generate robots --sitemap https://mysite.com/sitemap.xml -o ./dist/robots.txt" } }

CI Pipeline

- name: Build run: npm run build - name: Generate SEO Assets run: | npx @capyseo/cli generate sitemap ./dist --origin https://mysite.com -o ./dist/sitemap.xml npx @capyseo/cli generate robots --sitemap https://mysite.com/sitemap.xml -o ./dist/robots.txt - name: Deploy run: ...