carmelosantana/coqui-toolkit-pencil-dev
Composer 安装命令:
composer require carmelosantana/coqui-toolkit-pencil-dev
包简介
Pencil.dev design toolkit for Coqui — create, manipulate, and export .pen design files programmatically. Supports element CRUD, reusable components, design tokens, CSS variable sync, and code export (HTML/CSS, React, SVG).
README 文档
README
A Coqui toolkit for creating, manipulating, and exporting Pencil.dev design documents (.pen files). Provides direct JSON-based document manipulation with no API keys or running application needed.
Features
- Document management — create, read, list, validate
.penfiles - Element CRUD — insert, update, move, copy, delete design elements (rectangles, ellipses, text, frames, groups, etc.)
- Reusable components — mark elements as components, create instances with descendant overrides
- Design tokens — manage variables (color, number, string, boolean) with themed values
- CSS sync — import CSS custom properties into Pencil variables and export back
- Code export — generate HTML/CSS, React/Tailwind JSX, SVG, or raw JSON from designs
- Pencil CLI — check CLI status, run commands, generate batch configs
Installation
composer require coquibot/coqui-toolkit-pencil-dev
The toolkit is auto-discovered by Coqui via extra.php-agents.toolkits in composer.json. No additional configuration is needed.
Available Tools
| Tool | Description |
|---|---|
pencil_document |
Create, read, list, validate, and inspect .pen files |
pencil_design |
Insert, get, update, move, copy, and delete design elements |
pencil_component |
Create reusable components and instantiate them as ref elements |
pencil_variable |
Manage design variables (tokens), themes, and CSS import/export |
pencil_export |
Export designs to HTML/CSS, React/Tailwind, SVG, or JSON |
pencil_cli |
Check Pencil CLI status, run commands, generate batch configs |
Usage Examples
Create a Design
pencil_document(action: "create", path: "landing-page.pen", width: 1440, height: 900)
pencil_design(action: "insert", path: "landing-page.pen", type: "text", parent_id: "<frame_id>", properties: '{"content": "Hello World", "fontSize": 48, "fontWeight": 700}')
Build a Component Library
# Mark an element as a reusable component
pencil_component(action: "create", path: "design.pen", component_id: "<button_id>", name: "Primary Button")
# Create an instance with overrides
pencil_component(action: "instantiate", path: "design.pen", component_id: "<button_id>", descendants: '{"label_id": {"content": "Submit"}}')
Import CSS Variables
pencil_variable(action: "import_css", path: "design.pen", css: ":root { --primary: #3B82F6; --font-size-base: 16px; }")
Export to React
pencil_export(action: "react", path: "design.pen", component_name: "HeroSection", output_path: "HeroSection.jsx")
Export to HTML
pencil_export(action: "html", path: "design.pen", output_path: "preview.html")
Export to SVG
pencil_export(action: "svg", path: "design.pen", output_path: "icon.svg")
The .pen Format
A .pen file is a JSON document with this structure:
{
"version": "1",
"children": [
{
"id": "frame-1",
"type": "frame",
"width": 1440,
"height": 900,
"layout": "vertical",
"children": [...]
}
],
"variables": {
"primary": { "type": "color", "value": "#3B82F6" }
},
"themes": {
"mode": { "Light": true, "Dark": false }
}
}
Element Types
rectangle, ellipse, line, polygon, path, text, frame, group, ref, icon_font, note, prompt, context
Containers
frame and group can hold children. Frames support flexbox layout with layout, justifyContent, alignItems, gap, and padding.
Components
Any element with reusable: true is a component. ref elements are instances that reference a component and can override properties via descendants.
Variables
Design tokens stored in variables. Referenced in element properties with $variableName syntax. Support themed values.
MCP Live Preview
When Pencil desktop is running with its MCP server, use Coqui's mcp_client toolkit to access live preview and screenshot features:
batch_design— generate designs from promptsget_screenshot— capture design screenshotsget_variables/set_variables— live variable management
Development
# Install dependencies composer install # Run tests composer test # Static analysis composer analyse
License
MIT
carmelosantana/coqui-toolkit-pencil-dev 适用场景与选型建议
carmelosantana/coqui-toolkit-pencil-dev 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「toolkit」 「components」 「export」 「design」 「design-tokens」 「php-agents」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 carmelosantana/coqui-toolkit-pencil-dev 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 carmelosantana/coqui-toolkit-pencil-dev 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 carmelosantana/coqui-toolkit-pencil-dev 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bulk export of sylius resources
Yii2 export extension
Web Font Loader gives you added control when using linked fonts via @font-face.
Symfony2 Bundle that adds basic user account entity and city/state/country setup as well
A simple API extension for SplFileObject
Ariadne Component Library: xml writer and parser Component
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 41
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-08