Quick Start

Quick Start

Get your first SEO analysis in under 5 minutes.

1. Analyze a Built Site

After building your site (e.g., npm run build):

# Analyze the dist folder bunx @capyseo/cli analyze ./dist

Example output:

/index.html Score: 85/100 [x] [meta-description] Missing meta description Add <meta name="description" content="..."> [!] [image-alt] Image missing alt: hero.jpg Add descriptive alt text [i] [open-graph] Missing og:image ================================================== Average Score: 85.0/100 Total Pages: 1 Total Issues: 3

2. Analyze a Live URL

bunx @capyseo/cli analyze https://example.com

This checks:

  • All pages linked from the homepage
  • Live link status (broken links)
  • Security headers
  • And all 46 SEO rules

3. Enable AI Suggestions

Get AI-generated fixes for missing meta descriptions and alt text:

# Set your API key export GEMINI_API_KEY=your_key_here # Run with AI bunx @capyseo/cli analyze ./dist --ai

With AI, you'll see:

[x] [meta-description] Missing meta description Add <meta name="description" content="..."> AI Suggestion: "Learn how to build modern web apps with our comprehensive guide covering React, Vue, and Svelte frameworks."

4. Output to JSON

bunx @capyseo/cli analyze ./dist --format json -o report.json

5. CI Mode

Fail the build if SEO score is too low:

bunx @capyseo/cli analyze ./dist --ci --min-score 80

Exit codes:

  • 0 - Score >= minimum
  • 10 - Score < minimum
  • 1 - Errors found (if failOn: ['error'] in config)

6. Generate SEO Assets

# Generate sitemap.xml bunx @capyseo/cli generate sitemap ./dist --origin https://mysite.com # Generate robots.txt bunx @capyseo/cli generate robots --sitemap https://mysite.com/sitemap.xml

7. Create a Config File

bunx @capyseo/cli init

This creates capyseo.config.js:

export default { rules: { 'meta-title': { severity: 'error' }, 'meta-description': { severity: 'error' }, 'image-alt': { severity: 'warning' }, // ... more rules }, ai: { enabled: true, model: 'gemini-2.5-flash', }, ci: { minScore: 80, failOn: ['error'], }, };

Common Workflows

Development Workflow

# Watch for changes bunx @capyseo/cli watch ./src --ai

Build Workflow

{ "scripts": { "build": "vite build", "postbuild": "capyseo analyze ./dist --ci --min-score 80" } }

CI/CD Workflow

- name: SEO Analysis run: bunx @capyseo/cli analyze ./dist --ci --min-score 80 --format sarif -o seo.sarif env: GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}

What's Next?