Confix is a configuration management tool that allows you to manage your configuration via CLI.
It is based on the CometBFT RFC 019.
Add Config Command
To add the confix tool, it's required to add the
ConfigCommand to your application's root command file (e.g.
Find the following line:
After that line, add the following:
ConfixCommand function builds the
config root command and is defined in the
confixCmd package (
An implementation example can be found in
The command will be available as
Using Confix Standalone
To use Confix standalone, without having to add it in your application, install it with the following command:
go install cosmossdk.io/tools/confix/cmd/confix@latest
Currently, due to the replace directive in the Confix go.mod, it is not possible to use
Building from source or importing in an application is required until that replace directive is removed.
Alternatively, for building from source, simply run
make confix. The binary will be located in
Use in simd:
simd config fix --help
Get a configuration value, e.g.:
simd config get app pruning # gets the value pruning from app.toml
simd config get client chain-id # gets the value chain-id from client.toml
confix get ~/.simapp/config/app.toml pruning # gets the value pruning from app.toml
confix get ~/.simapp/config/client.toml chain-id # gets the value chain-id from client.toml
Set a configuration value, e.g.:
simd config set app pruning "enabled" # sets the value pruning from app.toml
simd config set client chain-id "foo-1" # sets the value chain-id from client.toml
confix set ~/.simapp/config/app.toml pruning "enabled" # sets the value pruning from app.toml
confix set ~/.simapp/config/client.toml chain-id "foo-1" # sets the value chain-id from client.toml
Migrate a configuration file to a new version, e.g.:
simd config migrate v0.47 # migrates defaultHome/config/app.toml to the latest v0.47 config
confix migrate v0.47 ~/.simapp/config/app.toml # migrate ~/.simapp/config/app.toml to the latest v0.47 config
Get the diff between a given configuration file and the default configuration file, e.g.:
simd config diff v0.47 # gets the diff between defaultHome/config/app.toml and the latest v0.47 config
confix diff v0.47 ~/.simapp/config/app.toml # gets the diff between ~/.simapp/config/app.toml and the latest v0.47 config
At each SDK modification of the default configuration, add the default SDK config under
This allows users to use the tool standalone.
This project is based on the CometBFT RFC 019 and their own implementation of confix.