Giter VIP home page Giter VIP logo

dashlane-cli's Introduction

Dashlane CLI

GitHub GitHub package.json version Documentation Website

Dashlane CLI Demo

Install

Follow our installation guide to install the CLI on your computer or server.

How to use

For development

Install the dependencies:

yarn

In order to build:

yarn run build

In order to link:

yarn link

In order to bundle for Linux-x64, macOS-x64 and Windows-x64:

yarn run pkg

It outputs in bundle directory. Be aware you must use the same Node version as the target.

Debug mode

You can use --debug to see all the debug logs of the CLI.

How to bump the version

yarn run version:bump

This will change the version of the application with the following rules

  • It won't change the major version.
  • The minor version will be set to match the following format
    • 2 digits corresponding to the last digit of the current year (ex: 24 for 2024)
    • 2 digits corresponding to the number of the current week (ex: 01 for the first week of the year)
  • The patch will be :
    • set to 0 if the minor version has changed
    • incremented from the previous version of the patch otherwise

How private data is stored on the computer

See src/modules/crypto/README.md.

Contributing

Feel free to contribute to this project, fork and pull request your ideas. Don't include work that is not open source or not from you.

dashlane-cli's People

Contributors

arthurdotwork avatar bibabox avatar cyril-dashlane avatar dboroujerdi avatar forty avatar irew avatar jboillot avatar julien-leos avatar mikescops avatar mzellho avatar neo773 avatar ni0ki avatar plhery avatar ptournem avatar quadristan avatar sgravis avatar stavares843 avatar tidalf avatar tzhuo avatar xaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dashlane-cli's Issues

JSON output not working ?

Hello,

The following command doesn't seems to work (I was expecting to retrieve the data for all credentials in JSON format) :

dcli p -o json  
>>> []

This is working though :

dcli p apple  
>>> ๐Ÿ”“ Password for "Apple" copied to clipboard!

Dashlane CLI : v1.5.0

EDIT: working when filter is applied :

dcli p apple -o json
>>> [{JSON_OBJ}]

From the documentation:

Options:
  -o, --output <type>  How to print the passwords among `clipboard, password, json`. The JSON option outputs all the matching credentials (default: "clipboard")

Read secrets from their ID

As a user, I'd like to access a secret directly from its ID.

This could be done with a read command and a pathing system.

IDs are in the shape of {66263B7E-D87B-4DD0-AC8A-3B88CF46A65E} and can be query directly in the local database.

[Feature Request] Allow to not store Password on my computer

Today

By default the CLI will store the MasterPassword on my device, secured by my keychain (via the localkey).

Proposal

By default the CLI does not save the MasterPassword on my computer/keychain, everything is in memory and you have to re-type it on every usage.
And have the option to "remember me", which will store the MasterPassword in the keychain as of today.

npm can't retrieve all dependencies for ARM macbook (M1 chip) - failing on better-sqlite3

After installing latest node version (using homebrew), npm fails retrieve all dependencies.
Apparently [email protected] is at stake here.

