Make `sam init` work with custom locations with multiple templates
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 1.2k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 52
Description
### Describe your idea/feature/enhancement
When running `sam init` the user is guided through a drill-down UI based on the content of [aws/aws-sam-cli-app-templates](https://github.com/aws/aws-sam-cli-app-templates). It seems to be controlled by the [manifest.json](https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest.json) file in the root.
Users who want to develop custom project templates are instructed to use the `--location` option, like `sam init --location gh:myorg/myrepo`. However, that expects a single project template in the root of that repo which leads organisations who want to provide more than one custom project template to use multiple repositories which quickly gets hard to maintain.
### Proposal
Allow users to design custom repositories the same way as [aws/aws-sam-cli-app-templates](https://github.com/aws/aws-sam-cli-app-templates) which get presented the same way as the default templates when running `sam init --location ...`
It looks like cookiecutter 1.7 supports defining a `--directory` ([docs](https://cookiecutter.readthedocs.io/en/2.0.2/advanced/directories.html))
### Additional Details
I maintain [sam-patterns-cli](https://github.com/mhlabs/sam-patterns-cli) - a tool that lets developers merge in SAM patterns from serverlessland.com/patterns into their templates. I've recently added a command to it that lets users initialise projects based on the templates in [aws/aws-sam-cli-app-templates](https://github.com/aws/aws-sam-cli-app-templates) with the option to add custom repositories that follow the same structure.
Here I've configured the tool to include a custom location:

I'm hoping to be able to use this way of structuring custom templates with `sam-cli` to avoid diverging away from it and keep backward compatability
Contributor guide
Assessment
This issue has not been assessed yet.