-
Notifications
You must be signed in to change notification settings - Fork 26
Add ability to generate starter compose/device/application services via CLI #351
Description
🚀 Feature Request
Description
As a developer trying to frequently create EdgeX-based solutions, I have found myself needing a capability that Angular CLI offers - the ability to generate a new project using the command line.
Describe the solution you'd like
For example:
# Angular's CLI generates a completely new project based off of a template using this command, and asks a few questions:
ng new
# ? What name would you like to use for the new workspace and initial project? test
# ? Would you like to add Angular routing? Yes
# ? Which stylesheet format would you like to use? CSS
# similarly, an EdgeX CLI generator capability would look like:
edgex new
# What would you like to name your project? [my-edgex-project]
# Which EdgeX version would you like to use for the compose file? [hanoi]
# Would you like a sample device service to be added? [y/n]
# Would you like a sample application service to be added? [y/n]The edgex-cli program proceeds to generate a Hanoi compose with sample device/app services in place.
Additionally, the EdgeX CLI generator capability can continue to follow the Angular CLI by allowing for one-off service generation commands:
# angular: generates a "data" service in angular
ng g service data # shorthand of "ng generate service data"
# edgex: generates an application service
edgex g ds my-device-service-name # shorthand of "edgex generate device-service"
edgex generate app my-app-service-name # shorthand of "edgex generate application-service"Acceptable permutations could be:
edgex g ds
edgex g dev
edgex g device-service
edgex generate ds
edgex generate dev
edgex generate device-service
edgex g as
edgex g app
edgex g app-service
edgex g application-service
edgex generate as
edgex generate app
edgex generate application-service
edgex generate app-serviceI am indifferent on whether or not this feature should hook into any existing Git repositories in the users' local directory. It may be easier to just simply generate the files for the initial release of this capability, and have the user migrate them to their own repositories later. The time and confusion saved by having this feature makes a big difference - the Angular CLI adds an extremely valuable developer experience to their ecosystem, and I think that having this feature in EdgeX would make a difference too.
Describe alternatives you've considered
I've looked at the edgex-cli and it does not appear to have this capability. We can likely utilize the EdgeX examples repository and developer scripts repository to help bootstrap the development of this feature.