Skip to content

feat: label CLI invocations with caller and skill (blocked on the next CLI release) - #31

Open
ziyiunity wants to merge 1 commit into
mainfrom
feat/attribute-cli-invocations
Open

feat: label CLI invocations with caller and skill (blocked on the next CLI release)#31
ziyiunity wants to merge 1 commit into
mainfrom
feat/attribute-cli-invocations

Conversation

@ziyiunity

@ziyiunity ziyiunity commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

What

Every unity command example in a skill that drives the Editor now passes --caller plugin --skill <name>, and unity-cli states the rule so it applies to the invocations no example covers:

Pass --caller plugin --skill <name> on every unity command invocation. --skill is the skill whose instructions produced the call, so a task skill that sends you here passes its own name rather than unity-cli.

Why

A CLI call made by this plugin is otherwise indistinguishable from one a user typed, so plugin usage cannot be told apart from CLI usage generally, and per-skill usage cannot be seen at all. The two flags carry that on the command line, which is the only place it can travel: by the time the CLI starts, nothing in the process, the args, or the environment records that a skill produced the call.

Coverage

All eight skills that invoke unity command:

unity-cli, audio-setup-mixers, optimize-audio, optimize-web, sprite-editor, urp-postprocessing, migrate-birp-to-urp, generate-editor-search-query

new-unity-project and unity-package-management drive the CLI too, but through unity install and unity projects, which do not take these flags — so their usage stays invisible to this. Worth knowing before reading any per-skill numbers.

Blocked on

The next CLI release, not on a code change. Both halves are merged and sitting in [Unreleased]:

  • CLI-951 added --caller and --skill to unity command.
  • CLI-1152 stopped --caller plugin folding to other, which it did on the first implementation.

Merging before that release ships would break these eight skills: the released CLI (1.0.0-beta.8) rejects --caller as an unknown option.

How To Test/Validate

Against a CLI built from dev, with a connected Editor:

unity command eval --caller plugin --skill unity-cli 'new UnityEngine.GameObject("Joe");'

The command behaves exactly as it does without the flags. To see the labels reach analytics, point the CLI at a local collector with UNITY_CLI_INTERNAL_ANALYTICS_URL and check caller and skill on the command executed event. Note that CLI analytics resolves to the anonymous consent row, so that row has to be opted in for anything to be sent.

Every `unity command` example in a skill that drives the Editor now passes
`--caller plugin --skill <name>`, and unity-cli states the rule so it
applies to invocations no example covers. CLI-951 added the two flags and
CLI-1152 made `--caller plugin` survive normalization rather than folding
to `other`.

Rebuilt on top of the unity-cli refresh (#36), which replaced that skill's
SKILL.md wholesale, and extended to migrate-birp-to-urp and
generate-editor-search-query, which landed after this branch was first
written and also invoke `unity command`.
@ziyiunity
ziyiunity force-pushed the feat/attribute-cli-invocations branch from 46ecea3 to 14c9fb7 Compare September 8, 2026 19:15
@ziyiunity ziyiunity changed the title feat: label CLI invocations with caller and skill (blocked on CLI-951) feat: label CLI invocations with caller and skill (blocked on the next CLI release) Sep 8, 2026
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