← 返回 Skills 市场
waldekmastykarz

jyml

作者 Waldek Mastykarz · GitHub ↗ · v0.2.0 · MIT-0
cross-platform ✓ 安全检测通过
104
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install jyml
功能描述
This skill should be used when the user asks to "convert YAML to JSON", "convert JSON to YAML", "transform YAML file", "transform JSON file", "convert config...
使用说明 (SKILL.md)

jyml - YAML ↔ JSON Converter

Zero-config CLI for converting between YAML and JSON formats. Pass a file, get the converted file. No flags required.

Prerequisites

Ensure jyml is available:

# Check if installed
which jyml

# Install globally if needed
npm install -g jyml

# Or use npx for one-off conversions
npx jyml \x3Cfile>

Requires Node.js 18 or later.

Basic Usage

jyml \x3Cfile> [options]

The CLI auto-detects the input format based on file extension and converts to the opposite format:

Input Extension Output Extension
.yaml, .yml .json
.json .yaml

Output is written to the same directory with the swapped extension.

Options

Option Description Default
-o, --output \x3Cpath> Custom output file path Input file with swapped extension
--json Print structured JSON to stdout (no file written)
--indent \x3Cn> Indentation spaces 2
-h, --help Show help
-V, --version Show version

Common Workflows

Convert a single file

# YAML to JSON
jyml config.yaml
# → writes config.json

# JSON to YAML
jyml settings.json
# → writes settings.yaml

Convert with custom output path

jyml docker-compose.yml -o ./output/docker-compose.json

Convert with custom indentation

jyml response.json --indent 4

Extract data programmatically

Use --json to get structured output for piping to other tools:

# Get parsed content
jyml workflow.yml --json | jq '.content'

# Extract specific values
jyml .github/workflows/ci.yml --json | jq '.content.jobs'

Batch conversion

Convert multiple files using shell patterns:

# Convert all YAML files in a directory
for f in configs/*.yaml; do jyml "$f"; done

# Convert all JSON files
for f in data/*.json; do jyml "$f"; done

Output Modes

Default mode (file output)

Writes converted content to a file, prints progress to stderr:

jyml config.yaml
# stderr: Converting config.yaml → config.json
# Creates: config.json

Structured mode (--json)

Prints structured JSON to stdout, no file written:

{
  "input": "/path/to/input.yaml",
  "format": "json",
  "output": "/path/to/input.json",
  "content": { ... }
}
Field Type Description
input string Absolute path to the source file
format string Output format: "json" or "yaml"
output string Path where the file would be written
content object The parsed and converted data

Exit Codes

Code Meaning
0 Success
1 Conversion error (invalid YAML/JSON, I/O failure)
2 Invalid usage (missing file, bad arguments, unsupported extension)

Error Handling

Errors are printed to stderr with actionable context:

Error: File not found: config.yaml
Error: Unsupported file extension ".txt". Supported: .yaml, .yml, .json
Error: Invalid YAML: bad indentation of a mapping entry (1:11)
Error: Invalid JSON: Expected property name or '}' in JSON at position 2

When conversion fails, check:

  1. File exists and is readable
  2. File extension is .yaml, .yml, or .json
  3. File contains valid YAML or JSON syntax

Use Cases

OpenAPI/Swagger specs

Convert specs between formats for different tools:

# Convert OpenAPI spec to JSON for code generators
jyml openapi.yaml

# Convert back to YAML for documentation
jyml openapi.json

Configuration files

Switch config formats based on tool requirements:

# ESLint config to YAML
jyml .eslintrc.json

# Docker Compose to JSON
jyml docker-compose.yml

GitHub Actions workflows

Parse workflow files for scripting:

# Extract job names from a workflow
jyml .github/workflows/ci.yml --json | jq '.content.jobs | keys'

API response inspection

Convert JSON responses to readable YAML:

curl -s https://api.example.com/data > response.json
jyml response.json --indent 4
cat response.yaml
安全使用建议
This skill appears safe for normal YAML/JSON conversion tasks. Before use, confirm you trust the external npm package and review the output path so it only creates or overwrites files you intend to convert.
功能分析
Type: OpenClaw Skill Name: jyml Version: 0.2.0 The skill bundle consists of metadata and documentation (SKILL.md) for a YAML/JSON conversion utility. It contains no executable code or scripts, focusing entirely on instructing the agent how to use an external CLI tool ('jyml') via standard npm commands. There are no signs of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
The stated purpose and instructions are coherent: the skill is for converting YAML files to JSON and JSON files to YAML.
Instruction Scope
The documented commands are user-directed conversion examples and stay within selected YAML/JSON files and output paths.
Install Mechanism
Although registry metadata lists no install spec or required binaries, SKILL.md instructs users to use npm/npx to obtain the jyml CLI; this is purpose-aligned but means external package code is not reviewed here.
Credentials
Local file reading and writing is proportionate for a file-format converter, and no credentials, network uploads, background services, or broad indexing are described.
Persistence & Privilege
The optional global npm install would persist a CLI on the user's system, but there is no evidence of hidden persistence, autostart behavior, or privilege escalation.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install jyml
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /jyml 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.0
- Added comprehensive usage documentation and examples in SKILL.md. - Listed prerequisites and installation methods for jyml. - Documented CLI syntax, options, workflows, output modes, error handling, and exit codes. - Provided real-world use cases for YAML ↔ JSON conversion, including config files, OpenAPI specs, and CI workflows. - Detailed structured output format for programmatic usage with tools like jq.
元数据
Slug jyml
版本 0.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

jyml 是什么?

This skill should be used when the user asks to "convert YAML to JSON", "convert JSON to YAML", "transform YAML file", "transform JSON file", "convert config... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 104 次。

如何安装 jyml?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install jyml」即可一键安装,无需额外配置。

jyml 是免费的吗?

是的,jyml 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

jyml 支持哪些平台?

jyml 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 jyml?

由 Waldek Mastykarz(@waldekmastykarz)开发并维护,当前版本 v0.2.0。

💬 留言讨论