winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

source.md (4741B)


      1 ---
      2 title: source Command
      3 description: Manages the repositories accessed by Windows Package Manager.
      4 ms.date: 04/28/2020
      5 ms.topic: overview
      6 ms.localizationpriority: medium
      7 ---
      8 
      9 # source command (winget)
     10 
     11 > The **source** command is currently for internal use only. Additional sources are not supported at this time.
     12 
     13 The **source** command of the [winget](index.md) tool manages the repositories accessed by Windows Package Manager. With the **source** command you can **add**, **remove**, **list**, and **update** the repositories.
     14 
     15 A source provides the data for you to discover and install applications. Only add a new source if you trust it as a secure location.
     16 
     17 ## Usage
     18 
     19 `winget source [<command>] [<options>]`
     20 
     21 ![Source image](images/source.png)
     22 
     23 ## Arguments
     24 
     25 The following arguments are available.
     26 
     27 | Argument  | Description |
     28 |--------------|-------------|
     29 | **-?, --help** |  Gets additional help on this command. |
     30 
     31 ## Sub-commands
     32 
     33 Source supports the following sub-commands for manipulating the sources.
     34 
     35 | Sub-command  | Description |
     36 |--------------|-------------|
     37 |  **add** |  Adds a new source. |
     38 |  **list** | Enumerates the list of enabled sources. |
     39 |  **update** | Updates a source. |
     40 |  **remove** | Removes a source. |
     41 |  **reset** | Resets **winget** back to the initial configuration.  |
     42 |  **export** | Export current sources |
     43 
     44 For more details on a specific command, pass it the help argument. [-?]
     45 
     46 ## Options
     47 
     48 The **source** command supports the following options.
     49 
     50 | Option  | Description |
     51 |--------------|-------------|
     52 |  **-n, --name** | The name to identify the source by. |
     53 |  **-a, --arg** | The URL or UNC of the source. |
     54 |  **-t, --type** | The type of source. |
     55 | **-?, --help** |  Gets additional help on this command. |
     56 | **--wait** | Prompts the user to press any key before exiting. |
     57 | **--logs, --open-logs** | Open the default logs location. |
     58 | **--verbose, --verbose-logs** | Enables verbose logging for winget. |
     59 | **--disable-interactivity** | Disable interactive prompts. |
     60 
     61 ## add
     62 
     63 The **add** sub-command adds a new source. This sub-command requires the **--name** option and the **name** argument.
     64 
     65 Usage: `winget source add [-n, --name] <name> [-a] <url> [[-t] <type>]`
     66 
     67 Example:  `winget source add --name Contoso https://www.contoso.com/cache`
     68 
     69 The **add** sub-command also supports the optional **type** parameter. The **type** parameter communicates to the client what type of repository it is connecting to. The following types are supported.
     70 
     71 | Type  | Description |
     72 |--------------|-------------|
     73 | **Microsoft.PreIndexed.Package** | The type of source \<default>. |
     74 | **Microsoft.Rest** | A Microsoft REST API source. |
     75 
     76 ## list
     77 
     78 the **list** sub-command enumerates the currently enabled sources. This sub-command also provides details on a specific source.
     79 
     80 Usage: `winget source list [-n, --name] <name>`
     81 
     82 ### list all
     83 
     84 The **list** sub-command by itself will reveal the complete list of supported sources. For example:
     85 
     86 ![Source list image](images/source-list.png)
     87 
     88 ### list source details
     89 
     90 In order to get complete details on the source, pass in the name used to identify the source. For example:
     91 
     92 ![Source list winget image](images/source-list-winget.png)
     93 
     94 **Name** displays the name to identify the source by.
     95 **Type** displays the type of repo.
     96 **Arg** displays the URL or path used by the source.
     97 **Data** displays the optional package name used if appropriate.
     98 **Updated** displays the last date and time the source was updated.
     99 
    100 ## update
    101 
    102 The **update** sub-command forces an update to an individual source or for all.
    103 
    104 usage: `winget source update [-n, --name] <name>`
    105 
    106 ### update all
    107 
    108 The **update** sub-command by itself will request and update to each repo. For example: `C:\winget update`
    109 
    110 ### update source
    111 
    112 The **update** sub-command combined with the **--name** option can direct and update to an individual source. For example: `C:\winget source update --name winget`
    113 
    114 ## remove
    115 
    116 The **remove** sub-command removes a source. This sub-command requires the **--name** option and **name argument** in order to identify the source.
    117 
    118 Usage: `winget source remove [-n, --name] <name>`
    119 
    120 For example: `winget source remove --name Contoso`
    121 
    122 ## reset
    123 
    124 The **reset** sub-command resets the client back to its original configuration. The **reset** sub-command removes all sources and sets the source to the default. This sub-command should only be used in rare cases.
    125 
    126 Usage: `winget source reset`
    127 
    128 ## Default repository
    129 
    130 Windows Package Manager specifies a default repository. You can identify the repository by using the **list** command. For example: `winget source list`
    131 
    132 ## Related topics
    133 
    134 * [Use the winget tool to install and manage applications](index.md)