Syntax of the export command seems to have changed. Now needs --password before the password. Broke my backup script.
Export doesn’t seem to be working right either. Previous export yielded a moderately size JSON file. Current export yields a large file with binary data in it.
I reverted to the previous BW CLI.
I already have –format json in my command line and it still encrypts.
I would suggest comparing the files created using --format encrypted_json vs. --format json. Are the two files identical?
No, the files are not identical, but they are exactly the size and both contain binary data. I would theorize that the difference is because the file date is incorporated somewhere.
The file generated by the old bitwarden cli was plaintext. The new bitwarden cli has binary data no matter which –format I use.
The change that makes a difference seems to be when the new export requires –password while the old one just had . Seems like adding –password causes the output to be encrypted with both the old cli and the new cli.
The new cli gives me a syntax error without –password.
Mine does not do that:
user@personal:~$ bw -v
2025.10.0
user@personal:~$ bw export --format json
Saved /home/user/bitwarden_export_20251019064110.json
user@personal:~$ head /home/user/bitwarden_export_20251019064110.json
{
“encrypted”: false,
“folders”: ,
“items”: [
{
“passwordHistory”: [
{
“lastUsedDate”: “2025-06-27T03:35:55.106Z”,
“password”: “password 01 (a)”
},
AFAICT, export on CLI v2025.10.0 behaves exactly the same way as v2025.9.0 did (at least on linux).
PS.: I don’t mind a password showing up in my example, this is from a test account.
But you are not specifying –password on your export command line, which is apparently the cause of my problems. That’s why yours works and mine doesn’t.
@hspindel From your first post:
From your last post:
Seems your premise from your first post might not be correct then… (apart from that observation, unfortunately I don’t have any valuable experience with the CLI myself)
Which password are you talking about? The master password or the one used to encrypt the export?
From the corresponding help page:
--password <password>to specify a password to use to encryptencrypted_jsonexports instead of your account encryption key
So if you add –-password, this will override the specified export format.
If you want a plain JSON export, use –-format json and do not specify -–password.
After –password I am providing the master password for my Bitwarden vault. The command line reads:
bw export %BW_PASS% --output %BW_USER%%year%-%month%-%day%%hour%-%minute%-%second%.json --format json
If I do not specify the master password to the command line, how is the export command going to open my vault?
The password specified for that option is unrelated to your master password and only used to encrypt the export file. Also you should never use your master password (or any important credentials) as a command line parameter since those are visible in the process list of the system. A much better way is to use environment variables.
I am not sure how this should have worked for your exports performed previously with the older CLI version.
Usually you use bw login (documentation). For automated workflows, a personal API key is recommended. After login or unlock, you retrieve a session key that can be used for all future commands.
Has this ever worked for you?
You need to start by logging in using bw login. You will get a session key, which you will need to assign to the environment variable BW_SESSION, or pass as a command line option using --session.
For example:
bw export --format json --output foo.json --session fWcK7fsE8vwgFBpEeLITa72xskpD/tbS9WqeAzvB4CE=
For alternative methods and for more information, please refer to the Help documentation:
@marlin I am using environment variables. Just didn’t show that in my example.
@grb Yes, the command line has been working for years. I had my password environment variable on the command line without a preceding –password. Apparently up until 2025.9.0 the cli just ignored the extra info on the command line. When I upgraded to 2025.10.0, the command starting throwing syntax errors.
I mistakenly thought the fix was to add –password to the command line, which I now understand forced the output of the export to be encrypted.
______________________________________
I am happy to report that (with the help I received here) just deleting the master password from the export line makes the 2025.10.0 parser happy and things are back to working exactly as I expect.
Something definitely changed between 2025.9.0 and 2025.10.0 because my previous export line has been working for years.
Glad to hear that. ![]()
It would be helpful to others if you mark one of the correct answers as the solution for your question.
I can only speculate here but it seems that the password you added to the command line has been ignored in earlier versions but caused errors in the current one.
Yes, I was able to reproduce this behavior. As of 2025.10.0, the following error message is output:
error: too many arguments for 'export'. Expected 0 arguments but got 1.
I would be happy to do that, except there isn’t a single post that solved it. It was a combination of posts and trial and error on my part.
I am grateful for the posters who helped.
A related issue recently posted on Github notes that the documentation in bw export --help erroneously displays examples that include the (long deprecated) master password argument:
