ZFONT-CLI
从 zfont.cn 智能搜索、推荐并下载免费商用字体,支持递归解压字体包提取 TTF、OTF、TTC 格式文件并提供安装或传输方案。
Description
name: ZFONT-CLI version: 1.3.0 description: > 高级字体获取与部署技能。支持从 zfont.cn(免费商用字体网站) 智能搜索、推荐并安全下载字体。 具备递归解压能力,能自动剥离嵌套压缩包,提取 ttf, otf, ttc 核心资产, 并支持分支工作流:既可根据用户系统环境(macOS, Linux, Windows)提供安装引导,也可将提取后的纯净资产回传给用户。 triggers:
- "下载字体"
- "免费商用字体"
- "免费字体"
- "找字体"
- "找字体网"
actions:
动作 1:搜索字体并进行专业推荐
search_fonts:
description: "根据关键词搜索字体并结合详细介绍进行智能过滤推荐。"
parameters:
keyword:
type: string
required: true
execution:
type: http_request
method: POST
url: "https://zfont.cn/tools/openclaw/search/"
headers:
Accept: "application/json"
Content-Type: "application/json"
body:
s: "{{keyword}}"
response_handling:
instruction: >
解析返回的 JSON。
1. 告知用户 data.total 的总数。
2. 从 data.list 中挑选 2-4 个最佳匹配。充分利用 excerpt(详情介绍)和 postscript 信息:
- 提炼 excerpt 中的关键信息(如“由 Adobe 与 Google 联合推出”、“包含七种粗细”、“支持多种东亚语言”等)作为推荐理由。
- 优先推荐带有 VF (Variable Font) 标识的现代可变字体。
3. 列出推荐字体的名称、ID 及简短专业的推荐语,并询问用户要下载哪个 ID。
动作 2:获取带有鉴权 Token 的下载直链
get_font_download_url:
description: "获取选中字体的直链。"
parameters:
font_id:
type: integer
required: true
execution:
type: http_request
method: POST
url: "https://zfont.cn/tools/openclaw/down/"
headers:
Accept: "application/json"
Content-Type: "application/json"
body:
name: "Agent"
id: "{{font_id}}"
response_handling:
instruction: "解析到 data.url 和 data.name 后,自动触发 extract_and_prepare_font 动作。"
动作 3:下载、递归解压与格式嗅探
extract_and_prepare_font:
description: "下载字体包,递归处理内部嵌套压缩,提取可用字体格式。"
parameters:
download_url:
type: string
required: true
file_name:
type: string
required: true
execution:
type: shell_command
command: >
mkdir -p "/tmp/fonts_{{file_name}}" &&
wget -q -O "/tmp/fonts_{{file_name}}/main.zip" "{{download_url}}" &&
cd "/tmp/fonts_{{file_name}}" &&
while [ "find . -type f -name '*.zip' | wc -l" -gt 0 ]; do
find . -type f -name '.zip' -exec sh -c 'unzip -q -o "{}" -d "${0%.}" && rm "{}"' {} ; ;
done &&
find . -type f ( -iname *.ttf -o -iname *.otf -o -iname *.ttc )
response_handling:
instruction: >
解析标准输出(stdout)中找到的文件路径列表。
1. 告诉用户已成功清洗文件,并列出发现的所有字体格式(例如 TTF, OTF)。
2. 意图拦截检查:判断用户在先前的对话中是否明确说明了后续操作。
- 如果用户之前没有说明,询问用户:“清洗完毕。您是希望在当前系统安装部署,还是需要我将资产打包发送/提供下载给您?(默认提取 TTF 格式)”
3. 接收用户指令:
- 如果用户选择“安装”,调用 install_guidance_and_deploy 动作。
- 如果用户选择“发送/下载”,调用 send_font_to_user 动作。
动作 4:跨平台安装部署引导
install_guidance_and_deploy: description: "当用户选择安装时,执行或输出对应系统的安装指令。" parameters: selected_format: type: string description: "用户选择的格式,默认为 'ttf'" required: true font_dir: type: string description: "字体解压所在的工作目录" required: true execution: type: natural_language_generation response_handling: instruction: > 根据选定的格式 {{selected_format}}(默认 TTF),向用户提供多平台的安装方案。排版上请保持极客和开发者的阅读习惯:
🖥️ **macOS 环境部署**
直接在终端执行以下指令,将资产同步至用户字体库:
`cp {{font_dir}}/*.{{selected_format}} ~/Library/Fonts/`
🐧 **Linux 环境部署**
若在无头服务器或桌面 Linux 下,刷新字体缓存:
`mkdir -p ~/.local/share/fonts/`
`cp {{font_dir}}/*.{{selected_format}} ~/.local/share/fonts/`
`fc-cache -fv`
🪟 **Windows 环境部署**
- **GUI 方式**:选中解压目录的 `.{{selected_format}}` 文件,右键选择“为所有用户安装”。
- **PowerShell 方式**:
`Copy-Item -Path "{{font_dir}}\*.{{selected_format}}" -Destination "$env:USERPROFILE\AppData\Local\Microsoft\Windows\Fonts"`
动作 5:打包发送资产
send_font_to_user:
description: "当用户选择回传资产时,提供最终文件的获取方式。"
parameters:
selected_format:
type: string
description: "用户选择的格式,默认为 'ttf'"
required: true
font_dir:
type: string
description: "字体解压所在的工作目录"
required: true
execution:
type: natural_language_generation
response_handling:
instruction: >
告知用户字体提取完毕,目标格式为 {{selected_format}}。
1. 如果当前 OpenClaw 框架支持直接返回/发送文件,请调用系统自带的文件下发能力,将 {{font_dir}} 目录下匹配后缀的文件直接发给用户。
2. 补充终端回传方案,提供标准 scp 或 rsync 指令供极客用户手动拉取:
scp root@<Agent_IP>:{{font_dir}}/*.{{selected_format}} ~/Downloads/
Reviews (0)
No reviews yet. Be the first to review!
Comments (0)
No comments yet. Be the first to share your thoughts!