Configureplus is a minimal autoconf-like configure tool that depends only on bash. It simplifies the process of managing project configurations across different platforms and environments.
- Cross-platform configuration management
- Session-based configurations
- Variable management with documentation support
- Multiple output formats (Makefile, Bash, JSON)
- Minimal dependencies (requires only bash)
- Automated configuration file generation
- Flexible and extensible
$ make
$ cd build
$ make
$ cd platform/darwin19
$ make install # for user profile installation
# OR
$ make install-systemwide # for system-wide installation$ make
$ cd build
$ make
$ cd platform/linux-gnu
$ make install # for user profile installation
# OR
$ make install-systemwide # for system-wide installationBasic usage:
$ configureplus <command> [args]Available commands:
man: Show the manual page (in markdown format)help <command>: Get help for a specific commandenv: Show environment variablesset <varname> <value>: Set a variable (for the current session or globally)get <varname>: Get a variable valuestatus: Show local/global configuration treelist: List local/global session paths
# Set a variable
$ configureplus set ALPHA 123
# Get a variable
$ configureplus get ALPHA
123
# Create a local session (ostype) SESSION var
$ configureplus get SESSION
# Fetch (create if not exists) a local session 'local1', SESSION var
$ CONFIGUREPLUS_SESSION=local1 configureplus get SESSION
# Update global session (ostype)
$ configureplus --globalThe get function in configureplus searches for variables in a specific order across local, session, and global directories. This allows for flexible configuration management with clear precedence rules.
When you use configureplus get <varname>, the tool searches for the variable in the following order:
-
Local Session:
$CONFIGUREPLUS_DIR_OUT_SESSIONS/$CONFIGUREPLUS_SESSION/<varname>- This is specific to the current working directory and session.
-
Global Session:
$CONFIGUREPLUS_DIR_CONFIG/$CONFIGUREPLUS_DIR_OUT_SESSIONS/$CONFIGUREPLUS_SESSION/<varname>- This is specific to the current session but applies across all directories.
-
Global Default:
$CONFIGUREPLUS_DIR_CONFIG/$CONFIGUREPLUS_DIR_OUT/global/<varname>- This is the fallback for all sessions and directories.
Let's say you're looking for the variable ALPHA:
$ configureplus get ALPHAThe tool will search in this order:
./.configureplus/session/current_session/ALPHA~/.config/configureplus/.configureplus/session/current_session/ALPHA~/.config/configureplus/.configureplus/global/ALPHA
It will return the value from the first location where the variable is found. If the variable is not found in any of these locations, it will return an empty result.
If you use the global flag:
$ configureplus get ALPHA globalThe tool will skip the local session search and only look in the global session and global default locations.
You can use the list command to see all available sessions:
$ configureplus listThis will show you:
- Global sessions in
~/.config/configureplus/.configureplus/session/ - Local sessions in the current directory's
.configureplus/session/(if it exists)
Understanding this search order helps you manage your configurations effectively across different scopes and sessions.
Configureplus generates several configuration files:
.configureplus/global.mk: Global Makefile include.configureplus/global.bash: Global Bash script (with exports).configureplus/global.bash_local: Global Bash script (without exports).configureplus/global.json: Global JSON configuration.configureplus/session/<session-id>.mk: Session-specific Makefile include.configureplus/session/<session-id>.bash: Session-specific Bash script (with exports).configureplus/session/<session-id>.bash_local: Session-specific Bash script (without exports).configureplus/session/<session-id>.json: Session-specific JSON configuration
Contributions are welcome! Please feel free to submit a Pull Request.
[Add your chosen license here]
Murat Uenalan murat.uenalan@gmail.com