uplare 0.1.1

A CLI tool for keeping a system config up-to-date
uplare-0.1.1 is not a library.

Uplare

Easily and accurately keep track of installed software.

Installation

cargo install

cargo install uplare

cargo install from Git

cargo install --git https://github.com/nihaals/uplare

cargo binstall

cargo binstall uplare

GitHub Releases

There are pre-compiled binaries available with GitHub Releases. For example:

wget -O uplare "https://github.com/nihaals/uplare/releases/latest/download/uplare-cli-aarch64-apple-darwin"
chmod +x uplare
./uplare --help

Getting started

  1. Install pkl
  2. Create mac.pkl:
// Replace with version from `uplare --version`
amends "package://github.com/nihaals/uplare/releases/download/v0.0.0/uplare-pkl@0.0.0#/MacOs.pkl"

mac {
  installHomebrew = true
  apps = new {
    new ManualApp {
      name = "Wolfram"
      appPaths = new {
        "/Applications/Wolfram.app"
      }
    }
    new HomebrewCask {
      caskName = "visual-studio-code"
      appPaths = new {
        "/Applications/Visual Studio Code.app"
      }
    }
    new MacAppStoreApp {
      appStoreId = 497799835
      appPaths = new {
        "/Applications/Xcode.app"
      }
    }
  }
}
  1. Run pkl eval mac.pkl | uplare diff macos /dev/stdin
  2. Run uplare --help

Supported properties

While there's no official documentation site yet, you can refer to the Pkl module or the Rust serde types for the platform you are using. There are also Pkl examples.

Referencing Uplare in Pkl

You may prefer to create a PklProject so you can reference Uplare's Pkl modules more easily:

amends "pkl:Project"

dependencies {
  ["uplare"] {
    // Replace with version from `uplare --version`
    uri = "package://github.com/nihaals/uplare/releases/download/v0.0.0/uplare-pkl@0.0.0"
  }
}

Which can be referenced like so:

amends "@uplare/MacOs.pkl"

Note: You'll need to run pkl project resolve as suggested by Pkl before this works.

Running without Pkl

If you would like to run uplare on a system without pkl installed, you can run pkl eval on another machine and transfer the JSON. You can also avoid Pkl entirely and create the system config JSON yourself by using the Pkl modules and serde types as reference or running pkl eval on examples. While Pkl is the only official way of generating a system config's JSON, validation is implemented for both the Pkl modules and in the CLI and there are tests to help avoid drift.