Skip to content

Commit 26aaf8a

Browse files
authored
Merge pull request #127 from microsoft/nmetulev/telemetry-docs
Added telemetry docs
2 parents dc05722 + 1a28443 commit 26aaf8a

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

docs/telemetry.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: Windows App Development CLI telemetry
3+
description: The Windows App Development CLI collects usage information and sends it to Microsoft. Learn what data is collected and how to opt out.
4+
ms.date: 2025-11-13
5+
---
6+
7+
# Windows App Development CLI telemetry
8+
9+
The [Windows App Development CLI](usage.md) (WinAppCLI) includes a telemetry feature that collects anonymous usage data and sends it to Microsoft when you use CLI commands. The usage data includes exception information when the CLI crashes. Telemetry data helps the Windows App team understand how the tool is used so it can be improved. Information on failures helps the team resolve problems and fix bugs.
10+
11+
The collected data is anonymous. No personal information such as usernames, email addresses, or source code is collected.
12+
13+
> [!IMPORTANT]
14+
> Telemetry is **only sent by the official, signed releases** of the WinAppCLI distributed through official channels (winget, npm, GitHub releases, etc.). If you clone the repository and build the CLI yourself, or run it in a debugger, **no telemetry data is sent**. This means developers and contributors working on the CLI source code do not transmit telemetry events during development, testing, or debugging.
15+
16+
## Scope
17+
18+
Telemetry **is collected** when using any WinAppCLI command, including:
19+
20+
- `winapp init`
21+
- `winapp restore`
22+
- `winapp package`
23+
- `winapp manifest`
24+
- `winapp sign`
25+
- `winapp cert`
26+
- `winapp tool`
27+
- `winapp update`
28+
29+
## How to opt out
30+
31+
The WinAppCLI telemetry feature is enabled by default. To opt out of the telemetry feature, set the `WINAPP_CLI_TELEMETRY_OPTOUT` environment variable to `1`.
32+
33+
**Windows (PowerShell):**
34+
```powershell
35+
$env:WINAPP_CLI_TELEMETRY_OPTOUT = "1"
36+
```
37+
38+
**Windows (Command Prompt):**
39+
```cmd
40+
set WINAPP_CLI_TELEMETRY_OPTOUT=1
41+
```
42+
43+
To make this permanent, add the environment variable through System Properties > Environment Variables, or use:
44+
45+
```powershell
46+
[System.Environment]::SetEnvironmentVariable('WINAPP_CLI_TELEMETRY_OPTOUT', '1', 'User')
47+
```
48+
49+
## Disclosure
50+
51+
The WinAppCLI displays the following (or similar) message when you first run any CLI command. This "first run" experience is how Microsoft notifies you about data collection.
52+
53+
```console
54+
Welcome to the Windows App Development CLI! By using this tool, you agree to the
55+
collection of anonymous usage data to help improve the product. You can read the
56+
full privacy policy at https://go.microsoft.com/fwlink/?LinkId=521839
57+
58+
You can opt out of telemetry by setting the WINAPP_CLI_TELEMETRY_OPTOUT environment
59+
variable to '1'.
60+
61+
For more information, please visit: https://aka.ms/winappcli-telemetry-optout
62+
```
63+
64+
This message is shown only once per user. A marker file (`.first-run-complete`) is created in the user .winapp directory to track that the notice has been displayed.
65+
66+
## Data points
67+
68+
The telemetry feature doesn't collect personal data, such as usernames or email addresses. It doesn't scan your code and doesn't extract project-level data, such as name, repository, or author. It doesn't extract the contents of any data files accessed or created by your apps, dumps of any memory occupied by your apps' objects, or the contents of the clipboard. The data is sent securely to Microsoft servers using ETW events, held under restricted access.
69+
70+
Protecting your privacy is important to us. If you suspect the telemetry is collecting sensitive data or the data is being insecurely or inappropriately handled, file an issue in the [microsoft/winsdk](https://github.com/microsoft/winsdk/issues) repository for investigation.
71+
72+
### Collected data
73+
74+
The telemetry feature collects the following data:
75+
76+
| Data point | Description |
77+
|------------|-------------|
78+
| Command name | The full type name of the command invoked (e.g., `WinApp.Cli.Commands.InitCommand`). |
79+
| Command arguments | The names and sanitized values of command arguments. String values (file paths, directory paths) are replaced with `[string]` to avoid collecting sensitive information. |
80+
| Command options | The names and sanitized values of command options. String values are replaced with `[string]` to avoid collecting sensitive information. Boolean values and enums are collected as-is. |
81+
| Exit code | The exit code returned by the command (0 for success, non-zero for failure). |
82+
| Timestamp | When the command was invoked and when it completed. |
83+
| CLI version | The version of the WinAppCLI tool (from assembly version). |
84+
| CI environment | A boolean flag indicating whether the CLI is running in a Continuous Integration environment. |
85+
| Caller | The value of the `WINAPP_CLI_CALLER` environment variable, if set. This allows wrapper tools (like the npm package) to identify themselves. |
86+
87+
### Sanitization of sensitive data
88+
89+
The WinAppCLI takes several measures to protect your privacy:
90+
91+
- **Command arguments and options** of type `string`, `FileInfo`, or `DirectoryInfo` are replaced with `[string]`.
92+
- **Implicit values** (default values that weren't explicitly provided) are not collected.
93+
- **Parsing errors** are logged as `[error]` without including the actual erroneous input.
94+
- All string values in telemetry events undergo **sensitive string replacement** before transmission, which replaces any registered sensitive strings with anonymized tokens.
95+
96+
## Crash exception telemetry
97+
98+
If the WinAppCLI crashes, it collects the name of the exception and stack trace of the CLI code. This information is collected to assess problems and improve the quality of the tool. This article provides information about the data we collect. It also provides tips on how users building their own version of the WinAppCLI can avoid inadvertent disclosure of personal or sensitive information.
99+
100+
The WinAppCLI collects information for CLI exceptions only, not exceptions in your application. The collected data contains the name of the exception and the stack trace. This stack trace is of CLI code only.
101+
102+
The following example shows the kind of data that is collected:
103+
104+
```console
105+
System.IO.IOException
106+
at System.IO.FileStream.Write(Byte[] buffer, Int32 offset, Int32 count)
107+
at WinApp.Cli.Services.MsixService.GenerateManifest()
108+
at WinApp.Cli.Commands.ManifestGenerateCommand.Handler.InvokeAsync(InvocationContext context)
109+
at WinApp.Cli.Program.Main(String[] args)
110+
```
111+
112+
## Developer and contributor information
113+
114+
**If you build the WinAppCLI from source yourself, no telemetry data is sent.** Telemetry is only active in the official, signed releases of the tool.
115+
116+
This means:
117+
- Cloning the repository and building locally: **No telemetry sent**
118+
- Running the CLI in a debugger: **No telemetry sent**
119+
- Building from source for testing: **No telemetry sent**
120+
- Using official releases from npm or GitHub: **Telemetry is sent** (unless opted out)
121+
122+
Contributors and developers can work on the WinAppCLI source code without any concern about inadvertently sending telemetry data during development.
123+
124+
## See also
125+
126+
- [WinAppCLI Usage Documentation](usage.md)
127+
- [Microsoft Privacy Statement](https://go.microsoft.com/fwlink/?LinkId=521839)

0 commit comments

Comments
 (0)