Skip to content

Commit cdf71c9

Browse files
authored
Merge pull request #17 from mapbox/docs/telemetry-install-notice
Tell the user we collect telemetry when install finishes
2 parents b11dc95 + 7c2919c commit cdf71c9

3 files changed

Lines changed: 61 additions & 10 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,18 +338,44 @@ never checks at all.
338338

339339
### Privacy
340340

341-
Mapbox collects telemetry from this CLI, on by default, to understand
342-
adoption and improve reliability, performance and developer experience:
341+
**YOUR PRIVACY - COLLECTION OF TELEMETRY**
342+
343+
Mapbox collects telemetry data from our CLIs to better understand how our
344+
tools are used and how to improve our products.
345+
346+
- **What Telemetry Data We Collect:** Usage metrics include installs,
347+
Mapbox API-related command names (e.g. `auth login`), exit codes, CLI
348+
version, OS/architecture, an identifier for the detected AI coding agent
349+
(if any) running the command (based on signals such as the presence of
350+
the `CLAUDECODE` or `COPILOT_MODEL` environment variable; see
351+
[`agent_detect.rs`](./src/agent_detect.rs) for the complete, versioned
352+
list), and a boolean flag indicating whether the command was run in a CI
353+
environment. IP addresses necessarily accompany any request made to our
354+
server, but will not be retained and analyzed together with telemetry
355+
data.
356+
- **Why We Collect It:** For internal analytics by Mapbox to understand
357+
adoption, prioritize investments, and improve the reliability,
358+
performance, and developer experience of our CLIs.
359+
- **What We Do Not Collect:** Code completion outputs, source code, project
360+
file names, directory contents, non-Mapbox API keys, or credentials.
361+
- **Who has Access:** Telemetry data will not be disclosed to, or accessed
362+
by, third parties other than Mapbox affiliates and passive cloud storage
363+
and hosting providers necessary to maintain our infrastructure.
364+
365+
This also covers [update notices](#update-notices) above, since that check
366+
rides the same opt-out.
367+
368+
**How to Opt Out:** The collection of telemetry data is enabled by default.
369+
You can disable it at any time and without affecting the functionality of
370+
our CLIs by setting
343371

344-
| | |
345-
| --- | --- |
346-
| What | Added to the `User-Agent` every request already carries: `os/<os>`, `arch/<arch>`, `env/ci` when running in CI, `agent/<id>` when a known coding-agent environment is detected, whether stdin/stdout are attached to a terminal, and — for a generated API command — `command/<group>` (e.g. `styles`, `geocoder`), never the operation or its arguments. Every request also carries the IP address it's sent from, which is not retained alongside telemetry. |
347-
| What it never includes | AI prompts, code completion output, source code, project or directory names, command arguments, non-Mapbox API keys or credentials. |
348-
| Who sees it | Mapbox only — never disclosed to third parties, aside from the cloud storage and hosting providers that keep the infrastructure running. |
349-
| Off | `MAPBOX_CLI_NO_TELEMETRY=1` — also silences [update notices](#update-notices) above, since that check rides the same opt-out. |
372+
```sh
373+
MAPBOX_CLI_NO_TELEMETRY=1
374+
```
350375

351-
See the [Mapbox Privacy Policy](https://www.mapbox.com/legal/privacy) for
352-
how this fits into data processing generally, and your rights over it.
376+
For additional information on our data processing activities and your
377+
related rights, please see our Mapbox
378+
[Privacy Policy](https://www.mapbox.com/legal/privacy).
353379

354380
## Uninstall
355381

‎scripts/install.ps1‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,18 @@ Windows 11 on Arm has and Windows 10 on Arm does not.
546546
Write-Host " note the copy it replaced is still running; $asideNote is deleted next time"
547547
}
548548

549+
# Said once, here, rather than on every future command: someone piping
550+
# this into `iex` is not going to read the man page before their first
551+
# run. Skipped when telemetry is already off, since there's nothing to
552+
# opt out of.
553+
if ($TelemetryAllowed) {
554+
Write-Host ''
555+
Write-Host 'Mapbox CLI collects telemetry by default. To disable it, set'
556+
Write-Host 'MAPBOX_CLI_NO_TELEMETRY=1 before running CLI commands.'
557+
Write-Host ''
558+
Write-Host 'Learn more: https://github.com/mapbox/mapbox-cli#privacy'
559+
}
560+
549561
# --- PATH ----------------------------------------------------------
550562

551563
# Resolved before this session's PATH is touched below, so what it

‎scripts/install.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,19 @@ if [ -n "$previous_version" ] && [ "$previous_version" != "$installed_version" ]
426426
echo " replaced ${previous_version}"
427427
fi
428428

429+
# Said once, here, rather than on every future command: someone piping this
430+
# into `sh` is not going to read the man page before their first run.
431+
# Skipped when telemetry is already off, since there's nothing to opt out of.
432+
if telemetry_allowed; then
433+
cat <<EOF
434+
435+
Mapbox CLI collects telemetry by default. To disable it, set
436+
MAPBOX_CLI_NO_TELEMETRY=1 before running CLI commands.
437+
438+
Learn more: https://github.com/mapbox/mapbox-cli#privacy
439+
EOF
440+
fi
441+
429442
# Two separate things can be wrong, and both are worth saying: the install dir
430443
# may not be on PATH at all, and even when it is, a `mapbox` from somewhere
431444
# else may still come first.

0 commit comments

Comments
 (0)