Materials Cli
by @cai-zhuo
Render JSON schemas to images and generate schemas from prompts using declare-render and AI.
clawhub install materials-cliπ About This Skill
name: materials-cli description: Render JSON schemas to images and generate schemas from prompts using declare-render and AI. version: 1.0.8 metadata: clawdbot: requires: env: - OPENAI_API_KEY bins: - node primaryEnv: OPENAI_API_KEY
Materials CLI
Use this skill when the user wants to render JSON schemas to images (PNG/JPG), validate render-data schemas, or generate schemas from natural-language prompts and then render them.
Commands
When to use
Usage
Run via Node (from the project or after npm install -g materials-cli):
materials render [options]
materials generate "" [options]
materials validate [options]
Render
materials render schema.json -o output.png-s, --schema , -o, --output (default ./output.png), -f, --format , -w, --width, -h, --height, --output-schema , -i, --interactiveGenerate (AI)
materials generate "A red circle with text Hello" -o out.png-o, --output, -f, --format, -w, --width, -h, --height, --output-schema, --model, --api-key, --base-url, -i, --interactiveOPENAI_API_KEY (and optionally OPENAI_MODEL, OPENAI_BASE_URL) if not passed via flags.Validate
materials validate schema.json-s, --schema , -i, --interactiveCLI help
Usage: materials [options]Commands:
render Render a JSON schema file to an image
generate Use AI to generate a schema, then render
validate Validate a schema against the render data schema
Examples:
materials render schema.json -o output.png
materials generate "A red circle with text Hello"
materials validate schema.json
Schema format
The JSON schema follows the declare-render format: root has id, width, height, and layers. Layer types include text, image, and shape. Use materials validate to check a schema before rendering.
β‘ When to Use
π‘ Examples
Run via Node (from the project or after npm install -g materials-cli):
materials render [options]
materials generate "" [options]
materials validate [options]
Render
materials render schema.json -o output.png-s, --schema , -o, --output (default ./output.png), -f, --format , -w, --width, -h, --height, --output-schema , -i, --interactiveGenerate (AI)
materials generate "A red circle with text Hello" -o out.png-o, --output, -f, --format, -w, --width, -h, --height, --output-schema, --model, --api-key, --base-url, -i, --interactiveOPENAI_API_KEY (and optionally OPENAI_MODEL, OPENAI_BASE_URL) if not passed via flags.Validate
materials validate schema.json-s, --schema , -i, --interactive