Skip to content

Add CLI agent instrumentation#779

Merged
zahlekhan merged 3 commits into
thesysdev:mainfrom
zahlekhan:agent/add-cli-agent-instrumentation
Jul 16, 2026
Merged

Add CLI agent instrumentation#779
zahlekhan merged 3 commits into
thesysdev:mainfrom
zahlekhan:agent/add-cli-agent-instrumentation

Conversation

@zahlekhan

Copy link
Copy Markdown
Contributor

What changed

  • add a global --agent-name option with agent-facing guidance in root and subcommand help
  • record the declared value as agent_name, defaulting to unknown
  • detect known Codex, Claude Code, Cline, Factory Droid, and Pi markers as detected_agent_name
  • return unknown when no marker exists and ambiguous when markers conflict
  • record the package manager selected for scaffold dependency installation as package_manager
  • document that declared and detected attribution are both spoofable and are not authentication signals

Why

CLI usage needs two independent agent-attribution signals: an explicit declaration that works for any invoking agent and best-effort environment detection when the declaration is omitted. Keeping both fields preserves their provenance and avoids treating either spoofable signal as trusted identity.

Impact

AI agents can pass a stable lowercase kebab-case product slug, for example --agent-name codex. Human invocations can omit the option and retain the unknown default. Create-flow events report the selected npm, pnpm, yarn, or bun installer. Existing telemetry opt-out behavior remains unchanged.

Validation

  • TypeScript CLI build
  • ESLint on packages/openui-cli/src
  • Prettier checks on changed CLI and documentation files

@zahlekhan zahlekhan marked this pull request as ready for review July 15, 2026 18:46
@zahlekhan zahlekhan merged commit 7901d58 into thesysdev:main Jul 16, 2026
2 checks passed
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.

2 participants