Conversation
src/cli/CMakeLists.txt
Outdated
| target_link_libraries(entropy-meter zxcvbn) | ||
| install(TARGETS keepassxc-cli | ||
| BUNDLE DESTINATION . COMPONENT Runtime | ||
| RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT Runtime) |
There was a problem hiding this comment.
Right now this is installing the binary in the /Applications folder on MacOs. I'll have to find a way to copy it to /usr/local/bin instead.
There was a problem hiding this comment.
You set the destination to ${BIN_INSTALL_DIR} "declared" here https://github.com/keepassxreboot/keepassxc/blob/develop/CMakeLists.txt#L148
that is set to . and when executing make install goes to /Application
You can instead use
include(GNUInstallDirs)
${CMAKE_INSTALL_BINDIR}
Or eventually hard code the /usr/local/bin path
|
@TheZ3ro added the install path for MacOs. Really not sure this is the way to go, and I still have to determine the path for cli executables on windows. |
|
@louib 👍 |
src/cli/keepassxc-cli.cpp
Outdated
|
|
||
| QString commandName = argv[1]; | ||
|
|
||
| for (int i = 1; i < argc - 1; ++i) { |
There was a problem hiding this comment.
What is the purpose of this loop?
You might want to use ++argv; instead?
There was a problem hiding this comment.
Good call. I added a comment and removed the loop in favor of ++argv!
|
@TheZ3ro I tested that the executable installs correctly on Linux. At some point we might want to list the available commands when calling |
c36d9e4 to
cf05b53
Compare
9d72ae4 to
3aa27cc
Compare
|
@TheZ3ro Added the I'd leave that as is for a first version of the CLI, so that we can clarify the scope of this feature. |
|
I was planning of implementing the list option by myself but you already did it! Nice 😄 |
|
Maybe we can put the inserting password code in a different file. It's repeated a lot |
|
Any news here? |
|
@TheZ3ro I think the last command remaining before a first version would be |
|
@louib Ok I think we can wait for the merge until the show feature is implemented. |
|
@TheZ3ro added a basic |
|
Ok I will review this in the next few days. Can you rebase on develop? |
e07e08b to
e49e8e3
Compare
|
@TheZ3ro done! |
|
I forgot to approve and merge this, @louib can you rebase on develop again? Thanks |
e49e8e3 to
0be1f87
Compare
|
@TheZ3ro done! |
0be1f87 to
a661c17
Compare
|
@TheZ3ro done! |
src/cli/keepassxc-cli.cpp
Outdated
|
|
||
| qCritical("Invalid command %s.", qPrintable(commandName)); | ||
| parser.showHelp(); | ||
| return EXIT_FAILURE; |
There was a problem hiding this comment.
You should add the lsan stuff I added to src/main.cpp to avoid a huge dump of memory leak errors when compiling with our new -DWITH_ASAN=ON option.
|
Fantastic work on this guys! |
- Added YubiKey 2FA integration for unlocking databases [#127] - Added TOTP support [#519] - Added CSV import tool [#146, #490] - Added KeePassXC CLI tool [#254] - Added diceware password generator [#373] - Added support for entry references [#370, #378] - Added support for Twofish encryption [#167] - Enabled DEP and ASLR for in-memory protection [#371] - Enabled single instance mode [#510] - Enabled portable mode [#645] - Enabled database lock on screensaver and session lock [#545] - Redesigned welcome screen with common features and recent databases [#292] - Multiple updates to search behavior [#168, #213, #374, #471, #603, #654] - Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480] - Fixed auto-type errors on Linux [#550] - Prompt user prior to executing a cmd:// URL [#235] - Entry attributes can be protected (hidden) [#220] - Added extended ascii to password generator [#538] - Added new database icon to toolbar [#289] - Added context menu entry to empty recycle bin in databases [#520] - Added "apply" button to entry and group edit windows [#624] - Added macOS tray icon and enabled minimize on close [#583] - Fixed issues with unclean shutdowns [#170, #580] - Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515] - Compare window title to entry URLs [#556] - Implemented inline error messages [#162] - Ignore group expansion and other minor changes when making database "dirty" [#464] - Updated license and copyright information on souce files [#632] - Added contributors list to about dialog [#629]
|
Maybe a silly question, but how do I get this CLI on a Mac? Does it need to be compiled? |
|
You need to compile it. It's not part of the DMG as it only has a single entry point. We probably need some sort of bootstrap feature in the future to start the CLI from single-entry point binary such as the DMG or the Linux AppImage and Snap packages. |
|
How do I compile |
|
After doing |
Adding a single point of entry for the command line interface. I still need to add the available commands when calling the program without a command name. The other utils could also be migrated to the new directory.
Also fixes 2 things:
Crypto::init()call was failing.1even though it succeeded.Motivation and Context
Addresses #201
How Has This Been Tested?
Locally, by testing the 2 programs migrated.
Screenshots (if appropriate):
$ src/cli/keepassxc-cli merge Usage: keepassxc-cli merge [options] database1 database2 Merge 2 KeePassXC database files. Options: -s, --same-password use the same password for both database files. Arguments: database1 path of the database to merge into. database2 path of the database to merge from.Types of changes
Checklist: