wcom-hub-tools 2026.12.4.4

dotnet tool install --global wcom-hub-tools --version 2026.12.4.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local wcom-hub-tools --version 2026.12.4.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=wcom-hub-tools&version=2026.12.4.4
                    
nuke :add-package wcom-hub-tools --version 2026.12.4.4
                    

wcom-hub-tools

wcom-hub-tools is a .NET global tool that runs the developer tasks every WCOM hub repository needs: a hub is a git repository whose code lives in submodules. The tool bootstraps a fresh clone, keeps submodules and worktrees current, sets up credentials and local settings, and restores and builds the hub's solutions.

The tool is compiled with Native AOT. Each supported platform gets its own self-contained native executable, so it starts in milliseconds and needs no .NET runtime to run.

Commands

Command Description
info Print the tool version, the runtime identifier, the hub root, and the configuration path
bootstrap Prepare a clone for development: prerequisites and tools, the Azure DevOps PAT and package-feed credentials, the Cursor MCP check, submodules, read-only exports, the pinned .NET SDK, the developer certificate, 1Password sign-in and local settings, short build drives, restore, npm install, and build. Run bootstrap --help for the switches
pull Fast-forward every submodule on its configured branch; --pull-parent also pulls the hub, --update-parent commits the new pointers, --merge-worktrees merges the default branch into extra worktrees
push Push every submodule with unpushed commits; --update-parent and --push-parent record and push the pointers
prune-worktrees Remove extra worktrees whose branch is merged into the remote default branch, then delete merged branches
export-readonly Download the read-only exports listed in the catalog as branch zips without .git
rebuild Restore and build every configured solution and npm project, then print durations and grouped errors and warnings
create-pr <title> Create an Azure DevOps pull request for the current branch (--target, --draft) through the REST API with the hub PAT
session pwsh Print a PowerShell script that loads the session environment and shortcuts into the calling shell
aliases List the session shortcuts
run <shortcut> [args] Run a session shortcut; arguments pass through unchanged
agent <session> [args] Run a prompted agent CLI session (Cursor agent by default, --claude for Claude Code)
skills sync / skills validate Copy canonical agent skills into each agent's skill folder, or validate their frontmatter
port-cleanup Remove maintainer-only files from a port branch and restore the files the target repository owns
monitoring sync Write local monitoring profiles (service URL and function key) from Azure, with findings for every step that needs someone to act

Every command that changes something takes --what-if and --confirm.

Loading the session

A child process cannot change its parent shell's environment, so the shortcuts and session variables come from a script the shell evaluates:

wcom-hub-tools session pwsh | Out-String | Invoke-Expression

The script contains no secrets. It reads the PAT from the user environment when it runs, sets the git extra header and the NuGet feed endpoints, adds the dotnet tools and Cursor Agent folders to PATH, maps the short build drives, and defines one function and alias per shortcut. Shortcuts call wcom-hub-tools run <name>, so they keep working after a tool update.

Shortcuts are strictly session-scoped. The script defines them in the scope that evaluates it, with Set-Alias -Scope Local and plain function definitions. It never uses -Scope Global or global:, and it never writes to a PowerShell profile. Evaluate it at the prompt, or dot-source the script that evaluates it (for example . .\newsh.ps1); a script run without the dot keeps the environment variables but loses the shortcuts when it ends. The session builtin shortcut (rda) has to be dot-sourced too: . rda.

Agent sessions

An agent session runs the agent CLI in print mode, one turn per process. The prompt tells the agent to write await-answer, await-continue, or done to a status file before ending the turn. The tool then asks for the next reply and continues the same conversation with --continue, or stops on done, stop, quit, or exit. Sessions with "loop": false run a single turn.

Install

Installing needs the .NET SDK 10 or later. Running the installed tool does not need .NET.

dotnet tool install --global wcom-hub-tools
dotnet tool update --global wcom-hub-tools

The package wcom-hub-tools is a small pointer package. The SDK picks the native package for your platform:

