Scripts2026年6月1日·1 分钟阅读

Topgrade — Upgrade Everything on Your System with One Command

A CLI tool that detects and runs the appropriate update commands for all package managers and tools on your system.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Topgrade Overview
直接安装命令
npx -y tokrepo@latest install d6b24584-5d94-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Topgrade is a single command that detects which package managers and tools are installed on your system and runs their update commands in sequence. Instead of remembering apt update, brew upgrade, rustup update, and a dozen others, you run topgrade once.

What Topgrade Does

  • Detects installed package managers (apt, brew, pacman, dnf, etc.)
  • Updates programming language toolchains (rustup, pyenv, nvm, sdkman, etc.)
  • Upgrades editor plugins (Vim, Neovim, Emacs, VS Code extensions)
  • Refreshes container images, Flatpaks, Snaps, and firmware
  • Runs custom pre- and post-upgrade commands defined in configuration

Architecture Overview

Topgrade is a single Rust binary that checks for the presence of known tools by probing the filesystem and PATH. Each detected tool has a corresponding upgrade step. Steps run sequentially with stdout/stderr streamed to the terminal. The configuration file allows disabling steps, adding custom commands, and setting timeouts.

Self-Hosting & Configuration

  • Install via Cargo, Homebrew, or system package managers
  • Configuration file at ~/.config/topgrade/topgrade.toml
  • Disable specific steps with [misc] disable = ["snap", "flatpak"]
  • Add custom pre/post commands in the [pre_commands] and [post_commands] sections
  • Use --dry-run to preview what would be updated without executing

Key Features

  • Supports 50+ package managers and tools out of the box
  • Cross-platform: Linux, macOS, Windows, and FreeBSD
  • Configurable step order, timeouts, and skip rules
  • Dry-run mode for safe previewing
  • Self-update capability to keep Topgrade itself current

Comparison with Similar Tools

  • apt/brew/pacman — single package manager; Topgrade orchestrates all of them
  • Homebrew Bundle — macOS-only Brewfile runner; Topgrade is cross-platform and broader
  • nix-env --upgrade — Nix-specific; Topgrade covers heterogeneous environments
  • winget upgrade --all — Windows-only; Topgrade spans operating systems
  • freshenv — environment setup tool; Topgrade focuses on ongoing maintenance

FAQ

Q: Will Topgrade break my system? A: Topgrade runs the same commands you would manually. Use --dry-run to preview.

Q: Can I skip certain package managers? A: Yes. Disable them in topgrade.toml or pass --disable flags on the command line.

Q: Does it require root? A: Only for system package managers (apt, pacman). User-level tools run without root.

Q: How do I add a custom upgrade step? A: Add entries under [pre_commands] or [post_commands] in topgrade.toml.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产