tsbohc / umai

succeeded by hori-hori

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

umai

A .files management tool and a templating engine with a twist: there's no configuration file.

umai takes a template, renders it to a separate folder, and symlinks the result to the target location specified within the template itself.

umai is meant to be scripted and extended.

features

  • written in fennel, a lisp that compiles to lua
  • binary is a standalone lua script
  • nearly 0-config

usage

umai - .files management and templating

usage:
  umai [--varsets <path>] [-key val ...] - <template> ...

examples

# bashrc
umai!() {
  umai --varsets "~/.garden/etc/umai.d/" "$@" - \
       "$(find ~/.garden/etc -type f -name "*.umai")"
}
# ~/.garden/test.d/testrc.umai
{% softlink "~/.config/testrc.yml" %}
cyan: "#{% {{colo}.cyan} %}"
# ~/.garden/etc/umai.d/limestone
cyan: 87c0b0

After running umai! -colo limestone:

# ~/.config/testrc.yml
cyan: "#87c0b0"

scripting

Use umai interactively with fzf:

umai-fzf() {
  umai --varsets "~/.garden/etc/umai.d" "$@" - \
      "$(find ~/.garden/etc -type f -name '*.umai' | fzf)"
}

thanks

About

succeeded by hori-hori


Languages

Language:Lua 77.3%Language:Fennel 22.2%Language:Shell 0.5%