# Topgrade

> Detects installed package managers and tools on your system and runs the appropriate update commands for each in a single invocation.

Stars: 4.7k · Language: Rust · License: GPL-3.0 · Categories: System

- Repository: https://github.com/topgrade-rs/topgrade
- Page: https://www.trmn.sh/tools/topgrade

## Install

- Homebrew: `brew install topgrade`
- Cargo: `cargo install topgrade`
- Winget: `winget install --id=topgrade-rs.topgrade  -e`

## Overview

Topgrade is a system update tool that detects which package managers and tools are installed on a machine and runs the matching upgrade commands. It replaces the long, non-portable shell one-liners people otherwise keep to chain updates from several package managers. Usage is just running `topgrade`. This repository is a maintained fork of r-darwish's original topgrade.

Behavior is controlled by a TOML configuration file. Topgrade looks for `CONFIG_DIR/topgrade.toml` first, then `CONFIG_DIR/topgrade/topgrade.toml`. `CONFIG_DIR` is `%APPDATA%` on Windows and `${XDG_CONFIG_HOME:-~/.config}` on macOS and other Unix systems. On first run it creates a default file if none exists, and it merges any files in `CONFIG_DIR/topgrade.d/` before the main file. An example is provided in `config.example.toml`.

The configuration can define custom commands that run before, during, or after the built-in steps. They run in a new shell taken from `$SHELL` on Unix (falling back to `sh`) or `pwsh` on Windows (falling back to `powershell`). On Unix, a leading `-i` runs the command in an interactive shell so RC files are sourced.

Topgrade also supports remote execution. A `remote_topgrades` key in the configuration lists hostnames that have Topgrade installed. Topgrade uses `ssh` to run `topgrade` on those hosts before updating the local machine, and `--remote-host-limit` restricts the run to specific hosts. It is aimed at developers and sysadmins who maintain one or more machines on Windows, macOS, or Linux. The released binary can update itself.

### Installation

```bash
# via Homebrew
brew install topgrade
```

```bash
# via Cargo
cargo install topgrade
```

```bash
# via Winget
winget install --id=topgrade-rs.topgrade  -e
```

![Topgrade demo](https://media.trmn.sh/cached/aab42bb1cc6221580c6ace0f610fdc75c8b32b12e25424255a5223f8dbab0b6f.gif)

## Alternatives

- [procs](https://www.trmn.sh/tools/procs.md): A Rust-based replacement for ps with colored output, multi-column search, and additional process information (Rust, 6.2k stars)
- [zenith](https://www.trmn.sh/tools/zenith.md): Terminal-based system monitor with graphical metrics for CPU, memory, network, disk usage, and process management written in Rust (Rust, 3.1k stars)
- [oxker](https://www.trmn.sh/tools/oxker.md): Rust TUI for viewing and controlling Docker containers, with log viewing, search, filtering, sorting, inspect and exec, configurable via TOML/JSON. (Rust, 2.0k stars)
- [zerobrew](https://www.trmn.sh/tools/zerobrew.md): Experimental Homebrew-compatible package client for macOS and Linux that uses content-addressable storage and APFS clonefiles for faster installs. (Rust, 8.2k stars)
- [wiremix](https://www.trmn.sh/tools/wiremix.md): TUI audio mixer for PipeWire that controls volumes, routes audio between devices and applications, and configures audio settings. (Rust, 1.1k stars)

---

Canonical: https://www.trmn.sh/tools/topgrade