Platform Package
Windows x64 wcom-hub-tools.win-x64
Windows Arm64 wcom-hub-tools.win-arm64
Linux x64 wcom-hub-tools.linux-x64
macOS Arm64 wcom-hub-tools.osx-arm64
macOS x64 wcom-hub-tools.osx-x64

Finding the hub

Commands run against the hub that contains the current directory. Walking up from there, the nearest directory with .config/wcom-hub-tools.json is the hub. A hub without that file yet is the nearest git checkout that has a .gitmodules file, which also makes a submodule worktree under the hub resolve to the hub.

Hub configuration

Each hub describes itself in .config/wcom-hub-tools.json. Property names are camelCase and comments are allowed. Every section is optional, and a step whose section is missing is skipped.

Section Used by
name, parentBranch, worktreesFolder, logsFolder, logFilePrefix Every command
azureDevOps (organization, project, patEnvironmentVariable, patDisplayName, patScopes, patValidDays, feeds, mcp, additionalOrganizations) bootstrap, session, create-pr
telerikLicense (environmentVariable, pathEnvironmentVariable, onePasswordReference) bootstrap, session
scripts (name, path, arguments, phase, optional) bootstrap
dotnetSdkGlobalJson, prerequisites, tools, devCertificate bootstrap
discovery (scope, solutions, projectsWithoutSolution, npmProjects, templates, exclude, privateFeed) bootstrap, rebuild
azureCli (extensions, removeExtensions, tenants, tenantsFile, signIn) bootstrap
azureMcp (mode, package), docsMcp (url, requiredTools, cursorServerId) bootstrap
settings.opInject, settings.gsg bootstrap (templates ending in .tpl)
shortBuildPaths (nugetDrive, sourceDrive) bootstrap, session, rebuild (Windows only)
solutions, npmProjects, documentationFolder bootstrap
rebuild (solutions, npmProjects) rebuild
readOnlyExports bootstrap, export-readonly
shortcuts, nextSteps session, aliases, run, bootstrap summary
agentSessions agent and agent shortcuts
skills skills
portCleanup port-cleanup
monitoring monitoring sync

azureDevOps.additionalOrganizations lists the other organizations a hub's submodules, feeds, or MCP servers live in (for example a customer organization). Each entry takes the same keys as azureDevOps, needs its own patEnvironmentVariable (an entry that reuses another organization's variable is reported as a failed step and skipped, so one organization's PAT is never sent to another), and gets its own bootstrap step: the PAT is read from its patEnvironmentVariable, minted through the Tokens API with the sign-in for that organization's tenant, or prompted for. Every organization with a PAT gets its own git extraheader (GIT_CONFIG_KEY_n), its feeds are added to VSS_NUGET_EXTERNAL_FEED_ENDPOINTS, and the temp nuget.config used for restore carries credentials for every organization's feeds. session pwsh does the same from the user environment. An entry with an mcp section gets its own Cursor MCP check. The primary organization's PAT is read from its patEnvironmentVariable (default AZURE_DEVOPS_EXT_PAT).

telerikLicense turns on the Telerik license step. It clears pathEnvironmentVariable (default TELERIK_LICENSE_PATH) for the run so an old license file cannot win over the key, then sets environmentVariable (default TELERIK_LICENSE) from the process, the user environment, op read <onePasswordReference>, or a hidden prompt. --persist-pat also stores it in the user environment; session pwsh imports it from there and clears the path variable in that shell too.

scripts runs hub scripts as bootstrap steps with pwsh -NoProfile -File, for behaviour that belongs to one hub only. phase is afterSubmodules (after Submodules: update) or end (default, after restore and build). A non-zero exit, a missing script, or a script outside the hub fails the step; set optional: true to report it as a warning instead.

prerequisites holds the machine checks:

