wzj177/geo-friendly
Composer 安装命令:
composer require wzj177/geo-friendly
包简介
Generative Engine Optimization for PHP - Make your site discoverable by AI answer engines
README 文档
README
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
- Content Modes - Local files vs Firecrawl
- AI Integration - OpenAI enhancement
- Backend Solution - Database integration
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wzj177/geo-friendly 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Show geo marker on a mapbox map
Show geo shape on a mapbox map with drawing capabilities
OpenAI 应用 ChatGPT
Help to manage meta data on Laravel Eloquent model
Statamic Fine Seo addon
T3AI – TYPO3 AI Integration Extension
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-25