Context. skills/unity-pipeline/references/editor-commands.md is currently produced in two manual steps: a unity --json command dump taken from a live editor (categorized part, tools/gen-commands-md.js) plus a hand-extracted RuntimeOnly section from the package source. Regular updates would require a running Unity Editor with the package installed.
Source of truth. The complete com.unity.pipeline package, with C# sources of every command, is publicly available on the UPM registry with no auth:
- version list:
https://packages.unity.com/com.unity.pipeline (JSON; versions, each with dist.tarball);
- the tarball contains
Editor/Commands/*.cs and Runtime/Commands/*.cs with all [CliCommand]/[CliArg] attributes.
On 0.4.0-exp.1 the sources declare 154 [CliCommand] methods — a strict superset of the live listing (140), including every RuntimeOnly command hidden from the listing, and capture_editor_element, which appears nowhere else. Descriptions and argument metadata match the live listing.
What to build. A C# console project (net8+, Roslyn Microsoft.CodeAnalysis.CSharp; no other external dependencies), which:
- Takes the package version as an argument, or
latest for the highest entry in the registry versions.
- Downloads the tarball via
dist.tarball and unpacks it to a temp directory (HttpClient, GZipStream + System.Formats.Tar).
- Parses
[CliCommand] / [CliArg] attributes and parameter signatures (C# type, default value) from the syntax tree, not with regexes: attributes span multiple lines, and a [CliArg] default falls back to the C# parameter default when the attribute sets no DefaultValue. Excludes Tests/ — it holds registration fixtures (log_editor, test_types, test_structured), not real commands.
- Generates
editor-commands.md in full: preamble with the package version, categorized sections (categories from source directories Editor/Commands/<Category>/), and a section for RuntimeOnly commands hidden from the live listing. No manually maintained part remains.
- Prints a diff summary against the current file: added / removed / changed commands and arguments.
Project-defined commands are out of scope — the reference documents the package surface only.
CI. A bare runner with the .NET SDK: dotnet run --project tools/CommandRefGen -- --version latest → updated file + diff summary in the log. Triggered manually or by the release-watch workflow from #2, which polls the same versions endpoint.
Replaces tools/gen-commands-md.js.
Acceptance criteria:
- a run on a clean machine without Unity produces a file equivalent to the current one (modulo newly added commands);
- the RuntimeOnly section is generated, not hand-maintained;
- a package version bump is a rerun with a different argument, no code edits.
Context.
skills/unity-pipeline/references/editor-commands.mdis currently produced in two manual steps: aunity --json commanddump taken from a live editor (categorized part,tools/gen-commands-md.js) plus a hand-extracted RuntimeOnly section from the package source. Regular updates would require a running Unity Editor with the package installed.Source of truth. The complete
com.unity.pipelinepackage, with C# sources of every command, is publicly available on the UPM registry with no auth:https://packages.unity.com/com.unity.pipeline(JSON;versions, each withdist.tarball);Editor/Commands/*.csandRuntime/Commands/*.cswith all[CliCommand]/[CliArg]attributes.On
0.4.0-exp.1the sources declare 154[CliCommand]methods — a strict superset of the live listing (140), including every RuntimeOnly command hidden from the listing, andcapture_editor_element, which appears nowhere else. Descriptions and argument metadata match the live listing.What to build. A C# console project (
net8+, RoslynMicrosoft.CodeAnalysis.CSharp; no other external dependencies), which:latestfor the highest entry in the registryversions.dist.tarballand unpacks it to a temp directory (HttpClient,GZipStream+System.Formats.Tar).[CliCommand]/[CliArg]attributes and parameter signatures (C# type, default value) from the syntax tree, not with regexes: attributes span multiple lines, and a[CliArg]default falls back to the C# parameter default when the attribute sets noDefaultValue. ExcludesTests/— it holds registration fixtures (log_editor,test_types,test_structured), not real commands.editor-commands.mdin full: preamble with the package version, categorized sections (categories from source directoriesEditor/Commands/<Category>/), and a section for RuntimeOnly commands hidden from the live listing. No manually maintained part remains.Project-defined commands are out of scope — the reference documents the package surface only.
CI. A bare runner with the .NET SDK:
dotnet run --project tools/CommandRefGen -- --version latest→ updated file + diff summary in the log. Triggered manually or by the release-watch workflow from #2, which polls the sameversionsendpoint.Replaces
tools/gen-commands-md.js.Acceptance criteria: