confetti: A simple config file swapping tool

[ command-line-tools, library, mit, program ] [ Propose Tags ]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.3.1, 0.3.2, 1.0.0
Dependencies base (>=4.8 && <5), cmdargs, confetti, directory, filepath, MissingH, text (>=, time, unix, yaml [details]
License MIT
Author Avi Press
Category Command Line Tools
Home page
Bug tracker
Source repo head: git clone
Uploaded by aviaviavi at 2018-12-12T22:13:43Z
Distributions NixOS:1.0.0
Executables confetti
Downloads 1710 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-12-12 [all 1 reports]

Readme for confetti-1.0.0

[back to package description]


Build Status

Confetti is a tiny tool for managing different versions of a particular configuration file, and quickly swapping them.

Confetti is set up via a spec file, ~/.confetti.yml. You can specify one or more groups, each with one or more targets, which are the config files you wish to manage.

Suppose we have multiple AWS credential files we want to easily switch between (ie use various ~/.aws/credentials variants). To use confetti for this task, we'll put our different files in the target directory, ~/.aws, named ~/.aws/${variant-name}.credentials. We might have:


A simple example group specification in ~/confetti.yml might look like:

  - name: aws
      - /home/you/.aws/credentials

To switch to work.credentials simply run:

$ confetti [required group_name] [optional variant_name]


$ confetti aws work
> Setting aws to "work"
> ~/.aws/credentials -> ~/.aws/work.credentials
> Success (ノ◕ヮ◕)ノ*:・゚✧

As you can see from the example output, this will symlink ~/.aws/credentials -> ~/.aws/work.credentials. If the target file is not a symlink when you invoke confetti, a backup will be made before your variant file is linked. If you have multiple target files in your group, they will all be symlinked to their respective variants.

You can specify alternative search_paths for each group, and whether or not to search recursively. Adding a new group with this functionality could make our .confetti.yml look like:

  - name: aws
      - ~/.aws/credentials
  - name: dotfiles
      - ~/.spacemacs
      - ~/.vimrc
      - ~/.zshrc
      - ~/.zpreztorc
      - ~/.tmux.conf
      - ~/
      - path: ~/dotfiles
        recursive: true

This makes confetti a great tool for managing things like dotfiles, where the target config files are located in a github repo anywhere on the machine. Simply running: confetti dotfiles could link ~/.spacemacs -> the first .spacemacs found in a recursive search of ~/dotfiles. If your workflow involves regularly swapping any such files, the small amount of initial configuration can be well worth the cost!

One last feature is that you can specify a top level common section that will be applied to all other groups. For instance:

      - ~/dir/some.file
    - path: ~/some/directory
      recursive: false

Now, every group we try to use confetti for will also link ~/dir/some.file, and will also use /some/directory as a search path.



You can install with brew via:

$ brew tap aviaviavi/homebrew-tap
$ brew install aviaviavi/homebrew-tap/confetti


A linux binary can be found on the releases page.


You can install from source with stack.


Confetti does not currently work on Windows, as there is some reliance on POSIX for dealing with the file system. In theory it should be fairly straight-forward to get it working on Windows if anyone is up for implementing it. Feel encouraged to submit a PR or reach out for any related discussion.


Contributions in any form are welcome!

Future Features

  • Config groups should be able to source bash files or sets of environment variables.