Imagine today you are onboarding! You get a brand-new machine and want to get ready to start coding ASAP. If you want to speed up building a development environment, this post is for you.

Before you install Scoop, remember that the Scoop bucket needs git to function well, so if your local machine has not installed git yet, please install it manually or via the script.

Why Scoop

The package management tool has various choices on Windows: Chocolatey, Scoop, and winget.

  • Winget is the official tool that Microsoft provides. But it’s also the youngest of these tools, so the package is also the fewest.

  • Chocolatey is the oldest one and has the most plentiful applications. It includes packages relative to development or CLI tools and other software for non-developers. Even if you are not a developer, it is convenient to use. But it depends on .NET Framework 4.x or above.

  • Scoop, in the beginning, the package handled is less than Chocolatey; it focused on taking development environment building software such as developers. But now it has various bucket that includes many applications, which is helpful for non-developers. No special require dependencies like .NET framework vesion.

Point\ToolChocolateyScoopwinget
OwnerChocolatey Software, Inc.lukesampsonMicrosoft Corp.
PublishMar. 2011Sep. 2013May 2020
Packages9853 ref*5277 ref*4315 ref*
PricingApache v2.0 & PAID ref*MIT License ref*MIT License ref*

Setup Scoop environment variable

For scoop there are three environment variables you can setup when you install.

For more detail you can check the scoop install script here

  • $Env:SCOOP
    • Default will locate at $env:USERPROFILE\scoop
  • $Env:SCOOP_GLOBAL
    • Default will locate at $env:ProgramData\scoop
  • $Env:SCOOP_CACHE
    • Default will locate at $ScoopDir\cache
  • $env:XDG_CONFIG_HOME
    • This variable can’t config out side, can only config before you install. This variable affect where to save the scoop config file.

Install scoop

Take a look at the code snippet below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function Install-Scoop {
    # Ref: https://github.com/ScoopInstaller/Install
    param (
        # Default is $env:USERPROFILE\scoop
        [string] $ScoopLocate = '',
        # Default is $env:USERPROFILE\scoop\cache
        [string] $ScoopCache = '',
        # Default is $env:ProgramData\scoop
        [string] $ScoopGlobalApps = ''
    )
    
    if (($null -eq $Env:SCOOP) -and ($ScoopLocate -ne '')) {
        $Env:SCOOP = $ScoopLocate
        [Environment]::SetEnvironmentVariable('SCOOP', $Env:SCOOP, 'User')
    }
    if (($null -eq $Env:SCOOP_CACHE) -and ($ScoopCache -ne '')) {
        $Env:SCOOP_CACHE = $ScoopCache
        [Environment]::SetEnvironmentVariable('SCOOP_CACHE', $Env:SCOOP_CACHE, 'User')
    }
    if (($null -eq $Env:SCOOP_GLOBAL) -and ($ScoopGlobalApps -ne '')) {
        $Env:SCOOP_GLOBAL = $ScoopGlobalApps
        [Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $Env:SCOOP_GLOBAL, 'User')
    }
    
    # You can set $Env:XDG_CONFIG_HOME variable if you want to set Scoop config file as well

    # install scoop
    Invoke-WebRequest -useb get.scoop.sh | Invoke-Expression
}

If you just want to install scoop this code snippet is what you need.

Recommand buckets

scoop bucket add main

  • main => default bucket, all CLI tools no GUI tools. No need to add this bucket. If you install scoop, this bucket will be add automatically.

scoop bucket add extras

  • extras => basically all GUI relative tools.

scoop bucket add java

  • java => Any JDK including Oracle’s version.

scoop bucket add nerd-fonts

  • nerd-fonts => Many fonts that developer will love.

scoop bucket add versions

  • versions => Including many kinds of version of APPs from night build to previous verions.

Install Git (If needed)

If you haven’t installed git yet, you can install it via Scoop—just a simple code.

scoop install main/git

Of course you can download executable file on official site. Then, you can follow the wizard to install git easily.

Create a .ssh folder (if needed)

You probably do not have a .ssh folder on a brain-new machine. This folder is the default location where OpenSSH gets the credential (ref*). You can place the private key here or have a file named config to store the path where you place your private key. You can check what you can configure in the file here.

Here is example of a SSH config file

1
2
3
 Host github                                      # Host name
    HostName github.com                           # host domain or ip
    IdentityFile C:\Users\your_name\.ssh\gitlab   # The path of key

Create a ssh key (if needed)

Usually, Github/Gitlab or Bitbucket are the comment repositories and access repositories by an SSH key or GPG key. You can generate a key pair via the command below.

1
ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}

To generate a key pair for Github, you’d better use the Ed25519 type; OpenSSH provides different kinds. Take a look at the table:

Type of keyMinimum key size (bits)Example
Ed25519 (ed25519)256ssh-keygen -t ed25519 -b 256
ECDSA (ecdsa)256ssh-keygen -t ecdsa -b 256
RSA (rsa)2048ssh-keygen -t rsa -b 2048
DSA / DSS (dsa)1024ssh-keygen -t dsa -b 1024

For more detail you can check here.

Install development language that you need

You can install various development languages via Scoop—E.g., Java, Python, NodeJS, Golang, PHP, Ruby, dotnet, and even Rust. All you need to do is a simple code snippet.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
scoop install main/go
scoop install main/rust
scoop install main/nodejs
scoop install main/php
scoop install main/dotnet-sdk
scoop install main/python
scoop install main/ruby

## If you want to install Java you need add java bucket first
# scoop bucket add java
scoop install java/zulu-jdk

If you have multiple versions to switch, you can type:

scoop reset <app>

E.g.

1
2
3
4
5
6
7
8
9
scoop install python36 python

scoop reset python36

python --vesion

scoop reset python

python --version

Install container

I use podman as my container tool.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
function Install-Podman {
    param (
        [bool][Parameter(Mandatory = $true)] $Install,
        [string] $PodmanMSI = 'podman-v4.6.2.msi'
    )

    if ($Install -eq $False) {
        exit
    }

    # install podman
    $DownloadDir = 'D:\Downloads'
    if ((Test-Path $DownloadDir) -eq $False) {
        New-Item $DownloadDir -ItemType Directory
    }
    Invoke-WebRequest -UseBasicParsing -Uri "https://github.com/containers/podman/releases/download/v4.6.2/$PodmanMSI" -OutFile "$DownloadDir\$PodmanMSI"
    Start-Process "$DownloadDir\$PodmanMSI"

    scoop install extras/podman-desktop
}

The reason I choose podman, you can reference this post.

Of course, you can choose Docker. Since its more popular and common. Install is simple as below:

1
scoop install main/docker

Other APPs that I recommend

Here is the APPs that I installed and management via Scoop.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Useful development tools
scoop install main/curl
scoop install extras/ilspy
scoop install main/k6
scoop install extras/lazygit
scoop install extras/mobaxterm
scoop install extras/posh-git
scoop install extras/postman

# Powerful IDE tools
scoop install extras/notepadplusplus
scoop install extras/vscode

# Beautiful Fonts
scoop install nerd-fonts/FiraCode
scoop install nerd-fonts/Hack-NF
scoop install nerd-fonts/Hermit-NF

# Fancy and secure browser
scoop install extras/brave
scoop install extras/sidekick-browser

# Prodcutivity tools
scoop install extras/xmind

APPs can search here.

My script to speed up local environment

Finally, Here is the script to achieve the goal:

This script is MIT license, please feel free to use it and give some feed back to me.

Reference