# Confused with cli --vars syntax

**URL:** <https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355>\
**Category:** Help\
**Tags:** vars, dbt-core\
**Created:** [March 7, 2024, 12:55am UTC](https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355 "2024-03-07T00:55:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reyfabian2015](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/reyfabian2015/32/3742_2.png) [@reyfabian2015](https://discourse.getdbt.com/u/reyfabian2015)\
**Post date:** [March 7, 2024, 12:55am UTC](https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355/1 "2024-03-07T00:55:02Z")

</div>

## The problem I’m having

Using the syntax for --vars as indicated in the documentation causes an error.

## What I’ve already tried

this is the command I ran in the cli.

`dbt ls --select Default_Mig_Date --vars '{"mig_date":"2024-01-31"}'`

resulting in the error

```auto
00:56:01 The YAML provided in the --vars argument is not valid.
Usage: dbt ls [OPTIONS]
Try 'dbt ls -h' for help.

Error: Invalid value for '--vars': String ''{mig_date:2024-01-31}'' is not valid YAML

```

however, when I run the command by removing the first and last single quotes like the command below, no error will occur.

`dbt ls --select Default_Mig_Date --vars {"mig_date":"2024-01-31"}`

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [March 8, 2024, 12:52pm UTC](https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355/2 "2024-03-08T12:52:26Z")

</div>

Try including a space after the colon

`dbt ls --select Default_Mig_Date --vars '{"mig_date": "2024-01-31"}'`

---

<div class="post-metadata">

**Author:** ![reyfabian2015](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/reyfabian2015/32/3742_2.png) [@reyfabian2015](https://discourse.getdbt.com/u/reyfabian2015)\
**Post date:** [March 11, 2024, 3:35am UTC](https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355/3 "2024-03-11T03:35:36Z")

</div>

Hi,

thank you for responding, however, your suggestion did not work.

What worked for me is I changed the starting and ending single quotes to double quotes and changed the inner double quotes to single quotes.

`dbt ls --select Default_Mig_Date --vars "{'mig_date':'2024-01-31'}"`

---

<div class="post-metadata">

**Author:** ![jacob\_campbell](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jacob\_campbell](https://discourse.getdbt.com/u/jacob_campbell)\
**Post date:** [June 2, 2025, 10:04pm UTC](https://discourse.getdbt.com/t/confused-with-cli-vars-syntax/12355/4 "2025-06-02T22:04:49Z")

</div>

That worked for me too. I assume it to be BS related to how cmd interprets quotes in my case 😑
