360 Secure SkillHub
360 安全技能中心

Confmt

该 Skill 提供 confmt 脚本,用于 JSON、TOML、.env 配置文件的格式化、压缩、排序、展平为点号键、转换为环境变量格式,以及比较两个配置文件差异;零第三方依赖,需通过 Python 运行。

rogue-agent1
rogue-agent1
热度 43.87
最近更新 2026-05-11 17:37:31
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add confmt
Metadata
name
confmt
description
Format, convert, flatten, and diff configuration files. Supports JSON, TOML (Python 3.11+), and .env formats. Use when asked to pretty-print a config, flatten nested JSON to dot-notation, convert JSON to env vars, diff two config files to find changes, or sort config keys. Handles JSON↔flat↔env conversion. Zero dependencies.

confmt 📝

Config file formatter, converter, and differ.

Commands

# Pretty-print JSON config
python3 scripts/confmt.py format config.json --sort

# Flatten nested config to dot-notation
cat config.json | python3 scripts/confmt.py format -o flat

# Convert JSON to .env format
python3 scripts/confmt.py format config.json -o env

# Compact/minify
python3 scripts/confmt.py format config.json --compact

# Diff two config files
python3 scripts/confmt.py diff prod.json staging.json

Formats

  • JSON — read/write, pretty or compact
  • TOML — read (Python 3.11+)
  • .env — read/write
  • flat — dot-notation output (key.subkey = value)

Diff Output

  • + added keys
  • - removed keys
  • ~ changed values