Environment specific build using cli

We have different environments for our app. For building the app for different env. we manually make the required changes which consumes a lot of our time. Is there any way to create an environment specific build using cli?