Home · RSS · E-Mail · GitHub · GitLab · Mastodon · Twitter · LinkedIn

Introducing Confible

first published:

» Introduction

Many people backup and sync their configs by just copying the whole dotfiles. Unfortunately, I’m not a big fan of this because then I backup a lot of lines I do not care about. Usually, I do only add a few lines to a config so that it fits my preferences. Otherwise, I like using the default settings the tools come with. So, I tried to find a tool which would fit my preferences but was unlucky. Confible was born. It can adjust config files and execute commands. Check the repository for the latest version and readme.

It was already implemented more than a year ago, but I just decided to announce it on the blog today.

» README

Confible is a simple configuration tool for your local machine.

When configs are applied, a boundary header and footer are added which allows executing the configs multiple times or adjusting them and the target file will only contain the latest version of your desired configuration without the need of removing old modifications first.

» Installation

» Precompiled Binaries

See the releases page for precompiled binaries.

» Homebrew

Using the Homebrew package manager for macOS:

1
brew install sj14/tap/confible

» Manually

It’s also possible to install the latest release with go install:

1
go install github.com/sj14/confible

» Usage

1
confible [flags] <config.toml> [...]
1
2
3
4
5
Usage of confible:
  -no-cfg
        do not apply any configs
  -no-cmd
        do not exec any commands

» Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
[[commands]]
name = "test commands"
exec = [
    "echo yo", 
    "echo yoyo",
]

[[config]]
name = "modify vimrc"
path = "~/.vimrc"
comment_symbol = "\""
append = """
set number
syntax on
set ruler
filetype indent plugin on
"""

Beside the yo and yoyo outputs from the [[commands]] section, the [[config]] section will result into the below shown zshrc file.
Feel free to adjust the config and rerun confible for updating the zshrc to the latest version.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
...
content not handled by confible
...

" ~~~ CONFIBLE START ~~~
" Wed, 10 Mar 2021 22:10:04 CET
set number
syntax on
set ruler
filetype indent plugin on

" ~~~ CONFIBLE END ~~~

» Config Specification

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
[[commands]]
name = "test commands"
exec = [
    "echo yo", 
    "echo yoyo",
]

[[config]]
name = "adjust my config" # optional
path = "file/to/target"
truncate = false # enable for erasing target file beforehand (optional)
comment_symbol = "//" # symbol which is recognized as a comment by the target file
append = """
what you want to add
"""



Home · RSS · E-Mail · GitHub · GitLab · Mastodon · Twitter · LinkedIn