Categories
💻 Windows

How to Use “winget” to Install Apps from Command Line on Windows 10

Guide to search and install apps using Winget on Windows 10

Microsoft is working on a command-line tool called winget to let Windows 10 users download and install apps straight from the command prompt. Winget is currently available as a preview release, but you can download it on any Windows 10 PC to test and try from Github.

Advertisements

If you’re running the latest Windows 10 Insider build, you probably already have winget installed on your computer. You could verify that by running the following command in CMD or PowerShell:

winget --version

On Windows 10 stable releases, you’ll have to manually download and install winget on your system. We’ve a detailed guide on installing winget at the link below, have a look at it.



In this guide, we are going to take a look at the basics of winget and see how to install, search, or get info of an app from the command prompt.

Advertisements

winget CLI tool has a basic syntax very similar to many popular Linux package managers such as apt or dnf. You can use winget CLI from either Command Prompt or Windows PowerShell. The basic winget syntax is as follows:

winget <command> <arguments>

That said, let’s get started with installing an app from the command line using Winget.

Winget install app command

Much like apt install on Ubuntu systems, you can use winget install command to download and install apps on a Windows 10 PC.

winget install <app-name> For example: winget install 7zip

Winget will start downloading the app and install it automatically. If you get a UAC prompt, press the ‘Yes’ button and you’ll be good to go.

C:\Users\ATH> winget install 7zip Found 7Zip [7zip.7zip] This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://www.7-zip.org/a/7z1900-x64.msi ██████████████████████████████ 1.66 MB / 1.66 MB Successfully verified installer hash Installing ... Successfully installed!

Winget install usage and flags

Below are all supported flags as shown in the winget install --help command.

usage: winget install [[-q] <query>] [<options>] The following arguments are available: -q,--query The query used to search for an app The following options are available: -m,--manifest The path to the manifest of the application --id Filter results by id --name Filter results by name --moniker Filter results by app moniker -v,--version Use the specified version; default is the latest version -s,--source Find app using the specified source -e,--exact Find app using exact match -i,--interactive Request interactive installation; user input may be needed -h,--silent Request silent installation -o,--log Log location (if supported) --override Override arguments to be passed on to the installer -l,--location Location to install to (if supported)

Winget search app command

Advertisements

To search for an app, we’ll use the winget search command.

winget search <app-name> For example: winget search 7zip

If there’s a package available by the name ‘7zip’, winget search command will retrieve the Package Name, ID, Version and show it in the output.

C:\Users\ATH> winget search 7zip Name Id Version Matched ------------------------------------ 7Zip 7zip.7zip 19.0.0 Moniker: 7zip

Winget search usage and flags

Below are all supported flags as shown in the winget search --help command.

usage: winget search [[-q] <query>] [<options>] The following arguments are available: -q,--query The query used to search for an app The following options are available: --id Filter results by id --name Filter results by name --moniker Filter results by app moniker --tag Filter results by tag --command Filter results by command -s,--source Find app using the specified source -n,--count Show no more than specified number of results -e,--exact Find app using exact match

Winget show app command

While winget search command is enough to retrieve basic information about an app from the command line, you can retrieve complete details such as Author name, Description, License, and more about an app using the winget show command.

winget show <app-name> For example: winget show 7zip

The output from winget show command will retrieve all relevant information about a package that you’d probably need (from a command line tool).

C:\Users\ATH> winget show 7zip Found 7Zip [7zip.7zip] Version: 19.0.0 Publisher: 7zip Author: 7zip AppMoniker: 7zip Description: Free and open source file archiver with a high compression ratio. Homepage: https://www.7-zip.org/ License: Copyright (C) 1999-2020 Igor Pavlov. - GNU LGPL License Url: https://7-zip.org/license.txt Installer: SHA256: a7803233eedb6a4b59b3024ccf9292a6fffb94507dc998aa67c5b745d197a5dc Download Url: https://www.7-zip.org/a/7z1900-x64.msi Type: Msi

Winget show usage and flags

Advertisements

Below are all supported flags as shown in the winget show --help command.

usage: winget show [[-q] <query>] [<options>] The following arguments are available: -q,--query The query used to search for an app The following options are available: -m,--manifest The path to the manifest of the application --id Filter results by id --name Filter results by name --moniker Filter results by app moniker -v,--version Use the specified version; default is the latest version -s,--source Find app using the specified source -e,--exact Find app using exact match --versions Show available versions of the app

To conclude, we were able to search and install an app from command line on Windows 10 using winget package manager and looked at some basic usage of it.

winget package manager is a developing feature and is expected to release in stable builds of Windows 10 by May 2021.