From 6a11c772f4481e57338b3777b8634b75ece48790 Mon Sep 17 00:00:00 2001 From: Matthew Podwysocki Date: Tue, 22 Sep 2026 13:49:12 -0400 Subject: [PATCH] Document an agent- convention for MAPBOX_CLI_INSTALL_SOURCE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Distinguishing an install a coding agent triggered on someone's behalf from a human or CI one is useful signal, and the installers already have a mechanism that carries it: MAPBOX_CLI_INSTALL_SOURCE, which rides along in the User-Agent as `src/`. Comment-only in both installers — agent- (agent-claude-code, agent-cursor), so an access-log query can tell these apart without a second reporting mechanism the way Atlassian's twg installer stands up for the same question. A dash rather than the slash an earlier proposal used: both installers' existing sanitizer strips `/`, so agent/claude-code would silently collapse into agentclaude-code and lose the separator that makes the convention legible. Freeform otherwise, same as every other value here — no fixed list of agent names to keep in sync in either installer. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 8 ++++++++ scripts/install.ps1 | 9 +++++++++ scripts/install.sh | 9 +++++++++ 3 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 496775d..c409066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,14 @@ that may never merge. They are not releases and are not listed here. ### Added +- `install.sh`/`install.ps1` now document a convention for `MAPBOX_CLI_INSTALL_SOURCE` + when a coding agent invokes the installer on someone's behalf: `agent-` + (`agent-claude-code`, `agent-cursor`), so an access-log query can tell those + installs apart from a human or CI one. A dash rather than the slash an + earlier proposal used — `/` is stripped by the installers' own sanitizer, + which would have collapsed `agent/claude-code` into `agentclaude-code` and + lost the separator. Comment-only: neither installer's behavior changed. + - The README now documents installing without the install script: the archives are plain HTTP downloads, `manifest.json` lists every target with its checksum, and the commands to verify and extract one are written out. diff --git a/scripts/install.ps1 b/scripts/install.ps1 index e9364a0..9734a2f 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -91,6 +91,15 @@ # provisioning script, CI - and it rides along as `src/`. # Everything but letters, digits, dot, dash and underscore is dropped, # because this value comes from the environment and ends up in a header. + # + # Convention for a coding agent invoking this script on someone's behalf: + # agent- - agent-claude-code, agent-cursor - so an access-log query + # can tell an agent-driven install from a human or CI one without a second + # reporting mechanism. A dash, not a slash: / is one of the characters the + # sanitizer below strips, so agent/claude-code would silently become + # agentclaude-code and lose the separator that makes the convention + # legible. Freeform otherwise, the same as every other value here - no + # fixed list of agent names to keep in sync. $InstallSource = $env:MAPBOX_CLI_INSTALL_SOURCE # The switch src/telemetry.rs honors for the CLI's own User-Agent, read diff --git a/scripts/install.sh b/scripts/install.sh index 7ee88cf..dbf91d8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -74,6 +74,15 @@ USER_AGENT='mapbox-cli-install/1' # as `src/`. Everything but letters, digits, dot, dash and underscore is # dropped, because this value comes from the environment and ends up in a # header. +# +# **Convention for a coding agent invoking this script on someone's behalf:** +# `agent-` — `agent-claude-code`, `agent-cursor` — so an access-log query +# can tell an agent-driven install from a human or CI one without a second +# reporting mechanism. A dash, not a slash: `/` is one of the characters the +# sanitizer above strips, so `agent/claude-code` would silently become +# `agentclaude-code` and lose the separator that makes the convention legible. +# Freeform otherwise, the same as every other value here — no fixed list of +# agent names to keep in sync. INSTALL_SOURCE="${MAPBOX_CLI_INSTALL_SOURCE:-}" # The switch `src/telemetry.rs` honors for the CLI's own User-Agent, read here