config editor · bash · runs anywhere

confix

A small, dependency-free bash script that edits configuration files in place with a tiny command grammar — update, add, comment, uncomment, or delete keys.

the tool
install

Grab the latest released script (branch-independent), make it executable:

curl -kL https://github.com/budhash/confix/releases/latest/download/confix > confix
chmod +x confix
options
  • -finput file (or -f - / omit to read stdin)
  • -ooutput file; -o- prints to stdout, leaving the input untouched
  • -ddry run — print a unified diff, write nothing
  • -eread commands from a file (one per line)
  • -sseparator character (default =)
  • -ccomment character (default #)
example
# update a port, enable a flag, comment one out, add a timeout
confix -f app.properties "port=9090" ">debug=true" "<log.level" ">timeout=30"
commands

Each argument (or each line of a -e file) is one command; the first character selects the operation. Key/value split on the first =, independent of the file separator.

key=valueupdate an existing key (no-op if the key is absent)
>key=valueset the key, appending it to the file if absent
>keyuncomment an existing key
<keycomment out an existing key (the line is kept)
!keydelete the key's line entirely (active or commented)

More examples and the full reference are in the README.

playground

Runs confix's command logic client-side — a JavaScript port of the bash script, validated against its output. Nothing is sent anywhere.

configpaste your file
commandsone per line · key=val · >key · >key=val · <key · !key
outputedited config