> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Switch environments with command-line arguments

> Let the launcher pick its deployment environment from a command-line argument such as --env=qa.

You can switch the launcher between deployment environments with a command-line argument. This workflow snippet reads `--env` and uses `qa` or `stage` if it finds them, or `production` otherwise:

```bash theme={null}
launcher.exe --env=qa
launcher.exe --env=stage
```

```json workflow.json theme={null}
"qaOrNot": {
  "type": "stringContains",
  "stringOne": "{CommandLine:env}",
  "stringTwo": "qa",
  "found": "setQA",
  "notFound": "stageOrNot"
},
"stageOrNot": {
  "type": "stringContains",
  "stringOne": "{CommandLine:env}",
  "stringTwo": "stage",
  "found": "setStage",
  "notFound": "setProduction"
},
"setQA": {
  "type": "macro",
  "keyValuePairs": { "userEnvironment": "qa" }
},
"setStage": {
  "type": "macro",
  "keyValuePairs": { "userEnvironment": "stage" }
},
"setProduction": {
  "type": "macro",
  "keyValuePairs": { "userEnvironment": "production" }
},
"loadMacros": {
  "type": "macro",
  "keyValuePairs": {
    "repositoryName": "mygame.env.{userEnvironment}",
    "repositoryMetafile": "mygame",
    "repositoryTitle": "My Game: {userEnvironment}",
    "repositoryLauncher": "mylauncher.production",
    "repositoryAliasUrl": "https://cdn.example.com/aliases.json",
    "repositoryCatalogUrl": "https://cdn.example.com/",
    "executableName-win": "binaries/game.exe",
    "installDirectory": "{moduleDirectory}Download{pathSlash}",
    "selfUpdateDirectory": "{moduleDirectory}"
  }
},
"load": {
  "type": "queue",
  "concurrentTasks": 1,
  "actions": [ "extendAnalytics", "qaOrNot", "loadMacros" ]
},
```

You can set more macros from the argument, for example a different metafile name or install folder for each environment. You can also rename the environments or the argument.

## Related

* [Create environments and promote releases](https://docs.directgvr.com/release-automation/environments-and-promotion.md)
* [Core expandable strings](https://docs.directgvr.com/reference/client-workflow-engine/core-expandable-strings.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.