# Something not quite right in the CLI tool

**URL:** <https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942>\
**Category:** Discussions\
**Created:** [January 25, 2023, 1:41pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942 "2023-01-25T13:41:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [January 25, 2023, 1:41pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/1 "2023-01-25T13:41:50Z")

</div>

Since I started to use Doppler I have been using the following command in my bash scripts, with $1,$2 and $3 being the values needed to get to a valid config

doppler --project “$1” --config “$2” --token “$3” secrets get --silent --plain DOPPLER\_PROJECT

This still works for all but the latest 2 configs that I have defined in a new project. When accessing these I get

Error: unknown flag: --plain

From what I can tell this is thrown as the secrets command is not being processed so the cli tool is trying to process --plain as a global flag.

Ordering the command like this

doppler secrets get --silent --plain DOPPLER\_PROJECT --project “$1” --config “$2” --token “$3”

Does result in the value being returned from both my old and new configs. So there is a minor instability in the command line parser where the state/age of the config can cause the parser to miss the command to be processed unless it is the first parameter (or at least near the front of the list).

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [January 25, 2023, 3:33pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/2 "2023-01-25T15:33:00Z")

</div>

Hi @rit001!

I think something else may be going on here unrelated to the CLI. I just performed a test on my own using a script like this:

```auto
#!/usr/bin/env bash

doppler --project "$1" --config "$2" --token "$3" secrets get --silent --plain DOPPLER_PROJECT

```

I tried that passing in a project and config that have existed for approaching a year at this point and it worked fine. I then created a brand new project and tested it using that and it worked fine too.

Could you provide me with some additional details?

- What shell are you using and what version?
- What CLI version are you using?
- If you run your script in a vanilla Ubuntu container (i.e., `docker run --rm -it ubuntu bash`), do you observe the same behavior?

Regards,  
-Joel

---

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [January 25, 2023, 4:05pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/3 "2023-01-25T16:05:56Z")

</div>

Hi,

Distro Ubuntu 22.04.1 LTS  
bash version 5.1.16(1)-release  
doppler v3.53.1

I see the same error if I create a docker environment with 22.04 + lsb-core and docker cli

I’m running the command at the command line to remove any possible script side effects, with all the parameters expanded out to their true values.

---

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [January 25, 2023, 4:24pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/4 "2023-01-25T16:24:32Z")

</div>

I’m pretty sure I know what it is - my project is called “secrets” so your CLI parser is not correctly parsing parameters as it scans the list provided.

So

- place the command ‘secrets’ at the start of the command line and the parser correctly understands that it needs to process the parameters for the secrets command.

- place --project at the start of the command line with a parameter of “secrets” and things start to go wrong.

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [January 25, 2023, 4:31pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/5 "2023-01-25T16:31:31Z")

</div>

Ah, yep! That seems to be the issue. I was able to reproduce it when I used a project named `secrets`. I’ll go ahead and get an issue opened about this.

---

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [January 25, 2023, 4:33pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/6 "2023-01-25T16:33:18Z")

</div>

Yep it is a parser error you can try the following

doppler --project “test” --config “secrets” --token “dp.st.secr.4hq973K5p0X1HCXnIVdBTUtH20Wja5i5sz9niNPfe1d” secrets get DOPPLER\_CONFIG

which goes to a test config I have just created. This throws the following error

Error: unknown command “dp.st.secr.4hq973K5p0X1HCXnIVdBTUtH20Wja5i5sz9niNPfe1d” for “doppler secrets”  
Usage:  
doppler secrets [flags]  
doppler secrets [command]

So the --config parameter “secrets” is being parsed as the ‘secrets’ command.

---

<div class="post-metadata">

**Author:** ![rit001](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/rit001/32/382_2.png) [@rit001](https://community.doppler.com/u/rit001)\
**Post date:** [January 25, 2023, 4:36pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/7 "2023-01-25T16:36:36Z")

</div>

I would guess that it will happen for all commands when they end up being used as parameters and the command is ordered in the way that I have done it - the only reason for that order was that it was based on an example posted by one of your team to a past question I had posted.

So there is a bug, but few people should come across it as they are more likely to follow the command line structure shown in the help text.

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [January 25, 2023, 4:42pm UTC](https://community.doppler.com/t/something-not-quite-right-in-the-cli-tool/942/8 "2023-01-25T16:42:01Z")

</div>

I actually tested another command (`configs`) and it didn’t trigger this behavior, so there is likely some special casing around the `secrets` command. We’ll look into it! Thanks for reporting this!

Edit: I take it back! It seems like the problem solely occurs when the value of the project or config parameter matches the command being run. So, you can use the `secrets` project or config if you’re executing `doppler configs`, but if you use `doppler secrets` it will fail to parse. Likewise, if you use `configs` as the project or config, `doppler secrets` will work, but `doppler configs` will not.
