定制 wzj177/geo-friendly 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wzj177/geo-friendly

Composer 安装命令:

composer require wzj177/geo-friendly

包简介

Generative Engine Optimization for PHP - Make your site discoverable by AI answer engines

README 文档

README

Latest Version PHP Version

Generative Engine Optimization (GEO) for PHP - Make your website discoverable by AI answer engines like ChatGPT, Claude, and Perplexity.

简体中文文档

What is GEO?

GEO (Generative Engine Optimization) optimizes content for AI-powered answer engines. This package generates standard files that AI engines use to understand and index your website.

Features

  • AI-Friendly Files: llms.txt, llms-full.txt, robots.txt, sitemap.xml, docs.json, ai-index.json, schema.json
  • CLI Tool: Simple command-line interface
  • Two Modes: Local markdown files OR Firecrawl API (for dynamic sites)
  • Content Arrays: Direct support for database-stored content
  • Platform Ready: WordPress, Shopify, Laravel, Symfony integrations

Requirements

  • PHP 7.4+
  • Composer
  • Extensions: json, simplexml, yaml

Installation

composer require wzj177/geo-friendly

Quick Start

Method 1: CLI Tool (Recommended for static sites)

# Create config file
vendor/bin/geo init

# Edit geofriendly.yaml, then generate
vendor/bin/geo generate

geofriendly.yaml:

title: 'My Site'
url: 'https://example.com'
contentDir: './content'  # Local markdown files
outDir: './public'

Method 2: Content Arrays (For database content)

use GeoFriendly\GeoFriendly;

$contents = [
    [
        'title' => 'Getting Started',
        'url' => '/getting-started',
        'content' => '# Getting Started\n\nThis is the content...',
        'description' => 'Learn how to get started',
        'category' => 'guide',
    ],
    [
        'title' => 'API Reference',
        'url' => '/api/reference',
        'content' => '# API Reference\n\n...',
        'description' => 'Complete API documentation',
        'category' => 'api',
    ],
];

$config = [
    'title' => 'My Documentation',
    'url' => 'https://docs.example.com',
    'outDir' => __DIR__ . '/public',
    'contents' => $contents,  // Pass content array
];

$geo = new GeoFriendly($config);
[$generated, $errors] = $geo->generate();

Method 3: Firecrawl (For any website)

title: 'My Store'
url: 'https://store.example.com'
contentDir: ''  # Empty = use Firecrawl
firecrawl:
  apiKey: 'your-api-key'
  enabled: true

Generated Files

File Purpose
llms.txt LLM discovery (per llms-txt.org)
llms-full.txt Complete documentation for AI training
robots.txt AI crawler permissions
sitemap.xml SEO sitemap
docs.json Structured documentation index
ai-index.json AI-optimized content index
schema.json Schema.org structured data

CLI Commands

vendor/bin/geo generate          # Generate all files
vendor/bin/geo init             # Create geofriendly.yaml
vendor/bin/geo check            # Audit GEO status
vendor/bin/geo report           # Generate detailed report

Content Array Format

When passing content from database:

$contents = [
    [
        'title' => string,        // Required: Page title
        'url' => string,          // Required: Page URL (e.g., '/getting-started')
        'content' => string,      // Required: Markdown content
        'description' => string,  // Optional: AI-friendly description (9-10 words)
        'category' => string,     // Optional: Content category
        'tags' => array,          // Optional: Content tags
    ],
    // ... more items
];

Usage Scenarios

1. Static Sites with Markdown (VitePress, Docusaurus, Hugo)

title: 'My Docs'
url: 'https://docs.example.com'
contentDir: './content'
firecrawl:
  enabled: false

Example: examples/vitepress-site

2. Dynamic Sites (WordPress, Shopify)

title: 'My WordPress Site'
url: 'https://mysite.com'
contentDir: ''
firecrawl:
  apiKey: '%env(FIRECRAWL_API_KEY)%'
  enabled: true

Example: examples/wordpress-firecrawl

3. Custom Backend (SaaS, Enterprise)

// Fetch from database
$contents = Content::where('status', 'published')
    ->get()
    ->map(fn($c) => [
        'title' => $c->title,
        'url' => $c->slug,
        'content' => $c->markdown_content,
        'description' => $c->description,
    ])
    ->toArray();

$config = [
    'title' => 'My Platform',
    'url' => 'https://app.example.com',
    'outDir' => storage_path('geo'),
    'contents' => $contents,
];

$geo = new GeoFriendly($config);
[$generated, $errors] = $geo->generate();

Full Guide: docs/generic-backend-solution.md

Documentation

License

MIT

wzj177/geo-friendly 适用场景与选型建议

wzj177/geo-friendly 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「geo」 「seo」 「ai」 「ChatGpt」 「llm」 「claude」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wzj177/geo-friendly 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wzj177/geo-friendly 我们能提供哪些服务?
定制开发 / 二次开发

基于 wzj177/geo-friendly 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 32
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-25