Key Check
wsl, nodeMinimumMajor, nodeWingetPackage WSL (Windows) and the Node.js version
dotnetSdks Extra SDK majors, for example [8, 9], installed with winget (Microsoft.DotNet.SDK.<major>)
dotnetRuntimes Shared runtimes as name major, for example Microsoft.AspNetCore.App 9, installed with winget
dotnetRuntimesFromProjects Reads TargetFramework(s) from the projects in the discovery scope and installs each missing Microsoft.NETCore.App version for the current user with dotnet-install (into ~/.dotnet)
containers (accept, installWslc) The first of wslc, podman, docker on PATH; on Windows a missing runtime installs wslc with wsl --update --pre-release. Docker Desktop is never installed
bicep always, or auto when the discovery scope has *.bicep files: az bicep install, or az bicep upgrade when GitHub has a newer release
ssdt always, or auto when a solution has a legacy (non SDK-style) .sqlproj: finds an MSBuild with SSDT (Visual Studio with the SSDT component, then Build Tools with the data workload) and otherwise installs the Build Tools data workload with winget (ssdtWingetPackage, default Microsoft.VisualStudio.2022.BuildTools)

A solution with a legacy SQL project is always built with that MSBuild (-restore /t:Build, Windows only) instead of dotnet restore and dotnet build; rebuild does the same.

A tool with installScript (an https URL) and install: true runs that PowerShell installer when the command is missing, for vendors that ship one (for example Claude Code). The script runs with -ExecutionPolicy Bypass as the current user, so installScript is trusted like any other code in the hub; set installScriptSha256 to run only a script with that hash. A dotnetTool such as claudomat installs from nuget.org.

discovery adds solutions, npm projects, and *.tpl settings templates (as settings.opInject entries) after the explicit lists. scope is submodules (default: each submodule folder) or hub (the whole hub); exclude lists folder names never searched (.worktrees, code, node_modules, bin, obj, .git, packages). A .slnx wins over a .sln of the same name in the same folder, and projectsWithoutSolution falls back to the *.csproj and *.fsproj files of a submodule without a solution. privateFeed is auto (the nearest nuget.config lists pkgs.dev.azure.com; without one, whether azureDevOps.feeds is set), always, or never. Discovery runs when the plan is made and again after Submodules: update, so with discovery.solutions the restore and build steps are one Restore solutions and one Build solutions step that cover every solution.

azureCli.extensions are added, or updated unless --no-update-check; removeExtensions are removed when present. tenants (or the tenants array in tenantsFile) lists name, tenantId, account, and accountPattern, in sign-in order. Each tenant's token is checked with az account get-access-token; a missing token, or an account that does not match accountPattern, starts az login --tenant (device code as fallback) in an interactive session. The last tenant signed in becomes the Azure CLI default. --az-login signs in to every tenant again; --no-az-login, --no-pat-prompt, or signIn: false only report.

