Posted in Software 27 Dec 2016 @ 12:41 PM~5 min read

Scoop: like Homebrew, but for Windows

This awesome little tool has been around for years now, but it’s only just caught my attention – right when I needed it the most. Wish it’d happened sooner.

Initially released in 2013 (it’s forever ago, I know), Scoop is one of those tools that make daily CLI-usage a breeze. From one perspective, you can think of it as a tool that allows you to import commands commonly used in Unix (there are a few buckets and scoops for that). From another perspective, you can think of it as an entirely new breed of package management for Windows.

Sure, there’s Chocolatey, but that’s quite a big package manager, and really does feel bloated (especially when you use the GUI, which is very slow – trust me) and simply too verbose for my liking.

Having studied software and web development from a Unix/​Linux perspective, it’s essential to me that everything just works from the get-go – this is where Scoop, much like Homebrew comes in handy, and very much to the rescue.

Community-driven

One of my favourite things about Scoop is that it’s community driven. App manifests are hosted in what are known as buckets, which are simply collections of apps. The concept behind this is that all apps available to Scoop are not managed in a central repository. Rather, Scoop is able to add buckets by means of a simple command. From that point, Scoop knows where to get an app from when it is called via the install command.

Video Demonstration

If you’d like to skip this article, here’s a video showcasing Scoop:

Getting Started

Scoop is really easy to install, and relies on Powershell (at least version 3) for its installation. Before we begin, we need to allow non-code-signed scripts to be executed by changing the execution policy:

set-executionpolicy unrestricted -s cu

Next, install Scoop by downloading and executing it:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Now, the scoop command is available, and you don’t have to use it only in Powershell. Scoop will work in any terminal that can see your PATH. However, it is recommended to use Powershell, especially if you would like to make use of the awesome profile utilities that have been created.

Before we get to using Scoop, here’s a little background on the eco-system:

Manifests

Each app is defined in a bucket by means of an app manifest – a JSON file that tells Scoop how to install the app.

Here’s a trimmed-down example of an app manifest for Yarn, the NPM-alternative:

{
    "homepage": "https://yarnpkg.com/",
    "licence": "BSD",
    "version": "0.17.10",
    "depends": "nodejs",
    "url": "https://github.com/yarnpkg/yarn/releases/download/v0.17.10/yarn-0.17.10.msi",
    "bin": "Yarn\\bin\\yarn.cmd",
}

This manifest tells scoop that Yarn depends on Node and should be downloaded from GitHub and installed. It also tells Scoop what the binary for this app is, so that it may be run directly from your terminal by means of a shim.

Note that Scoop is able to automagically extract or run installers, including Inno Setup installers. For the most part, apps are stored in ZIP files, and Scoop obviously knows how to deal with those as well.

Buckets

For the most part, you won’t find yourself creating your own buckets. Much like other package managers out there, the main bucket should have most of what you may need as part of your daily workflow.

Be sure to take a look at the list of available apps in the main bucket before continuing. You can also use Scoop to search for an app you might be interested in:

scoop search curl

There are, however, a few additional buckets for Scoop, such as extras, versions, and those that can be found from a simple search.

Buckets can be installed by running the following command:

scoop bucket add <name> [<git-repo-url>]

Here, <name> is the name of the bucket as it will be installed on your system. The extras bucket is a special bucket, which means the <git-repo-url> does not need to be defined – Scoop already knows where to fetch it from.

When installing a non-special bucket, you need to specify the repository URL. In such cases, you can name the bucket whatever you want.

I’ve also created a bucket that contains a few apps, but this is predominantly for testing at the moment, and one of the apps listed does not work correctly on Windows. Here’s the bucket, if you’re interested.

Using Scoop

Much like Homebrew, Scoop is very easy to use. When you know the name of the app you’d like to install, just pass it to install:

scoop install busybox

Here, we’re installing BusyBox, which is a single executable that contains handy commands that one would normally find in a Unix-like environment, such as ls (already available in Powershell as an alias, but not the same), chmod, grep, mv, rm, tail, touch, and wget.

For many of the other common commands found in these environments, there’s more than likely an app for that. Typical examples include curl, git, hub (to make Git easier to use), openssh (use as ssh), sudo, and vim.

Note that you don’t need to restart the terminal at any time as Scoop creates shims for app binaries in a central location in your home directory.

Powershell and CMD Profile Utilities

When I first started out with Scoop, I found these two awesome utilities; one for colour schemes, and the other for changing the prompt (with Git integration).

Concfg: This app changes your Powershell and CMD colour scheme. To install it, run scoop install concfg.

You can then choose from a variety of colour scheme presets:

concfg import oceanicnext

Pshazz: This app changes your Powershell prompt to give you that Unix-feel. To install it, run scoop install pshazz.

Once installed, you can choose from the available prompt presets. My favourite is the default, which resembles a simple bash terminal prompt:

~ $

Which is so much better than:

PS C:\Users\User>

Enjoy!

If you’ve read this entire article, chances are you’ve never heard of Scoop before. Now that you have, and now that you know how to use it, go ahead and transform your terminal!