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/materials-cliWhat This Skill Does
The materials-cli skill is a powerful command-line tool designed for developers and designers who need to bridge the gap between structured JSON data and visual imagery. By utilizing the declare-render framework, this tool allows users to define complex visual layouts using simple, standard JSON schemas. It provides three primary functionalities: rendering static JSON schema files into high-quality PNG or JPG images, using OpenAI's AI capabilities to translate natural language prompts into valid rendering schemas, and ensuring the structural integrity of your JSON via a robust validation command.
Installation
You can easily integrate this tool into your OpenClaw environment by running the following command in your terminal:
clawhub install openclaw/skills/skills/cai-zhuo/materials-cli
Alternatively, for standalone system use, ensure you have Node.js installed and execute:
npm install -g materials-cli
Use Cases
- Automated Design Systems: Generate consistent image assets like badges, certificates, or social media cards dynamically from database entries.
- Rapid Prototyping: Describe a visual layout to an AI assistant and have it generate a renderable schema instantly.
- QA Testing: Validate your generated JSON schemas before pushing them to production rendering pipelines to catch errors in structure, layer hierarchy, or attribute types.
- Dynamic UI Generation: Use the CLI in CI/CD pipelines to auto-generate previews for UI components defined in code.
Example Prompts
- "materials-cli: Please render the schema located at ./assets/banner.json to an output file named landing-page.png with a width of 1200."
- "Generate a JSON schema for a blue square with the text 'Welcome Home' in the center, and save the result as welcome.png."
- "Can you validate the structure of config-schema.json to ensure it conforms to the declare-render format?"
Tips & Limitations
- Always validate your JSON files using the
validatecommand before running arendercommand to avoid silent failures or distorted images. - When using the
generatecommand, provide specific details like color codes, font sizes, and layer positions to get the most accurate results from the AI model. - Ensure your
OPENAI_API_KEYis set in your environment variables for seamless operation; otherwise, pass it explicitly as a flag. - Note that this tool creates local files, so ensure your environment has the necessary write permissions in the target directory.
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-materials-cli": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write, 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.