# Pass command line environment variable to suite's rose-app.conf file

**URL:** <https://cylc.discourse.group/t/pass-command-line-environment-variable-to-suites-rose-app-conf-file/203>\
**Category:** Cylc Support\
**Created:** [February 16, 2020, 11:28pm UTC](https://cylc.discourse.group/t/pass-command-line-environment-variable-to-suites-rose-app-conf-file/203 "2020-02-16T23:28:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [February 17, 2020, 8:30pm UTC](https://cylc.discourse.group/t/pass-command-line-environment-variable-to-suites-rose-app-conf-file/203/4 "2020-02-17T20:30:33Z")

</div>

> What I’d really like to do is to be able to pass variables from the command line; i.e. where I run `rose suite-run` from. Is that possible?

Sure, Rose/Cylc support passing through Jinja2 variables from the command line.

_suite.rc_

```ini
#!Jinja2
[runtime]
    [[mytask]]
        script = rose task-run
        [[[environment]]]
            # translate jinja2 variable into environment variable
            MY_VARIABLE={{ MY_VARIABLE }}

```

```console
# the rose way
$ rose suite-run -S 'MY_VARIABLE=42' # note capital 'S'
# the cylc way
$ cylc run -s 'MY_VARIABLE=42' # note lower 's'

```

Note you can define default values in your suite configuration file which you can (optionally) override on the command line using `-S`:

_rose-suite.conf_

```ini
[jinja2:suite.rc]
MY_VARIABLE=42

```

**Note:** If you are overriding variables often you many want to group commonly used options into files which you can turn on or off. Rose provides a mechanism for doing this called [optional configurations](http://metomi.github.io/rose/doc/html/tutorial/rose/furthertopics/optional-configurations.html), these work for suite and application configurations. See also the related [ROSE\_APP\_OPT\_CONF\_KEYS](http://metomi.github.io/rose/doc/html/api/environment-variables.html#envvar-ROSE_APP_OPT_CONF_KEYS) and [ROSE\_SUITE\_OPT\_CONF\_KEYS](http://metomi.github.io/rose/doc/html/api/environment-variables.html#envvar-ROSE_SUITE_OPT_CONF_KEYS) environment variables.

---

_[View the full topic](https://cylc.discourse.group/t/pass-command-line-environment-variable-to-suites-rose-app-conf-file/203)._