[~@localhost] node -v
v19.6.0
[~@localhost] cd dashlane-cli
[dashlane-cli@localhost] git pull
Already up to date.
[dashlane-cli@localhost > master] npm ci
npm notice
npm notice New patch version of npm available! 9.4.0 -> 9.4.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.4.2
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code 1
npm ERR! path /Users/arnaud/dashlane-cli/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh -c prebuild-install || npm run build-release
npm ERR! > [email protected] build-release
npm ERR! > node-gyp rebuild --release
npm ERR!
npm ERR!   TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR!   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR!   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm ERR!   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm ERR!   LIBTOOL-STATIC Release/sqlite3.a
npm ERR!   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm ERR! rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! prebuild-install warn install No prebuilt binaries found (target=19.6.0 runtime=node arch=arm64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.10 found at "/opt/homebrew/opt/[email protected]/bin/python3.10"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/arnaud/dashlane-cli/node_modules/better-sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/arnaud/Library/Caches/node-gyp/19.6.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/arnaud/Library/Caches/node-gyp/19.6.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/arnaud/dashlane-cli/node_modules/better-sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/node.h:73:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8.h:24:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-array-buffer.h:12:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-local-handle.h:12:
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
npm ERR!                              ^
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
npm ERR!                                   ^
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:659:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
npm ERR!                                                             ^
npm ERR!                                                             , ""
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:660:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kJSObjectType < kLastJSApiObjectType);
npm ERR!                                                       ^
npm ERR!                                                       , ""
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-internal.h:661:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
npm ERR!                                                               ^
npm ERR!                                                               , ""
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/node.h:73:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8.h:24:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-object.h:9:
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm ERR!   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm ERR!                                        ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm ERR!                                             is_lvalue_reference
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
npm ERR! struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
npm ERR!                             ^
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/node.h:73:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8.h:24:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-object.h:9:
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
npm ERR!   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm ERR!                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm ERR! template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm ERR!                                      ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm ERR!                                           is_lvalue_reference
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
npm ERR! struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
npm ERR!                             ^
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/node.h:73:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8.h:24:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-object.h:9:
npm ERR! /Users/arnaud/Library/Caches/node-gyp/19.6.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
npm ERR! template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm ERR!                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! ./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
npm ERR!                 v8::AccessorSignature::New(isolate, recv)
npm ERR!                 ~~~~^
npm ERR! ./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
npm ERR!                 int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
npm ERR!                     ^
npm ERR! ./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
npm ERR!                 v8::Local<v8::Context> ctx = obj->CreationContext();
npm ERR!                                              ~~~~~^
npm ERR! 21 warnings and 6 errors generated.
npm ERR! make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:512:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 22.3.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/19.6.0/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd /Users/arnaud/dashlane-cli/node_modules/better-sqlite3
npm ERR! gyp ERR! node -v v19.6.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/arnaud/.npm/_logs/2023-02-10T23_45_59_368Z-debug-0.log

Add command to list team credentials

This is a feature request to list team credentials. For now it's only possible to add or delete one. Currently, if you didn't take note of a credential access key you are not able to find it back without reaching out to Dashlane support.

  • Add a new endpoint on the server side to server list of available credentials
  • Add new command in the CLI to query this endpoint
  • Rework the structure of the commands team > credentials > add/remove/list

Unwanted Dashlane CLI keychain passwords on MacOS

Hello,

after doing some auth tests with the CLI, I found out that for each connexion attempt, the CLI creates a certificate. Maybe moving the creation of this certificate after the user is connected could be a nice feature.

test

Arm package

Hello,

From this PR, why not putting pkg:macos-arm in the pkg line of the package.json ? IMHO, It would be nice to have the arm-binary in the release too ๐Ÿ˜„.

Migrate device registration endpoint

Currently we are using the endpoint /authentication/RequestDeviceRegistration to perform device registration.
This endpoint is deprecated and we should use /authentication/GetAuthenticationMethodsForDevice instead.

Unable to access keychain

OS: ArchLinux x86_64
Kernel: 5.18.11-264-tkg-pds
dashlane-cli-version: 1.0.0
libsecret-version: 0.20.5-2

tried with uploaded binary and locally made, no difference.
Other programs has no issue using the keychain.

image

brew fails, does not exist

brew update
Already up-to-date.

brew install --build-from-source dashlane-cli.rb
Running brew update --auto-update...
[...]
Warning: No available formula with the name "dashlane-cli.rb".
==> Searching for similarly named formulae and casks...
==> Casks
dashcam-viewer

To install dashcam-viewer, run:
brew install --cask dashcam-viewer

image

Rate limit and other API questions

Hello,

Thanks again for this tool, it works great, and is a great basis for custom integrations.
I seem to have encountered a rate limit type error while working on a tool based on the Dashlane CLI.

I have a few questions if you don't mind:

  1. What is the rate limit and timeout?
  2. Can I generate my own API keys?
  3. Doubtful, however, is it possible to disable rate limiting for a specific account?
  4. Are there any test/dummy accounts that can be used to develop Dashlane integrations?

Team Report command is not using Team device authentication

Describe the bug
The dcli t report command is using the user authentication instead of team which make it impossible to run in a CI environment.

Additional context
This change needs server side modification to create a new endpoint supporting this authentication mechanism.

SSO authentication support

Hello !

When I try to login with dashlane-cli I get the following message :

ERROR: Auth verification method not supported: sso

Do you plan to add support for this auth method ? (If it is possible)

If you want and can give me some pointers, I'd be happy to open a PR about it

Support access to vault operations in non-interactive environment

This is a feature request to allow the use of the CLI in a non-interactive environment.

  • be able to register a new device credentials for the non-interactive env device
  • be able to read a master password and device credentials in the env to bypass interactive commands

