[ANN] bcfg, a Boringly Simple ConFiGuration format

I am pleased to announce the first release of bcfg, a tool and library for manipulating and generating configuration files in the Simple ConFiGuration file format (B stands for “boringly”). The bcfg project stems from Léo Andrès’s (@ancolie) scfg project (see [ANN] First release of scfg), but aims to go a step further:

  • it extends the syntax so that non-UTF-8 strings are accepted in a form similar to that specified in RFC822 (including folding-whitespace)
  • the dependency set has also been reduced to use only ocamllex instead of sedlex, which is perfectly capable of handling UTF-8 strings
  • the distribution includes a bcfgt library based on @dbuenzli’s jsont design and a draft implementation of @swrup on scfg
  • the tool has been extended to include a linter (allowing configuration files to be reformatted) as well as a “jq-style” query tool to extract information from an expression and a configuration file
  • the ability to stream serialisation and deserialisation (as can be done with XML and the SAX model)

The tools are also available on our apt.robur.coop repository via our reproducible infrastructure:

$ curl -fsSL https://apt.robur.coop/gpg.pub | gpg --dearmor > /usr/share/keyrings/apt.robur.coop.gpg
$ echo "deb [signed-by=/usr/share/keyrings/apt.robur.coop.gpg] https://apt.robur.coop debian-13 main" \
  | sudo tee /etc/apt/sources.list.d/robur.list
$ sudo apt update
$ sudo apt install bcfg

We recommend reading the bcfg documentation to learn more about this format, these libraries and these tools, in the hope that we might also resolve or further complicate the existential questions regarding the world’s best configuration format.

Do you have an example of that? I tried to look in the repository examples and tests, but I’m not 100% sure what to look for.

Oh yes, it seems it only existed in my head and on ocamllex, but here’s an example:

$ cat >foo.cfg<<EOF
> foo {
>   "\x00\
>    \x01"
> }
> EOF
$ bcfg validate foo.cfg

Another example is done here. It shows that the linter is able to use multi-lines for one value and correctly split it according to a margin.