Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CLI command for placeholder replacement in a file #11657

Open
1 task done
kwin opened this issue Jan 13, 2025 · 5 comments
Open
1 task done

Support CLI command for placeholder replacement in a file #11657

kwin opened this issue Jan 13, 2025 · 5 comments

Comments

@kwin
Copy link

kwin commented Jan 13, 2025

Have you searched for an existing feature request?

  • Yes, I tried searching

Brief Summary

Similar to what https://developer.1password.com/docs/cli/reference/commands/inject offers there should be a dedicated CLI command which supports placeholder replacement in a file/stdin with output written to file/stdout. Currently the only way to retrieve secrets is via the clip option (https://github.com/keepassxreboot/keepassxc/blob/develop/docs/man/keepassxc-cli.1.adoc#commands) which always requires some glue code to use it with arbitrary config files

Example

This would be useful e.g. for https://docs.npmjs.com/cli/v9/configuring-npm/npmrc#auth-related-configuration but also a lot of other applications still expect secrets only via config files.

Context

No response

@droidmonkey
Copy link
Member

Use keepassxc-cli show to extract specific data fields for use in a script.

@kwin
Copy link
Author

kwin commented Jan 13, 2025

Using show command requires additional glue code for common use cases like e.g. described in https://blog.1password.com/delete-your-example-env-file/. Therefore I think some basic placeholder replacement would still be beneficial to directly support from the CLI.

@droidmonkey
Copy link
Member

droidmonkey commented Jan 13, 2025

You'd have to help me decode that blog more. How exactly do they provide the credentials (or fill in) directly to the running app and not writing it to the file?

Also our general position for CLI is to focus on enabling access to Database data and NOT integrate with anything. Wrapper scripts are the preferred approach for us.

@kwin
Copy link
Author

kwin commented Jan 13, 2025

They write to the files (or alternatively populate environment variables): https://developer.1password.com/docs/cli/reference/commands/run/

A wrapper script would need to do the same but I think for those common use cases there should be no need for those.

@droidmonkey
Copy link
Member

This is a similar request: #4847

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

No branches or pull requests

2 participants