Connexion issue

Hello,

I am trying to connect to the dashlane cli but I have some issues trying to connect:

First I had this when entering my mail:

? Please enter your OTP code: ERROR: The OTP was already used for this user.

Then I revoked accesses of Dashlane CLI sessions via the settings of my account and now when entering my mail:

? Please enter your OTP code: ERROR: The OTP verification failed. This could be due for example to the user inputing a wrong token.

Do you have an idea on how to fix it ? Many thanks in advance ๐Ÿ˜„

EDIT :

  • I migrated from the dcli-1.0.0 to dcli-1.2.0 / MacOS Ventura 13.2.1 (22D68)
  • I removed all dashlane-cli elements from MacOS keychain

Using any other valid email address returns this message:

? Please enter the code you received by email: ERROR: Request is malformed

RequestError: unable to verify the first certificate

dcli Version: 1.0.0 Windows
OS version: Windows 10 Enterprise 21H2

When trying to log in using dcli-win.exe sync I am receiving an error as follows after entering my email address:

RequestError: unable to verify the first certificate
    at ClientRequest.<anonymous> (C:\snapshot\dashlane-cli\node_modules\got\dist\source\core\index.js:970:111)
    at Object.onceWrapper (node:events:642:26)
    at ClientRequest.emit (node:events:539:35)
    at ClientRequest.<anonymous> (C:\snapshot\dashlane-cli\node_modules\@szmarczak\http-timer\dist\source\index.js:43:20)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
    at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket._finishInit (node:_tls_wrap:946:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12) {
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  timings: {
    start: 1673609161941,
    socket: 1673609161942,
    lookup: 1673609161948,
    connect: 1673609161957,
    secureConnect: undefined,
    upload: undefined,
    response: undefined,
    end: undefined,
    error: 1673609161967,
    abort: undefined,
    phases: {
      wait: 1,
      dns: 6,
      tcp: 9,
      tls: undefined,
      request: undefined,
      firstByte: undefined,
      download: undefined,
      total: 26
    }
  }
}

While it is the case that I am running this in a corporate environment with a firewall that does HTTPS inspection, the appropriate CA certificate is installed in the computer's Trusted Root Certificates store, so the server certificate should be able to be verified.

The Dashlane web app and browser extension do not experience any issues.

--other tag not working

Describe the bug
Nothing happens when doing dcli devices remove --other

See docs here.

To Reproduce
Steps to reproduce the behavior:

  1. dcli devices remove --other
  2. Press โŽ

Expected behavior
Same behavior has dcli devices remove --all

Environment (please complete the following information):

  • OS: MacOS Ventura
  • CLI Version 1.9.0

Publish the cli to NPM registry

It would be great if we could install (and update!) the cli using NPM.

This:
npx @dashlane/cli
Or:
npm i -g @dashlane/cli

instead of this:

brew install typescript
git clone [email protected]:Dashlane/dashlane-cli.git
cd dashlane-cli
npm run build
npm link
npm install

logout vs remove current device behavior

Describe the bug
Maybe it is intendend but I don't understand why the logout command does not remove the device from the current account like it does with dcli devices remove <current-id-device>

To Reproduce
Steps to reproduce the behavior:

  1. dcli devices remove <current-id-device>
  2. Press โŽ on 'Yes'

The device is removed.

  1. dcli logout
  2. Press โŽ on 'Yes'

The device is kept in the dcli devices list.

Expected behavior
Same behavior has dcli devices remove <current-id-device>.

Environment (please complete the following information):

  • OS: MacOS Ventura
  • CLI Version 1.9.0

1.0.0 Release Trim Error

Hi! I'm getting this error after submitting my user/pass/code on the 1.0.0 dashlane cli:

TypeError: Cannot read properties of undefined (reading 'trim')
    at PrintableVaultCredential.toString (/snapshot/dashlane-cli/dist/types.js:9:44)
    at /snapshot/dashlane-cli/dist/middleware/getPasswords.js:84:46
    at Array.map (<anonymous>)
    at selectCredential (/snapshot/dashlane-cli/dist/middleware/getPasswords.js:82:41)
    at async getPassword (/snapshot/dashlane-cli/dist/middleware/getPasswords.js:92:32)
    at async Command.<anonymous> (/snapshot/dashlane-cli/dist/index.js:55:9)
    at async Command.parseAsync (/snapshot/dashlane-cli/node_modules/commander/lib/command.js:917:5)

