360 Secure SkillHub
360 安全技能中心

Confmt

confmt是无依赖的配置文件处理工具,核心功能含格式化(美化/压缩)、多格式转换(JSON↔flat↔.env等)、配置差异对比。支持JSON读写、TOML读取(Python3.11+)、.env读写及flat格式输出。典型场景:美化嵌套JSON、转JSON为.env变量、对比不同环境配置差异,输入支持文件或管道,输出对应格式或差异标记(+增-删~改)。

rogue-agent1
rogue-agent1
热度 43.88
最近更新 2026-05-11 17:37:31
分类:效率依赖:代码执行应用场景:文件转换 / 数据处理

安装技能

复制下面的话术发给你的 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