Crowdin-cli not working without config file despite documentation

I am using the crowdin-cli through npm at the moment for a project. I saw the documentation suggesting using choco, however, when I go through this method it installs a Java8 dependency version with a known vulnerability of CVSS 10 - on a corporate network, so a nonstarter.

I am attempting to download translation files, and I do not want to have to rely on a configuration file with sensitive information such as the api-key. checking the documentation it explicitly mentions this is possible, so I could be implementing the command incorrectly:

“Crowdin CLI config options provide an alternative way to pass options that can be configured via the configuration file. When config options are specified as command parameters, CLI considers them to have higher priority than the options specified in the configuration file. The config options also allow the CLI to be used without a configuration file.”

I ensured to use what looks to be all the necessary parameters to make it run without a config file. The documentation doesn’t seem to specify much other than this, unless I’m blind.

crowdin-cli download --token=[token here] --base-url=https://api.crowdin.com --project-id=[projectId here] -l all

Configuration file is missing.

Hi there,

Thank you for reaching out and providing detailed information about the issue you’re encountering with the crowdin-cli. It seems like you’re on the right track with the command you’re using.

To avoid using a configuration file, please ensure that all necessary parameters are included in your command. The command you’ve provided looks correct, but let’s double-check that there are no spaces or formatting issues with the token or project ID you’re using. Also, ensure that the token has the necessary permissions to access the project.

appreciate the response @NataliaS ! how might we go about verifying that info is correct? i don’t want to post the api key or the projectId here publicly.

the posted format is exactly as i have attempted in powershell, no hidden spaces or syntax issues, would expect an error in those cases i would think. i’ve attempted the token and project in double and single quotes, and without - i also know the projectId and the api key are correct, and the api key is issued by the project owner with full admin priviledges and its not expired.

i would think it would return an error anyways if that info was not valid

@cpieng

If you want to use the Crowdin CLI without the configuration file, you also need to specify the required -s/--source and -t/--translation patterns.

Also the expression -l all is wrong. If you need to download all languages, just omit this parameter. You can also omit the --base-url, it’s optional for crowdin.com. It’s only required for Crowdin Enterprise.

For example:

crowdin download --token=[token here] --project-id=[projectId here] -s "*.xml" -t "%two_letters_code%/%original_file_name%"

Please make sure you’ve uploaded your source files to Crowdin via the CLI using the same source and translation patterns.

As for the Java version, it will be updated in the next major release of the CLI. Currently, we can’t give an exact ETA, but the development team is aware of this.

1 Like

thanks @Olena - unless my reading comprehension is off, i didn’t see anything indicated these to be required parameters for config options, and the response by the CLI was not particularly helpful. i will give your suggestion a try!

@Olena attempted the command with your suggestions:

crowdin-cli download -T [token] --project-id=[pid] -s ‘\locale\wildcards\wildcard.po’ -t ‘/locale/%two_letters_code%/wildcards/%original_file_name%’

Configuration file is missing

note: had to use the word ‘wildcard’ for my ** and * wildcards due to the text markup here.

is there verbose logging I can use? i’m doing my best to go off the documentation

edit: ahh i see your .xml source and translation values are slightly different - was reading the config file documentation and it seems to be labeled the same but calls something different

crowdin-cli download -T [token] --project-id=‘[token]’ -s ‘*.xml’ -t ‘%two_letters_code%/%original_file_name%’

Configuration file is missing.

@cpieng could you please provide path examples to your source and translation files?

What operating system and CLI version are you using?