Overall, I like the general direction - I think it would be very nice to separate the concerns of create/import as proposed and definitely would like to see templates.
I would suggest a few things to be considered in the context of making it more usable for teams who shares templates:
- Instead of storing templates in the local file system and then supporting importing them from an URL creating a local template copy, I would suggest support configuring an URL "search path" (either as an environment variable, or as a configuration file, but its basically a list of URL:s each one containing a template, these would always be git repos either on remote server or on disk)
This set of URL:s would be used to directly download the latest version of a given template at package creation time, so local file system copies don't go stale. Basically just pull it from the server/disk with git each time as needed from the URL.
In the best of worlds, one would just configure a single additional URL (which would be either pointing to a server or to a local file) which in turns provides the list of template-URL:s that should be searched in e.g. JSON or similar.
This way, an organization can provide one simple configuration setting, which would dynamically pull in the appropriate templates in use by the organization.
Template names could be specified by the final path component of the URL.
The built-in templates provided by SPM in the toolchain would always be appended to this search path and be part of the toolchain distro. These would be picked up from the file system. One could then have e.g. 'application' and 'library' default templates shipped with the toolchain.
Have 'swift package create' list the templates available if no arguments were provided displaying both the ones found from the URL and the built-in ones.
Consider conflating type with the template, this would give a nice ergonomic for creation:
swift package create <templatename> packageName
swift package create application myApp
swift package create library myLib
or custom for an organisation that defined a new template:
swift package create company-standard-app myCompanyApp
swift package create company-standard-lib myCompanyLib
The downside is that the default SPM templates "application" or "library" in this example would be duplicated in terms of structure, but it would be easier for the end users IMO to simply skip extra arguments and instead have a consistent workflow where a template always is used.
Could still allow overriding the defined type with e.g.
--type if desired.