Support multiple accounts

Supporting multiple accounts will allow to query the vault and other commands in the event you have different accounts (ie: personal and professional).

  • ability to login with an extra account
  • ability to define an account to run a given command (this will force the login selector with --account)
  • ability to select the default account to run commands
  • ability to logout from one account (only reset related resources for this account and de-register the device)

Human-readable date export option

For audit logs, team members activity, any other field with a unix timestamp: we have some customers who are interested in exporting data via the CLI but are not familiar with unix timestamps. They would prefer a human-readable datetime option.

Would be interesting to have an option to convert unix timestamps to datetime for exports, or even some sample code for admins and users interested in taking it on themselves.

Sweet CLI ๐Ÿ˜Ž

Successful mail sent too soon ?

Hello, I remarked that when connecting to a Dashlane account from the CLI, entering the right OTP but a wrong password still leads to receive a successful connection mail. Is it an intended feature ? ๐Ÿค”

Gateway Error When Trying do first-time sync on windows 10

Hello Dashlane Team,

I finally got dcli (v1.6.0) installed on my corporate machine after pointing NodeJS to my local certs (this was also causing issues with the base CLI when I tried installing the executable itself). However now I am getting a different issue!

What I am Trying
Per the readme, just trying to do my initial sync with dcli sync

What Happens
The CLI prompts me for my email, then after a few seconds of processing the response I get the following error:
ERROR: Response code 504 (Gateway Timeout)

Thanks for your help with this

Ask mp only when needed

Hello,

