Skip to content

fix(cli): use alias name for template id#15402

Merged
wh-alice merged 5 commits intorelease/6.5from
nintan/fix-template-alias
Mar 4, 2026
Merged

fix(cli): use alias name for template id#15402
wh-alice merged 5 commits intorelease/6.5from
nintan/fix-template-alias

Conversation

@tecton
Copy link
Contributor

@tecton tecton commented Mar 3, 2026

https://msazure.visualstudio.com/Microsoft%20Teams%20Extensibility/_workitems/edit/36965071/

Effect:
image

This pull request introduces support for template aliases in the TeamsFx CLI, allowing users to refer to templates using more user-friendly or standardized names. The changes update the template metadata, CLI logic, and output formatting to utilize these aliases, improving the developer experience and making the CLI commands more intuitive.

Template alias support and metadata enhancements:

  • Added an optional alias field to the Template interface and updated all relevant template entries in allTemplates.json to include meaningful aliases (e.g., declarative-agent, bot, teams-agent, etc.), as well as displayName where appropriate. This enables referencing templates by alias in CLI commands and outputs. [1] [2] [3] [4]
  • Updated the template listing and selection logic in the CLI to prefer displaying and matching on alias when available, falling back to name otherwise. This affects template choice lists, table outputs, and command matching. [1] [2] [3] [4] [5] [6] [7]

CLI command and example improvements:

  • Changed default and example CLI commands to use the new template aliases, such as replacing copilot-gpt-basic with declarative-agent in help messages and examples. [1] [2]

Other updates:

  • Updated the advanced DA setting URL in the M365 constants to a new endpoint.
  • Renamed the foundry-agent template to foundry-agent-to-m365 for clarity and consistency.

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.30%. Comparing base (9b7655a) to head (5c8239d).
⚠️ Report is 6 commits behind head on release/6.5.

Files with missing lines Patch % Lines
packages/cli/src/commands/models/create.ts 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           release/6.5   #15402   +/-   ##
============================================
  Coverage        89.29%   89.30%           
============================================
  Files              620      620           
  Lines            38068    38073    +5     
  Branches          7742     7723   -19     
============================================
+ Hits             33992    34000    +8     
+ Misses            1973     1972    -1     
+ Partials          2103     2101    -2     
Files with missing lines Coverage Δ
packages/cli/src/commands/models/listTemplates.ts 98.14% <100.00%> (+2.14%) ⬆️
packages/fx-core/src/component/m365/constants.ts 100.00% <100.00%> (ø)
packages/cli/src/commands/models/create.ts 93.18% <83.33%> (+4.80%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants