Deployr 0.1.0: cross-platform application deployment CLI
Replaces Ninite for endpoint software: one catalog, one command line, and the same behaviour on Windows, macOS and Linux. Single static binary, no server and no agent, driven from an RMM script runner or by hand. - catalog of ~50 apps compiled into the binary, extendable with YAML overlays in catalog.d or via --catalog, no rebuild required - providers: winget, choco, brew, cask, apt, dnf/yum, zypper, pacman, flatpak, snap, plus direct vendor downloads (msi/exe/msu/dmg/pkg/deb/rpm/zip/tar.gz/ AppImage) - sources are tried in order and fall through, so one catalog entry covers winget on Windows, a cask on macOS and the vendor .deb on Debian - provider-independent detection (registry, paths, commands) makes runs idempotent even for software installed by hand - unattended by construction: stdin closed, silent flags, per-command timeouts - handles the traps that break naive wrappers: winget missing under SYSTEM, Homebrew refusing root, 1641/3010 reboot exits, "already installed" reported as failure - --json summary on stdout with progress on stderr, and RMM-friendly exit codes (0 ok, 1 failed, 2 usage, 3 privileges) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
commit
4909edee2d
40 files changed
+6714
No files matched your search
@@ -0,0 +1,223 @@
|
||||
# Deployr
|
||||
|
||||
Cross-platform application deployment and patching from a single binary.
|
||||
|
||||
Deployr replaces Ninite for endpoint software: one catalog of applications, one
|
||||
command line, and the same behaviour on **Windows, macOS and Linux**. It prefers
|
||||
the machine's native package manager and falls back to the vendor's own
|
||||
installer when that route is missing or unreliable.
|
||||
|
||||
There is no server and no agent. Deployr is a single static executable you drop
|
||||
on a machine — by hand, or through your RMM's script runner — and it exits with
|
||||
a status code your automation can branch on.
|
||||
|
||||
```
|
||||
deployr install chrome 7zip vlc
|
||||
deployr install @standard --json
|
||||
deployr update --all
|
||||
deployr status
|
||||
```
|
||||
|
||||
## Why not just call winget / brew / apt directly?
|
||||
|
||||
Because the interesting part is everything around the package manager:
|
||||
|
||||
- **winget does not exist under SYSTEM.** The `winget` on PATH is an app
|
||||
execution alias that only resolves inside a user session — exactly what an RMM
|
||||
script does not have. Deployr finds the real payload under `WindowsApps`.
|
||||
- **Homebrew refuses to run as root**, which is the context an MDM or RMM gives
|
||||
you. Deployr drops to the account that owns the Homebrew prefix.
|
||||
- **Package managers lie with exit codes.** "Already installed" and "no
|
||||
applicable upgrade" are failures to winget and successes to you.
|
||||
- **Not every app is in every repo.** A source list per platform means Chrome
|
||||
comes from winget on Windows, a cask on macOS and Google's own `.deb` on
|
||||
Debian, and it is one catalog entry.
|
||||
- **Unattended means unattended.** Every command runs with stdin closed, silent
|
||||
flags applied and a timeout, so nothing ever waits on a prompt nobody will see.
|
||||
|
||||
## Install
|
||||
|
||||
Download the binary for the machine from `dist/` (see [Building](#building)) and
|
||||
put it somewhere on PATH.
|
||||
|
||||
```powershell
|
||||
# Windows (elevated)
|
||||
Copy-Item deployr_windows_amd64.exe C:\ProgramData\Deployr\deployr.exe
|
||||
```
|
||||
|
||||
```sh
|
||||
# macOS / Linux
|
||||
sudo install -m 0755 deployr_linux_amd64 /usr/local/bin/deployr
|
||||
```
|
||||
|
||||
Verify the machine is ready:
|
||||
|
||||
```
|
||||
deployr doctor
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
| Command | What it does |
|
||||
| --- | --- |
|
||||
| `deployr install <app...>` | Install applications that are not already present |
|
||||
| `deployr update <app...>` | Update installed applications (`--all` for everything present) |
|
||||
| `deployr uninstall <app...>` | Remove applications |
|
||||
| `deployr list` | Show the catalog, filtered to this platform |
|
||||
| `deployr status` | Report what is installed and at which version |
|
||||
| `deployr info <app>` | Show one app's install recipe and current state |
|
||||
| `deployr profiles` | List the bundles defined in the catalog |
|
||||
| `deployr doctor` | Platform, privileges, directories and available providers |
|
||||
| `deployr catalog validate` | Check a catalog overlay before you ship it |
|
||||
|
||||
Anything prefixed with `@` is a profile — a named bundle of apps:
|
||||
|
||||
```
|
||||
deployr install @standard @security
|
||||
```
|
||||
|
||||
### Useful flags
|
||||
|
||||
```
|
||||
--json machine-readable summary on stdout (progress goes to stderr)
|
||||
--dry-run plan the run without touching the machine
|
||||
--verbose log every command that gets executed
|
||||
--force act even when the app is already in the desired state
|
||||
--strict fail instead of falling through to the next source
|
||||
--provider winget restrict every app to a single provider
|
||||
--catalog PATH load an extra catalog file or directory (repeatable)
|
||||
--timeout 45m per-installer timeout (default 30m)
|
||||
--require-checksum refuse vendor downloads with no sha256 pinned in the catalog
|
||||
```
|
||||
|
||||
### Exit codes
|
||||
|
||||
| Code | Meaning |
|
||||
| --- | --- |
|
||||
| `0` | Everything ended in the requested state |
|
||||
| `1` | At least one app failed |
|
||||
| `2` | Usage or catalog error |
|
||||
| `3` | Insufficient privileges — nothing was attempted |
|
||||
|
||||
## Deploying through an RMM
|
||||
|
||||
Deployr is designed to be the payload of a script policy. See
|
||||
[docs/RMM.md](docs/RMM.md) for ready-made Level.io and NinjaOne snippets.
|
||||
|
||||
The short version:
|
||||
|
||||
```powershell
|
||||
# Windows script policy
|
||||
& "C:\ProgramData\Deployr\deployr.exe" install @standard --json
|
||||
exit $LASTEXITCODE
|
||||
```
|
||||
|
||||
```sh
|
||||
# macOS / Linux script policy
|
||||
/usr/local/bin/deployr install @standard --json
|
||||
```
|
||||
|
||||
Progress lines go to stderr and the JSON summary to stdout, so an RMM that
|
||||
captures both gets a readable transcript *and* a parseable result:
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "install",
|
||||
"host": "WS-014",
|
||||
"os": "windows",
|
||||
"arch": "amd64",
|
||||
"total": 6,
|
||||
"changed": 2,
|
||||
"skipped": 4,
|
||||
"failed": 0,
|
||||
"reboot_required": false,
|
||||
"results": [
|
||||
{ "app": "chrome", "status": "skip", "version": "129.0.6668.90", "message": "already installed" },
|
||||
{ "app": "vlc", "status": "ok", "provider": "winget", "version": "3.0.21" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## The catalog
|
||||
|
||||
The catalog is compiled into the binary, so a bare executable on a fresh machine
|
||||
already knows how to install ~45 common applications. Every entry lists its
|
||||
sources in preference order:
|
||||
|
||||
```yaml
|
||||
- id: chrome
|
||||
name: Google Chrome
|
||||
categories: [browser]
|
||||
windows:
|
||||
sources:
|
||||
- provider: winget
|
||||
id: Google.Chrome
|
||||
- provider: choco
|
||||
id: googlechrome
|
||||
- provider: direct
|
||||
url: https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi
|
||||
kind: msi
|
||||
detect:
|
||||
registry: ["Google Chrome"]
|
||||
```
|
||||
|
||||
Add your own apps without rebuilding by dropping a YAML file in the overlay
|
||||
directory (`C:\ProgramData\Deployr\catalog.d` or `/etc/deployr/catalog.d`), or by
|
||||
passing `--catalog`. Overlays can also override a shipped entry — same `id`
|
||||
replaces it wholesale.
|
||||
|
||||
Full format reference and worked examples: [docs/CATALOG.md](docs/CATALOG.md).
|
||||
|
||||
### Providers
|
||||
|
||||
| Provider | Platform | Notes |
|
||||
| --- | --- | --- |
|
||||
| `winget` | Windows | Resolved under SYSTEM; prefers machine scope, falls back to user scope |
|
||||
| `choco` | Windows | Chocolatey 1.x and 2.x |
|
||||
| `brew` | macOS, Linux | Formulae; drops from root to the Homebrew owner |
|
||||
| `cask` | macOS | Casks; `--greedy` on upgrade so self-updating apps still get patched |
|
||||
| `apt` | Linux | Refreshes the index once per run; `noninteractive` throughout |
|
||||
| `dnf` | Linux | Also drives `dnf5` and `yum` |
|
||||
| `zypper` | Linux | |
|
||||
| `pacman` | Linux | |
|
||||
| `flatpak` | Linux | System-wide as root, per-user otherwise |
|
||||
| `snap` | Linux | |
|
||||
| `direct` | all | Vendor download: msi, exe, msu, dmg, pkg, deb, rpm, zip, tar.gz, AppImage |
|
||||
|
||||
## Building
|
||||
|
||||
Requires Go 1.24 or newer. No cgo, no external build tools.
|
||||
|
||||
```sh
|
||||
make build # host binary
|
||||
make dist VERSION=0.1.0 # all six platforms into dist/
|
||||
make check # vet on every platform + tests + gofmt
|
||||
```
|
||||
|
||||
```powershell
|
||||
.\scripts\build.ps1 -Version 0.1.0
|
||||
```
|
||||
|
||||
Output is one static binary per platform (~7 MB), with SHA256SUMS alongside.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
cmd/deployr entry point
|
||||
internal/catalog catalog types, embedded data, overlay merging
|
||||
internal/provider winget, choco, brew/cask, apt, dnf, zypper, pacman, flatpak, snap, direct
|
||||
internal/engine decides what needs doing and walks the source list
|
||||
internal/detect is it already installed (registry, paths, commands)
|
||||
internal/download vendor downloads with retries and checksum pinning
|
||||
internal/platform OS, arch, elevation, well-known directories
|
||||
internal/run non-interactive command execution with timeouts
|
||||
internal/cli command line parsing and output rendering
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
Working: catalog, all providers, install/update/uninstall/status/list/info/
|
||||
doctor, JSON output, overlays, RMM exit codes.
|
||||
|
||||
Not built yet: a central dashboard (deliberately — this is the standalone CLI),
|
||||
scheduled self-updates, and per-app version pinning.
|
||||
Reference in new issue
Block a user