AgentSkillsCN

url2qrcode

根据 URL 生成二维码。当用户希望将 URL、链接或网页地址转换为二维码图像时,可调用此技能。支持输出 PNG 格式,可自定义尺寸与颜色。

SKILL.md
--- frontmatter
name: url2qrcode
description: Generate QR codes from URLs. Use when the user wants to create a QR code image from a URL, link, or web address. Supports PNG output with customizable size and colors.

URL to QR Code Generator

Generate QR codes from URLs using Node.js.

Quick Start

bash
node /root/clawd/skills/url2qrcode/scripts/generate.js "https://example.com"

Usage

Basic Usage

bash
node scripts/generate.js <url> [output.png]

With Custom Output Path

bash
node scripts/generate.js "https://github.com" my-qrcode.png

Options (Environment Variables)

  • QR_SIZE - Width in pixels (default: 300)
  • QR_DARK - Dark color hex (default: #000000)
  • QR_LIGHT - Light color hex (default: #ffffff)

Example with custom size:

bash
QR_SIZE=500 node scripts/generate.js "https://example.com" large-qr.png

Output

  • Default output: qrcode.png in current directory
  • Returns the full path to the generated file

URL Validation

Valid URLs must:

  • Start with http://, https://, or ftp://
  • Not contain spaces

Dependencies

Uses qrcode npm package. Install if needed:

bash
npm install qrcode