360 Secure SkillHub
360 安全技能中心

QR Code Generator

该技能通过 Python 的 qrcode 库(需 Pillow 支持)将用户提供的文本或网址渲染为高分辨率 PNG 二维码图片并保存到本地;未指定路径时默认保存为当前目录下的 qrcode.png,库缺失时可尝试用 pip 安装。

mrahil123
mrahil123
热度 87.22
最近更新 2026-05-17 12:44:32
分类:效率依赖:代码执行 / 读写文件应用场景:图像生成 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add qr-code-generator-skill
Metadata
name
qr-generator
description
A precision utility to generate QR code images from URLs or text using Python.
version
1.0.0
author
YourName
tags
["utility","images","tools","qr"]
metadata
{"openclaw":{"requires":{"bins":["python3"],"pip":["qrcode[pil]"]}}}

QR Code Generator Skill

This skill empowers the OpenClaw agent to generate and save QR code images locally.

Logic & Constraints

  • Library: Uses the qrcode Python library with Pillow (PIL) support.
  • Output Format: High-resolution PNG.
  • Default Path: If no path is specified, save to the current working directory as qrcode.png.
  • Error Handling: If qrcode is missing, the agent should first attempt pip install qrcode[pil].

Execution Instructions

When the user requests a QR code, execute a Python one-liner to perform the generation.

Implementation Template:

python3 -c "import qrcode; img = qrcode.QRCode(version=1, box_size=10, border=5); img.add_data('USER_TEXT_HERE'); img.make(fit=True); img.make_image(fill_color='black', back_color='white').save('FILE_NAME.png')"