materials-cli
Render JSON schemas to images and generate schemas from prompts using declare-render and AI.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cai-zhuo/test-materialsWhat This Skill Does
The materials-cli skill is a powerful command-line interface tool integrated into OpenClaw that serves as an bridge between structured data and visual output. It leverages the declare-render framework to transform JSON-based schema definitions into high-quality image files (PNG or JPG). Beyond simple rendering, the tool integrates AI capabilities to interpret natural-language descriptions, automatically generating valid JSON schemas that represent the requested visual elements, which are subsequently rendered into images. This skill is ideal for developers, designers, and automation engineers who need to programmatically generate UI components, diagrams, or visual assets based on underlying data structures.
Installation
To begin using the materials-cli skill, ensure your OpenClaw environment is properly configured. You can install the skill by executing the following command in your terminal:
clawhub install openclaw/skills/skills/cai-zhuo/test-materials
Once installed, you can access the command line interface directly using the materials command. It is recommended to install the package globally via npm install -g materials-cli to ensure the binaries are available in your path for seamless integration within your scripts.
Use Cases
- Automated Design Systems: Generate consistent visual assets from dynamic JSON configuration files, ensuring your UI elements are always in sync with your data layer.
- Rapid Prototyping: Use natural language to describe new visual components, allowing the AI to generate the necessary JSON schema, which you can then refine or render instantly.
- Schema Validation: Ensure your UI definitions adhere strictly to the declare-render specification before attempting to render them, preventing runtime errors in your automation pipeline.
- Dynamic Reporting: Turn analytical data formatted as JSON schemas into visual charts or diagrams for presentations and documentation.
Example Prompts
- "Render the file dashboard-stats.json as a 1920x1080 PNG image."
- "Generate a JSON schema for a blue rounded container with the text 'Welcome Back' centered in the middle, then render it to welcome.png."
- "Validate the schema file user-profile-card.json to check for formatting errors before I proceed with rendering."
Tips & Limitations
- AI Model Selection: The generate command supports custom OpenAI models. If you have specific design requirements, specify a more capable model using the
--modelflag. - Validation First: Always use the
validatecommand before rendering complex schemas to identify structure issues early. - Schema Complexity: While AI generation is robust, complex layered designs may require manual refinement of the generated JSON schema to achieve perfect pixel-alignment.
- Environment Variables: For security, avoid hardcoding your
OPENAI_API_KEY. Set it as an environment variable in your shell configuration instead.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cai-zhuo-test-materials": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, external-api
Related Skills
materials-workbench
Materials editor workbench — React UI and Express server to render JSON schemas to images and generate schemas with AI (declare-render + materials-agents).
materials-cli
Render JSON schemas to images and generate schemas from prompts using declare-render and AI.