Scoop

一个适用于 Windows 的命令行安装程序。「A command-line installer for Windows.」

Github stars Tracking Chart

Scoop

特性 | 安装 | 文档

Scoop 是一个用于 Windows 的命令行安装程序。

Scoop 是做什么的?

Scoop 以最小的摩擦从命令行安装程序。它:

  • 消除弹出的权限窗口
  • 隐藏 GUI 向导式的安装程序
  • 防止安装大量程序造成的 PATH 污染
  • 避免了安装和卸载程序的意外副作用
  • 自动查找和安装依赖性
  • 自己执行所有额外的安装步骤以获得一个工作程序

Scoop 有很强的脚本性,所以你可以重复设置,使你的环境符合你的要求,比如说:

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

如果你开发的软件希望别人使用,Scoop 是建立安装程序(如 MSI 或 InnoSetup)的替代方案--你只需要压缩你的程序并提供一个 JSON 清单,描述如何安装它。

要求

  • Windows 7 SP1+ / Windows Server 2008+
  • PowerShell 5 (或更高版本,包括 PowerShell Core) 和 .NET Framework 4.5 (或更高版本)
  • 必须为你的用户账户启用 PowerShell,例如:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

安装

从你的 PowerShell 运行以下命令,将 scoop 安装到其默认位置(C:\Users\\scoop)。

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# or shorter
iwr -useb get.scoop.sh | iex

一旦安装完毕,请运行 Scoop help 以获得指导。

默认设置中,所有用户安装的程序和 Scoop 本身都在 C:\Users\\scoop 中。全局安装的程序(--global)在 C:\ProgramData\scoop。这些设置可以通过环境变量来改变。

通过改变 SCOOP 将 Scoop 安装到一个自定义目录中

$env:SCOOP='D:\Applications\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# run the installer

通过改变 SCOOP_GLOBAL 来配置 Scoop 将全局程序安装到自定义目录中

$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
# run the installer

通过改变 SCOOP_CACHE 来配置 Scoop 来存储下载到一个自定义目录中

$env:SCOOP_CACHE='F:\ScoopCache'
[Environment]::SetEnvironmentVariable('SCOOP_CACHE', $env:SCOOP_CACHE, 'Machine')
# run the installer

通过设置 SCOOP_CHECKVER_TOKEN,使 Scoop 在搜索和检查时使用 GitHub 的 API 令牌

$env:SCOOP_CHECKVER_TOKEN=''
[Environment]::SetEnvironmentVariable('SCOOP_CHECKVER_TOKEN', $env:SCOOP_CHECKVER_TOKEN, 'Machine')
# search for an app

文档

用 aria2 进行多连接下载

Scoop 可以利用 aria2 来使用多连接下载。只需通过 Scoop 安装 aria2,它就会被用于之后的所有下载。

scoop install aria2

在默认情况下,当运行 scoop install 或 scoop update 时,scoop 会显示一个警告,而此时 aria2 已经启用。这个警告可以通过运行 scoop config aria2-warning-enabled false 来压制。

你可以用 scoop config 命令来调整以下 aria2 设置:

灵感来自于

Scoop 能安装什么样的应用程序?

最适合用 Scoop 安装的应用程序通常被称为 "可移植" 的应用程序:即压缩的程序文件,在解压后独立运行,没有改变注册表或将文件放在程序目录之外的副作用。

由于安装程序很常见,Scoop 也支持它们(以及它们的卸载程序)。

Scoop 在处理单文件程序和 Powershell 脚本方面也很出色。这些甚至不需要被压缩。请看 runat 软件包的例子:它实际上只是一个 GitHub 的 gist。

为这个项目做贡献

如果你想通过增加功能或修复错误来改进 Scoop,请阅读我们的 贡献指南

支持本项目

如果你觉得 Scoop 很有用,并愿意支持持续的开发和维护,方法如下:

  • PayPal (一次性捐款)

已知的应用程序桶

以下是 Scoop 已知的桶:

  • main - 最常见的(主要是 CLI)应用程序的默认桶
  • extras - Apps that 不符合主桶准则(criteria )的应用程序
  • games - 开源/免费游戏和游戏相关工具
  • nerd-fonts - Nerd 字体
  • nirsoft - Almost all of the apps 几乎所有来自 Nirsoft250 多个 应用程序
  • java - Java 开发工具包(JDK)、Java 运行时引擎(JRE)、Java 的虚拟机调试工具和基于 Java 的运行时引擎的集合。
  • nonportable - 不可移植的应用程序(可能需要 UAC)
  • php - 大多数版本的 PHP 的安装程序
  • versions - 在其他桶中发现的应用程序的替代版本

主桶是默认安装的。要添加任何其他桶,请键入:

scoop bucket add bucketname

例如,要添加 extra bucket,键入

scoop bucket add extras

其他应用程序桶

