Toml editor
npx -y skills add cbrunnkvist/agent-skills --skill toml-editorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Edit TOML files programmatically using yq, tmq, or toml-cli. Use when asked to edit .toml files, modify pyproject.toml, update pihole.toml, or any TOML operation. Triggers on "edit toml", "modify .toml", "toml file", "update pyproject.toml", "pihole.toml".
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.7 KB, as published. Nobody here has run it
TOML Editor
Edit .toml files without shell escaping issues. Three tools available:
| Tool | Lang | In-place | Pros | Reference |
|---|---|---|---|---|
| toml-cli | Rust | No (prints) | Format-preserving, comments intact | references/toml-cli.md |
| yq | Python | Yes (-i) | jq-like syntax, widely known | references/yq.md |
| tmq | Go | Yes | Zero-dependency binary, fast | references/tmq.md |
Recommendation: Prefer toml-cli for Pi-hole configs and other human-edited files where comment preservation matters. Prefer yq -t -i for automated transformations (CI, scripts). Pull the reference doc for your chosen tool above.
Installation (one-time)
# toml-cli — Rust
cargo install toml-cli
# or no-install: npx @toml-tools/editor set config.toml key "value"
# yq — Python
pip install yq
# or no-install: uvx yq -t -i '.key = "value"' config.toml
# tmq — Go
go install github.com/tmq/tmq@latest
Workflows
Adding a custom DNS record to Pi-hole v6
yq -t -i '.dns.hosts += ["10.13.37.180 myservice.lan"]' /etc/pihole/pihole.toml
pihole restartdns
Patching pyproject.toml
# Add a dependency
yq -t -i '.project.dependencies += ["httpx>=0.27"]' pyproject.toml
# Add optional dependency group
yq -t -i '.project.optional-dependencies.dev = ["pytest>=8"]' pyproject.toml
# Set Python version requirement
yq -t -i '.project.requires-python = ">=3.11"' pyproject.toml
Array append with toml-cli
toml get /etc/pihole/pihole.toml dns.hosts \
| python3 scripts/append-toml-array.py "10.13.37.180 radarr.lan" \
| toml set /etc/pihole/pihole.toml dns.hosts
Validation
python3 scripts/validate-toml.py file.toml
# or inline:
python3 -c "import tomllib; tomllib.load(open('file.toml','rb'))"
Safety
- Back up before bulk edits:
cp file.toml file.toml.bak - Validate after every edit
yqstrips comments and reorders keys — usetoml-cliwhen formatting matters- toml-cli has no
-i— pipe to temp file and rename - No tool does true inline editing — they rewrite the file. Use version control.