Confix is a configuration management tool that allows you to manage your configuration via CLI.
It is based on the CometBFT RFC 019.
Installation
Add Config Command
To add the confix tool, it’s required to add the ConfigCommand to your application’s root command file (e.g. <appd>/cmd/root.go).
Import the confixCmd package:
Inside your initRootCmd function, add the command to the root:
The ConfigCommand function builds the config root command and is defined in the confixcmd package (cosmossdk.io/tools/confix/cmd).
An implementation example can be found in simapp.
The command will be available as simd config.
Using confix directly in the application can have less features than using it standalone.
This is because confix is versioned with the SDK, while latest is the standalone version.
Using Confix Standalone
To use Confix standalone, without having to add it in your application, install it with the following command:
Alternatively, for building from source, simply run make confix. The binary will be located in tools/confix.
Usage
Use standalone:
Use in simd:
Get
Get a configuration value, e.g.:
Set
Set a configuration value, e.g.:
Migrate
Migrate a configuration file to a new version, config type defaults to app.toml, if you want to change it to client.toml, please indicate it by adding the optional parameter, e.g.:
Diff
Get the diff between a given configuration file and the default configuration file, e.g.:
View
View a configuration file, e.g:
Maintainer
At each SDK modification of the default configuration, add the default SDK config under data/vXX-app.toml.
This allows users to use the tool standalone.
Credits
This project is based on the CometBFT RFC 019 and their never released own implementation of confix.