azureMcp checks the Azure MCP server: mode: global needs azmcp on PATH and installs @azure/mcp with npm install -g (with --allow-scripts on npm 12 and later); mode: npx only checks for npx. docsMcp initializes an MCP session against url (default https://learn.microsoft.com/api/mcp), checks that tools/list has requiredTools, then runs agent mcp enable and agent mcp list-tools for cursorServerId (default microsoft-learn).

A shortcut has a name, an optional alias, a description, and a type:

Type Runs
builtin Another tool command; path holds the command line, for example pull --pull-parent. PowerShell-style switches such as -MergeWorktrees become --merge-worktrees
npm-dev npm install when packages are missing, then npm run dev in path
dotnet-run dotnet run --project <path>
exec command with arguments in path
pwsh The PowerShell script at path
agent The agent session named in path

Example:

{
  "name": "Example",
  "azureDevOps": {
    "organization": "contoso",
    "project": "Platform",
    "patEnvironmentVariable": "AZURE_DEVOPS_EXT_PAT",
    "feeds": [ "https://pkgs.dev.azure.com/contoso/Platform/_packaging/Internal/nuget/v3/index.json" ]
  },
  "dotnetSdkGlobalJson": "Example.Api/global.json",
  "prerequisites": { "nodeMinimumMajor": 24 },
  "tools": [
    { "command": "op", "purpose": "rendering local settings", "winget": "AgileBits.1Password.CLI" },
    { "command": "gsg", "purpose": "syncing local settings", "dotnetTool": "gsg" }
  ],
  "settings": { "gsg": [ { "name": "Web env", "template": "Example.Web/.env.local.tpl" } ] },
  "solutions": [ { "name": "Api", "path": "Example.Api/src/Example.Api.slnx", "privateFeed": true } ],
  "npmProjects": [ "Example.Web" ],
  "shortcuts": [
    { "name": "run-web", "alias": "rw", "description": "Example.Web (npm run dev)", "type": "npm-dev", "path": "Example.Web" },
    { "name": "pull-submodules", "alias": "psm", "description": "pull hub + submodules", "type": "builtin", "path": "pull --pull-parent" },
    { "name": "review", "description": "review a work item", "type": "agent", "path": "review" }
  ],
  "agentSessions": {
    "review": {
      "requireArguments": true,
      "argumentPatterns": [ "_workitems/edit/(\\d+)", "^\\s*(\\d+)\\s*$" ],
      "prompt": "Review work item {arguments}. Status file: {statusFile}",
      "choices": [ { "label": "Continue", "aliases": [ "c" ] }, { "label": "Stop", "aliases": [ "s" ] } ]
    }
  }
}

Prompt placeholders are {arguments}, {statusFile}, {session}, and {hub}. cursorArguments and claudeArguments replace the default CLI arguments of a session, and {hub} works in those too.

PAT and elevation

The PAT is never taken from the command line. bootstrap reads the primary organization's PAT from the process environment variable named by azureDevOps.patEnvironmentVariable (default AZURE_DEVOPS_EXT_PAT), then mints one through the Tokens API, then asks with a hidden prompt. --pat is kept as a hidden option only to reject it: bootstrap --pat <value> stops with an error that points to the environment variable, and the error does not repeat the value. A caller that has a PAT (for example a hub start-development.ps1 -Pat) sets AZURE_DEVOPS_EXT_PAT in the environment block of the tool process only, so the PAT is not on any command line and not in the caller's own environment. The tool itself does not write its command line to the log.

The elevated winget retry is opt-in. When a per-user winget install of the .NET SDK or of a per-user tool fails, bootstrap retries it elevated (a UAC prompt) only with --allow-elevation or WCOM_HUB_ALLOW_ELEVATION=1 in the process environment, and only in an interactive session that is not already elevated. Without the switch it does not start the UAC prompt and says that the retry is off and how to allow it. The WSL and wslc installs are not retries: they still run elevated when the session is not elevated, because Windows requires it.

Build

dotnet build src/Wcom.HubRepo.Tools.slnx --configuration Release
dotnet test --solution src/Wcom.HubRepo.Tools.slnx --configuration Release

Pack on the platform you are on. A plain dotnet pack builds the pointer package and every native package the current OS can compile (Native AOT does not cross-compile between operating systems):

dotnet pack src/Wcom.HubRepo.Tools/Wcom.HubRepo.Tools.csproj --configuration Release -o artifacts

Native AOT needs the platform toolchain: on Windows the Visual Studio "Desktop development with C++" workload (plus the C++ Arm64 build tools for win-arm64), on Linux clang and zlib1g-dev, on macOS the Xcode command line tools.

Install a local build into a scratch folder. Run it outside this repository: the repository nuget.config maps every package to NuGet.org, and --add-source cannot be combined with source mapping.

dotnet tool install wcom-hub-tools --tool-path ./tool --add-source <repo>/artifacts --version <version>

Release

azurepipeline.yaml builds and tests on every branch, then packs on Windows, Linux, and macOS agents and smoke-tests the installed tool on each. On main it pushes the native packages, then the pointer package, to NuGet.org. The package version is the pipeline run number (yyyy.MM.dd.revision).

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2026.12.4.4 13 12/4/2026
2026.12.4.1 57 12/4/2026
2026.12.3.7 59 12/3/2026
2026.12.2.1 60 12/2/2026