wuhhh/field-agent
Composer 安装命令:
composer require wuhhh/field-agent
包简介
An intelligent Craft CMS plugin for AI-powered field generation, modification, and context-aware operations
README 文档
README
⚠️ ALPHA SOFTWARE - USE WITH CAUTION ⚠️
This plugin uses AI to generate Craft CMS fields, entry types, and sections from natural language prompts. The plugin supports all native Craft CMS field types (as of Craft 5.8 and including the new Content Block) as well as CKEditor fields.
WARNING: This is an experimental plugin and you should not use it on production sites. Always backup your database before testing it.
Note: Rollback functionality currently only supports CREATE operations - field/entry type/section modifications and deletions cannot be rolled back.
Alpha Installation
This plugin is not yet available in the Craft Plugin Store. To install for testing:
composer require wuhhh/field-agent:v1.0.5-alpha
./craft plugin/install field-agent && ./craft plugin/enable field-agent
Configuration Setup
- Create config file - Copy the plugin's config file to your project:
cp vendor/wuhhh/field-agent/config/field-agent.php config/field-agent.php
- Add API key to
.env(you only need one):
# For Anthropic Claude (default) ANTHROPIC_API_KEY=sk-ant-your-key-here # OR for OpenAI (optional) OPENAI_API_KEY=sk-your-key-here
- Set default provider in
config/field-agent.phpif desired:
'defaultProvider' => 'anthropic', // or 'openai'
Test your setup:
./craft field-agent/generator/test-llm
Basic Usage
The plugin analyzes your existing Craft setup and creates or modifies fields/entry types/sections based on natural language prompts.
Main command:
./craft field-agent/generator/prompt "your description here"
Examples:
# Create new structures ./craft field-agent/generator/prompt "Create a portfolio section with project fields" # Modify existing structures ./craft field-agent/generator/prompt "Add author and featured image to blog posts"
The system will automatically:
- Analyse existing project structure
- Avoid naming conflicts with reserved Craft handles
- Reuse existing fields when appropriate
- Create fields, then entry types, then sections in proper order
Commands
Generation
# Main prompt command (uses your configured default provider) ./craft field-agent/generator/prompt "description" [--debug] # Override provider for single command ./craft field-agent/generator/prompt "description" openai # Debug mode (shows full AI request/response) ./craft field-agent/generator/prompt "description" --debug
Operation Management
# List all generation operations ./craft field-agent/generator/operations # Rollback specific operation by ID ./craft field-agent/generator/rollback <operation-id> # ⚠️ DESTRUCTIVE: Rollback ALL operations ./craft field-agent/generator/rollback-all # Clean up old data ./craft field-agent/generator/prune-all --confirm=1
Troubleshooting
API Issues
# Test your API connection ./craft field-agent/generator/test-llm --debug # Check environment variables are loaded ./craft field-agent/generator/test-llm
Common Problems
- 401 errors: Verify your API key is correct and has credits
- Field conflicts: System handles automatically, check operation history
- Operation failures: Use
--debugmode to see detailed error information
Debug Mode
Add --debug to see full AI request/response and operation details:
./craft field-agent/generator/prompt "create blog fields" --debug
What It Does
This plugin generates Craft CMS fields, entry types, and sections using AI from natural language descriptions. It analyzes your existing Craft setup to avoid conflicts and reuse appropriate fields.
Key capabilities:
- Understands all native Craft fields plus CKEditor
- Modifies existing entry types without breaking content
- Avoids reserved Craft handles and suggests alternatives
- Creates related structures (category groups, tag groups) automatically
- Provides complete rollback of all operations
Alpha Testing Notes
This is experimental software. It works well but may have edge cases. Please:
- Test on development sites only
- Backup your database before major operations
- Report issues at: https://github.com/wuhhh/field-agent/issues
- Use
--debugmode to understand what's happening
License
Proprietary - Commercial plugin for Craft CMS
wuhhh/field-agent 适用场景与选型建议
wuhhh/field-agent 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「Craft」 「ai」 「craftcms」 「craft-plugin」 「llm」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wuhhh/field-agent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wuhhh/field-agent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wuhhh/field-agent 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Expand, collapse, change the status of, or delete multiple blocks in a Matrix field simultaneously.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Integrate with Snipcart.
Restrict user registration by domain in Craft CMS, allows you to limit who can register for your site based on their email address.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2025-08-08