Summary
When running azd init -t <template>, template files are extracted directly into the current working directory. This scatters template files among existing project files, which surprises users.
Users expect azd init -t to work like git clone — automatically creating a new folder named after the template and initializing the project inside it.
User Study Finding (from #4032)
Several participants ran init in a non-empty directory and were surprised when the template files scattered among their existing files (vs in a contained folder). "Would have preferred if it went into a folder kind of like how GitHub does when you clone things."
Proposed Behavior
# Auto-creates folder, initializes inside it
$ azd init -t todo-nodejs-mongo
Initializing project in 'todo-nodejs-mongo'...
→ creates todo-nodejs-mongo/, inits everything inside it
# Explicit folder name
$ azd init -t todo-nodejs-mongo my-project
→ creates my-project/
# Opt-in to current directory (preserves existing behavior)
$ azd init -t todo-nodejs-mongo .
→ initializes in current directory
Key Details
- Add optional
[directory] positional argument to azd init
- Auto-derive folder name from template path (following
git clone conventions)
os.Chdir() into the new folder within the azd process so the entire init pipeline (template extraction, azure.yaml, git init, --up) operates from inside
- Print post-init message with
cd hint for the user's shell
. as directory preserves current behavior
--from-code and --minimal modes unchanged (always use CWD)
Related
Summary
When running
azd init -t <template>, template files are extracted directly into the current working directory. This scatters template files among existing project files, which surprises users.Users expect
azd init -tto work likegit clone— automatically creating a new folder named after the template and initializing the project inside it.User Study Finding (from #4032)
Proposed Behavior
Key Details
[directory]positional argument toazd initgit cloneconventions)os.Chdir()into the new folder within the azd process so the entire init pipeline (template extraction, azure.yaml, git init,--up) operates from insidecdhint for the user's shell.as directory preserves current behavior--from-codeand--minimalmodes unchanged (always use CWD)Related