Skip to content

Add create command to keepassxc-cli#2352

Closed
coelebs wants to merge 10 commits intokeepassxreboot:developfrom
coelebs:create_command
Closed

Add create command to keepassxc-cli#2352
coelebs wants to merge 10 commits intokeepassxreboot:developfrom
coelebs:create_command

Conversation

@coelebs
Copy link
Copy Markdown
Contributor

@coelebs coelebs commented Oct 4, 2018

Command can be used to create a database using the command line. The
database can be secured by a key file and/or password. A key file can be
specified that will be created when it does not exist. The password will
be read from stdin, the same way as it's currently being done for
unlocking the database. When no key is specifed the function will fail.

Challenge response to unlock the database is not supported.

This functionality has been inspired by issue #2220, and solves point 1
of that issue.

Examples

A few examples of this command

Creating a database with a password
keepassxc-cli create /path/to/database.kdbx
Insert password used to encrypt database (Press enter leave blank):

Creating a database with a keyfile
keepassxc-cli create -k /path/to/keyfile.key /path/to/database.kdbx
Insert password used to encrypt database (Press enter leave blank):

Motivation and context

This functionality was missing from the keepassxc-cli and specifically requested in #2220. A more complete keepassxc-cli improves the scriptability of keepassxc-cl

How has this been tested?

Tested on Linux following edge cases

  • No key file or password specified
  • Key file does not exist
  • Directory where key file or database should be created does not exist
  • Invalid key file specified

Types of changes

  • ✅ New feature (non-breaking change which adds functionality)

Checklist:

  • ✅ I have read the CONTRIBUTING document. [REQUIRED]
  • ✅ My code follows the code style of this project. [REQUIRED]
  • ✅ All new and existing tests passed. [REQUIRED]
  • ✅ I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]
  • ✅ My change requires a change to the documentation and I have updated it accordingly.

@louib
Copy link
Copy Markdown
Member

louib commented Oct 14, 2018

@Vi-n thanks for the PR!

I think you incorporated changes already merged into develop in this PR. Could you fix that?

Copy link
Copy Markdown
Member

@phoerious phoerious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! Please make the changes requested. Also please add at least one test case to the CLI test suite and obviously fix the conflicts.

@phoerious phoerious added this to the v2.4.0 milestone Oct 20, 2018
Command can be used to create a database using the command line. The
database can be secured by a key file and/or password. A key file can be
specified that will be created when it does not exist. The password will
be read from stdin, the same way as it's currently being done for
unlocking the database. When no key is specifed the function will fail.

Challenge response to unlock the database is not supported.

This functionality has been inspired by issue keepassxreboot#2220, and solves point 1
of that issue.
In pull request keepassxreboot#2351 phoerious updated the coding style for cli
components. This commit implements similar changes for the new Create
component
Command can be used to create a database using the command line. The
database can be secured by a key file and/or password. A key file can be
specified that will be created when it does not exist. The password will
be read from stdin, the same way as it's currently being done for
unlocking the database. When no key is specifed the function will fail.

Challenge response to unlock the database is not supported.

This functionality has been inspired by issue keepassxreboot#2220, and solves point 1
of that issue.
In pull request keepassxreboot#2351 phoerious updated the coding style for cli
components. This commit implements similar changes for the new Create
component
@droidmonkey
Copy link
Copy Markdown
Member

Closing in favor of #2540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants