Description
Describe the bug
Cannot generate Teams App with Teams App CLI
To Reproduce
Install TeamsApp CLI: npm install-g @microsoft/teamsapp-cli
Run:
teamsapp new --capability "declarative-agent" --app-name "Hello World Declarative Agent" -programming-language "typescript" -folder "HelloWorldTS9" --interactive false --debug --verbose --with-plugin no
Expected behavior
Generates the Declarative Agent.
CLI Information (please complete the following information):
- Windows
- CLI Version 3.0.6
Additional context
I found a reference in https://github.com/OfficeDev/teams-toolkit/blob/db74b8ef97719a51fd4676636627a9567bd09ad3/packages/fx-core/src/component/generator/templates/templateNames.ts#L59 that might be the point in which this isn't aligning to the templates.
Error details:
teamsapp new --capability "declarative-agent" --app-name "HelloWorldDeclarativeAgent" -programming-language "typescript" -folder "HelloWorldTS10" --interactive false --debug --verbose --with-plugin no
user argument list: ["new","--capability","declarative-agent","--app-name","HelloWorldDeclarativeAgent","-programming-language","typescript","-folder","HelloWorldTS10","--interactive","false","--debug","--verbose","--with-plugin","no"]
matched command: teamsapp new
find option: {"token":"--capability","option":"capability","value":"declarative-agent","isGlobal":false}
find option: {"token":"--app-name","option":"app-name","value":"HelloWorldDeclarativeAgent","isGlobal":false}
find option: {"token":"-programming-language","option":"programming-language","value":"typescript","isGlobal":false}
find option: {"token":"-folder","option":"folder","value":"HelloWorldTS10","isGlobal":false}
find option: {"token":"--interactive","option":"interactive","value":false,"isGlobal":true}
find option: {"token":"--debug","option":"debug","value":true,"isGlobal":true}
find option: {"token":"--verbose","option":"verbose","value":true,"isGlobal":true}
find option: {"token":"--with-plugin","option":"with-plugin","value":"no","isGlobal":false}
parsed context: {
"optionValues": {
"capabilities": "declarative-agent",
"app-name": "HelloWorldDeclarativeAgent",
"programming-language": "typescript",
"folder": "HelloWorldTS10",
"with-plugin": "no",
"nonInteractive": true,
"correlationId": "d48fea02-7791-48b3-9583-043b98d7e2aa",
"platform": "cli"
},
"globalOptionValues": {
"interactive": false,
"debug": true,
"verbose": true
},
"argumentValues": [],
"telemetryProperties": {
"command-name": "teamsapp new",
"component": "cli",
"run-from": "Other",
"bin-name": "teamsapp",
"command-debug": "true",
"command-verbose": "true",
"command-help": "undefined",
"command-interactive": "false",
"command-version": "undefined"
}
}
sendTelemetryEvent ===> create-project-start, properties: {"bin-name":"teamsapp","command-name":"teamsapp new","component":"cli","run-from":"Other","command-debug":"true","command-verbose":"true","command-help":"undefined","command-interactive":"false","command-version":"undefined","success":"yes","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"project-type","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"capabilities","answer":"declarative-agent","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"with-plugin","answer":"no","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"folder","answer":"","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"app-name","answer":"","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> create-start, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"coordinator","env":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryEvent ===> generate-template-start, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"copilot-extension-from-scratch-generator","env":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
Downloading app template "copilot-gpt-basic-ts" to D:\temp\examples-for-blog\HelloWorldTS10\HelloWorldDeclarativeAgent
Fetching zip from local: {"name":"copilot-gpt-basic","language":"ts","destination":"D:\temp\examples-for-blog\HelloWorldTS10\HelloWorldDeclarativeAgent","logProvider":{"logLevel":1}}
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 6% | [1/1] Create: App template download in progress... (×) Failed.
sendTelemetryErrorEvent ===> generate-template, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"copilot-extension-from-scratch-generator","env":"","template-name":"copilot-gpt-basic-ts","is-declarative-copilot":"true","is-microsoft-entra":"","need-add-plugin-from-existing":false,"success":"no","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"Coordinator","error-stage":"createProject","error-method":"create","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryErrorEvent ===> create, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"coordinator","env":"","capabilities":"declarative-agent","is-from-developer-portal":"false","success":"no","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"Coordinator","error-stage":"createProject","error-method":"create","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryErrorEvent ===> create-project, properties: {"bin-name":"teamsapp","command-name":"teamsapp new","component":"cli","run-from":"Other","command-debug":"true","command-verbose":"true","command-help":"undefined","command-interactive":"false","command-version":"undefined","success":"no","new-project-id":"d91b7a63-43f6-4723-99eb-7cc6b096275e","is-creating-m365":"undefined","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"","error-stage":"","error-method":"","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa"}, measurements: undefined
(×) Error: gen.TemplateNotFoundError: Unable to find template: copilot-gpt-basic.
Call stack: TemplateNotFoundError: Unable to find template: copilot-gpt-basic.
at TemplateNotFoundError.toFxError (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2312260)
at Object.templateDefaultOnActionError [as onActionError] (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2402027)
at Generator.generate (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2401559)
at async CopilotExtensionGenerator.scaffolding (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2484548)
at async CopilotExtensionGenerator.run (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2482798)
at async CopilotExtensionGenerator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2568592)
at async Coordinator.create (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:1799891)
at async Coordinator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2568592)
at async Coordinator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:1701963)
at async FxCore.createProject (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2663881)