360 Secure SkillHub
360 安全技能中心

Formatgate

FormatGate 以本地 HTTP 服务形式提供 JSON、YAML、TOML 之间的六种方向转换,接收内容文本与输入/输出格式标识,返回转换结果或错误信息;需要 Python 运行时并安装 FastAPI、uvicorn、pydantic、pyyaml,通过 curl 调用接口。

分类:效率
mirni
mirni
热度 31.83
最近更新 2026-05-11 17:42:41

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add mirni/formatgate
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
formatgate
description
Convert between JSON, YAML, and TOML formats. All 6 conversion directions supported. Round-trip safe. Useful for agents that receive data in one format and need it in another.
metadata
{"openclaw":{"emoji":"🔄","requires":{"bins":["python"]},"install":[{"id":"pip","kind":"uv","packages":["fastapi","uvicorn","pydantic","pyyaml"]}]}}

FormatGate

Convert data between JSON, YAML, and TOML.

Start the server

uvicorn formatgate.app:app --port 8008

Convert JSON to YAML

curl -s -X POST http://localhost:8008/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"content": "{\"name\": \"Alice\", \"age\": 30}", "input_format": "json", "output_format": "yaml"}' | jq -r '.result'

Convert YAML to JSON

echo "name: Alice" | curl -s -X POST http://localhost:8008/v1/convert \
  -H "Content-Type: application/json" \
  -d "{\"content\": $(cat - | jq -Rs), \"input_format\": \"yaml\", \"output_format\": \"json\"}" | jq -r '.result'

Returns success (true/false), result (converted content), and error (if conversion failed — e.g., invalid input).