I'd like to use the cli in a script to retrieve team informations using the team memberlist option.
It currently asks for the mp (while it's not required to use only the api), it'd be nice to ask for it only when required.

thanks!

Logout instead reset

Update the documentation to make it clear how to logout from an account via the CLI. The current wording refers to "reset" rather than "logout"

Add a homebrew formula

Homebrew is how most Mac folks who use the command line install software. It would be great to have a homebrew formula for this tool instead of having to manually install/update.

This:

brew install dashlane-cli

Instead of:

brew install typescript
git clone [email protected]:Dashlane/dashlane-cli.git
cd dashlane-cli
npm run build
npm link
npm install

id filter usage

You should provide usage examples with the id filter.
In my case i have two AWS accounts with 2FA enabled and I need a way to tell them apart:

  1. amazon.com - [email protected]
  2. amazon.com - [email protected]

I was expecting that the command dcli otp [email protected] outputs the first otp code but it fails.
Is there any way to achieve this?

on linux, the the clipboard is cleared after application exit

For some reason the clipboard is cleared on Linux systems after closing

I know this ticket is lacking detail, I am doing some investigation. It looks like its a thing with X11... the clipboard is maintained by the process, so once its terminated the clipboard is "gone"

Error: Cannot load module

Environment:

Operating System: Windows 11 Professional (10.0.22621 Build 22621)
Account Privileges: Administrator
Working Directory: C:\Apps\dcli
Dashlane-CLI Version: 1.5.0

Repro:

  1. Run the command: dcli-win_x64.exe reset
  2. Choose Yes
  3. Run dcli-win_x64.exe sync
  4. Enter OTP
  5. Enter Master Password
  6. Run dcli-win_x64.exe p

Result:

C:\Apps\dcli>dcli
node:internal/modules/cjs/loader:1024
  throw err;
  ^

Error: Cannot find module 'C:\Users\unifl\AppData\Roaming\npm\node_modules\@dashlane\cli\dist\index.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
    at Function.Module._load (node:internal/modules/cjs/loader:866:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

OTP starting with 0 returns an error

Hello,

It seems that OTP starting with a 0 results automatically an error. See below (from v1.0.0):

! ! ! input was 058899 ! ! !
? Please enter your OTP code: 58899
DashlaneApiError: The OTP verification failed. This could be due for example to the user inputing a wrong token.
    at requestApi (/snapshot/dashlane-cli/dist/requestApi.js:79:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async registerDevice (/snapshot/dashlane-cli/dist/middleware/registerDevice.js:31:27)
    at async getSecretsWithoutDB (/snapshot/dashlane-cli/dist/crypto/keychainManager.js:81:50)
    at async connectAndPrepare (/snapshot/dashlane-cli/dist/database/connectAndPrepare.js:24:21)
    at async Command.<anonymous> (/snapshot/dashlane-cli/dist/index.js:34:29)
    at async Command.parseAsync (/snapshot/dashlane-cli/node_modules/commander/lib/command.js:917:5) {
  code: 'verification_failed',
  type: 'business_error'
}

Note : I am on macos Ventura 13.2.1 (22D68) - Dashlane CLI 1.0.0

Send device name during registration

If you use the Dashlane CLI on multiple devices it gets difficult to differentiate them as they are registered with the same name.

Try to gather the device name if available during registration.

CSV export

We have some customers who are interested in using the CLI to export data in CSV format instead of JSON. Let's help them skip a few steps :)

Rate limit exceeded

Hello,

I am trying to build something on top of the CLI to make it more easy to manipulate. I am doing auth tests but I now have the error below. How to get rid of it ?

dcli sync
? Please enter your email address: [email protected]
DashlaneApiError: Rate limit exceeded
    at requestApi (/snapshot/dashlane-cli-master/dist/requestApi.js:79:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async registerDevice (/snapshot/dashlane-cli-master/dist/middleware/registerDevice.js:15:30)
    at async getSecretsWithoutDB (/snapshot/dashlane-cli-master/dist/crypto/keychainManager.js:81:50)
    at async connectAndPrepare (/snapshot/dashlane-cli-master/dist/database/connectAndPrepare.js:24:21)
    at async Command.<anonymous> (/snapshot/dashlane-cli-master/dist/index.js:34:29)
    at async Command.parseAsync (/snapshot/dashlane-cli-master/node_modules/commander/lib/command.js:917:5) {
  code: 'rate_limit_exceeded',
  type: 'rate_limit_error'
}

Also is there a limit of calling dcli password / dcli note or dcli otp ? Many thanks in advance for your help

Exec commands with templated environment variables

As a user, I'd like to run commands in a subprocess with templated environment variables so that Dashlane CLI replaces the reference with the actual secrets.

This could use the same pathing system as in #151. A subprocess is created and environment variables are passed to it and references to secrets are replaced.

RPM package format

Similar to #39, this issue is for Linux users that rely on the rpm package format.

It would be very handy to provide an rpm package (and even host a repository) for various Enterprise Linux flavoured operating systems.

Ideally, users should just be able to:

sudo dnf install dashlane-cli

For Fedora users Copr might be enough.

Clipboard copy does not work on WSL2

? Please enter your master password: [hidden]
? What password would you like to get? My Password
Error: spawnSync /snapshot/dashlane-cli/node_modules/clipboardy/fallbacks/windows/clipboard_x86_64.exe ENOENT
    at Object.spawnSync (node:internal/child_process:1111:20)
    at Object.spawnSync (node:child_process:814:24)
    at Object.spawnSync (pkg/prelude/bootstrap.js:2087:31)
    at Function.sync (/snapshot/dashlane-cli/node_modules/execa/index.js:334:30)
    at Object.copySync (/snapshot/dashlane-cli/node_modules/clipboardy/lib/windows.js:14:29)
    at Object.<anonymous> (/snapshot/dashlane-cli/node_modules/clipboardy/index.js:45:14)
    at getPassword (/snapshot/dashlane-cli/dist/middleware/getPasswords.js:95:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.<anonymous> (/snapshot/dashlane-cli/dist/index.js:55:9)
    at async Command.parseAsync (/snapshot/dashlane-cli/node_modules/commander/lib/command.js:917:5) {
  errno: -2,

Looks like the CLI thinks I'm on windows within my WSL2 VM.

v1.3.0 Package is broken

It seems that a recent changed in vercel/pkg creates wrong bindings in our packages, so v1.3.0 packaged releases are broken.

fallback to different 2fa

If logging in with one type of 2FA e.g. Dashlane authenticator doesn't work, allow user to fallback to a different 2FA e.g. security code, TOTP

Cannot login via CLI - OTP2 not supported

Hello,

I can login fine on the browser.
However the CLI keeps saying master password incorrect after trying to login by running dcli-win sync.
The master password you provided is incorrect, would you like to retry?

Restructure commands handling

The index.ts is loaded with a lot of files inside, it gets hard to read and figure out what is the structure of the command line.

  • rearchitecture the index.ts
  • split down into commands folder the different groups
  • isolate the logic from the commands interface

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.