许多其他托管在 Github 上的应用程序桶可以在 Scoop 目录 或通过 其他搜索引擎 找到。


Overview

Name With OwnerScoopInstaller/Scoop
Primary LanguagePowerShell
Program languagePowerShell (Language Count: 2)
PlatformWindows, Windows 10
License:Other
Release Count20
Last Release Namev0.4.2 (Posted on )
First Release Name2019-05-12 (Posted on )
Created At2013-05-11 03:52:15
Pushed At2024-05-14 13:44:12
Last Commit At2024-05-14 13:44:20
Stargazers Count20k
Watchers Count243
Fork Count1.4k
Commits Count10.2k
Has Issues Enabled
Issues Count2833
Issue Open Count181
Pull Requests Count2249
Pull Requests Open Count40
Pull Requests Close Count384
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Scoop is a command-line installer for Windows.

What does Scoop do?

Scoop installs programs from the command line with a minimal amount of friction. It:

  • Eliminates permission popup windows
  • Hides GUI wizard-style installers
  • Prevents PATH pollution from installing lots of programs
  • Avoids unexpected side-effects from installing and uninstalling programs
  • Finds and installs dependencies automatically
  • Performs all the extra setup steps itself to get a working program

Scoop is very scriptable, so you can run repeatable setups to get your environment just the way you like, e.g.:

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

If you've built software that you'd like others to use, Scoop is an alternative to building an installer (e.g. MSI or InnoSetup) — you just need to zip your program and provide a JSON manifest that describes how to install it.

Requirements

  • Windows 7 SP1+ / Windows Server 2008+
  • PowerShell 5 (or later, include PowerShell Core) and .NET Framework 4.5 (or later)
  • PowerShell must be enabled for your user account e.g. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Installation

Run the following command from your PowerShell to install scoop to its default location (C:\Users\<user>\scoop)

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

# or shorter
iwr -useb get.scoop.sh | iex

Once installed, run scoop help for instructions.

The default setup is configured so all user installed programs and Scoop itself live in C:\Users\<user>\scoop.
Globally installed programs (--global) live in C:\ProgramData\scoop.
These settings can be changed through environment variables.

Install Scoop to a Custom Directory by changing SCOOP

$env:SCOOP='D:\Applications\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# run the installer

Configure Scoop to install global programs to a Custom Directory by changing SCOOP_GLOBAL

$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
# run the installer

Configure Scoop to store downloads to a Custom Directory by changing SCOOP_CACHE

$env:SCOOP_CACHE='F:\ScoopCache'
[Environment]::SetEnvironmentVariable('SCOOP_CACHE', $env:SCOOP_CACHE, 'Machine')
# run the installer

Configure Scoop to use a GitHub API token during searching and checkver by setting SCOOP_CHECKVER_TOKEN

$env:SCOOP_CHECKVER_TOKEN='<paste-token-here>'
[Environment]::SetEnvironmentVariable('SCOOP_CHECKVER_TOKEN', $env:SCOOP_CHECKVER_TOKEN, 'Machine')
# search for an app

Documentation

Multi-connection downloads with aria2

Scoop can utilize aria2 to use multi-connection downloads. Simply install aria2 through Scoop and it will be used for all downloads afterward.

scoop install aria2

By default, scoop displays a warning when running scoop install or scoop update while aria2 is enabled. This warning can be suppressed by running scoop config aria2-warning-enabled false.

You can tweak the following aria2 settings with the scoop config command:

Inspiration

What sort of apps can Scoop install?

The apps that install best with Scoop are commonly called "portable" apps: i.e. compressed program files that run stand-alone when extracted and don't have side-effects like changing the registry or putting files outside the program directory.

Since installers are common, Scoop supports them too (and their uninstallers).

Scoop is also great at handling single-file programs and Powershell scripts. These don't even need to be compressed. See the runat package for an example: it's really just a GitHub gist.

Contribute to this project

If you'd like to improve Scoop by adding features or fixing bugs, please read our Contributing Guide.

Support this project

If you find Scoop useful and would like to support ongoing development and maintenance, here's how:

Known application buckets

The following buckets are known to scoop:

  • main - Default bucket for the most common (mostly CLI) apps
  • extras - Apps that don't fit the main bucket's criteria
  • games - Open source/freeware games and game-related tools
  • nerd-fonts - Nerd Fonts
  • nirsoft - Almost all of the 250+ apps from Nirsoft
  • java - A collection of Java development kits (JDKs), Java runtime engines (JREs), Java's virtual machine debugging tools and Java based runtime engines.
  • nonportable - Non-portable apps (may require UAC)
  • php - Installers for most versions of PHP
  • versions - Alternative versions of apps found in other buckets

The main bucket is installed by default. To add any of the other buckets, type:

scoop bucket add bucketname

For example, to add the extras bucket, type:

scoop bucket add extras

Other application buckets

Many other application buckets hosted on Github can be found in the Scoop Directory or via other search engines.

To the top