Skip to content

Record Link CLI command usage in AEL - #378

Closed
ericgan-stripe wants to merge 4 commits into
mainfrom
codex/link-cli-command-telemetry
Closed

ericgan-stripe wants to merge 4 commits into
mainfrom
codex/link-cli-command-telemetry

Conversation

@ericgan-stripe

@ericgan-stripe ericgan-stripe commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Each resolved Link CLI command now sends one CLI Command event to r.stripe.com when dispatched, including commands invoked as MCP tools. An offline command produces an event, while authentication refreshes and API retries within one command do not add events.

Events contain the canonical command path, CLI version, and recognized AI agent when available. They exclude arguments, credentials, API requests, and results. DO_NOT_TRACK and LINK_CLI_TELEMETRY_OPTOUT disable sending; AEL failures do not change command output or exit status. Events count dispatches, including commands that later fail, and do not include a success/failure field.

Validation

  • Built the Link SDK and CLI packages; CLI typecheck and Biome checks pass.
  • 10 built-CLI integration tests pass, covering direct commands, API retries, invalid flags, opt-out, AEL failures, stdio MCP, and HTTP MCP.

Emit one best-effort event for each resolved CLI or MCP command so usage can be measured by command, CLI version, and detected AI agent. Reuse the dedicated AEL client configuration without counting underlying API retries.

Record dispatches before flag validation; outcome is intentionally absent because Incur does not expose a reliable command result to shared middleware.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@ericgan-stripe
ericgan-stripe requested a review from a team as a code owner September 30, 2026 15:24
ericgan-stripe and others added 3 commits September 30, 2026 11:31
Match the repository Biome formatter so the CI formatting gate passes.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
The combined help, version, and unknown-command test starts three CLI processes; give it enough time under loaded CI runners.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
The comparison launches two CLI processes and exercises the bounded telemetry flush, which can exceed the default test timeout on loaded CI runners.

Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant