返回顶部
f

flashformat-local-converters本地格式转换

Provide five repository-local format conversion scripts (yaml-to-json, json-to-yaml, markdown-to-text, json-minify, yaml-auto-fix) for offline CLI and pipeline usage without running FlashFormat API. Use when users ask for local format conversion, batch processing, or CI-friendly text normalization.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
300
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

flashformat-local-converters

FlashFormat 本地转换器

概述

直接从 skills/flashformat-local-converters/scripts/ 下的 Python 脚本运行本地格式转换。
避免调用 /api/v2/*;在本地 shell、CI 或离线管道中执行转换。

快速开始

  1. 1. 安装运行时依赖:
python -m pip install PyYAML
  1. 2. 使用一个输入通道运行任意转换脚本:
--input 或 --input-file 或 stdin
  1. 3. 选择输出模式:
纯文本(默认)或 --json
  1. 4. 可选地将结果写入文件:
--output-file <路径>

脚本映射

  • - scripts/yamltojson.py:将 YAML 转换为 JSON,支持 --indent 和 --compact
  • scripts/jsontoyaml.py:将 JSON 转换为 YAML,支持 --sort-keys 和 --compact
  • scripts/markdowntotext.py:去除 Markdown 语法,提取可读文本
  • scripts/jsonminify.py:将 JSON 压缩为单行负载
  • scripts/yamlauto_fix.py:应用保守的 YAML 空白/缩进修复并验证

统一 CLI 约定

  • - 输入优先级:--input > --input-file > stdin
  • 输出目标:默认为 stdout,或使用 --output-file
  • JSON 模式负载:
{ok: true, tool: ..., output: ...} {ok: false, tool: ..., error: ...}
  • - 纯文本模式失败时,将错误文本写入 stderr 并返回非零退出码

使用示例

  • - YAML 转 JSON:
python skills/flashformat-local-converters/scripts/yamltojson.py --input-file in.yaml --output-file out.json
  • - JSON 转 YAML(键排序):
python skills/flashformat-local-converters/scripts/jsontoyaml.py --input {b:2,a:1} --sort-keys
  • - Markdown 转文本(stdin 管道):
cat draft.md | python skills/flashformat-local-converters/scripts/markdowntotext.py
  • - JSON 压缩并输出结构化结果:
python skills/flashformat-local-converters/scripts/json_minify.py --input-file data.json --json
  • - YAML 自动修复:
python skills/flashformat-local-converters/scripts/yamlautofix.py --input-file broken.yaml --indent-step 2 --fix-tabs --fix-odd-indent

参考

当需要精确的选项、错误消息和后端逻辑映射时,请阅读 references/io-contracts.md。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 flashformat-1776205034 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 flashformat-1776205034 技能

通过命令行安装

skillhub install flashformat-1776205034

下载

⬇ 下载 flashformat-local-converters v1.0.0(免费)

文件大小: 9.81 KB | 发布时间: 2026-4-15 12:14

v1.0.0 最新 2026-4-15 12:14
Initial release of flashformat-local-converters skill.

- Provides five standalone Python scripts for local format conversion: yaml-to-json, json-to-yaml, markdown-to-text, json-minify, and yaml-auto-fix.
- Designed for offline use, CI pipelines, or batch processing without relying on the FlashFormat API.
- Supports unified command-line options for flexible input and output handling.
- Implements both plain text and structured JSON output modes.
- Includes detailed usage instructions and script functionality map.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部