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

How to call api_key_cmd interactively so one can fill prompt for a password? #392

Open
jumski opened this issue Feb 20, 2024 · 2 comments
Open

Comments

@jumski
Copy link

jumski commented Feb 20, 2024

I have written a simple script that i want to use to get OpenAI API key from bitwarden vault using bitwarden-cli:

#!/bin/bash

bw get item OpenAI | jq --raw-output '.fields[] | select(.name == "cli_token") | .value'

it is correctly called (verified by logging date from this script to a tmp log file) but given the session is noninteractive, Bitwarden CLI does not prompt for a password and just silently fails without printing on stdout.

Is there a way in ChatGPT.nvim to make api_key_cmd be called interactively so user can input a password?

It is relevant to #322

@rameshsanth
Copy link

PR #407 will allow user to provide a Lua function to obtain the key. I've included an example of which uses a http request to obtain the key. Maybe you can whip up a Lua function that can create interactive session and obtain the key.
Good luck

@jumski
Copy link
Author

jumski commented Mar 20, 2024

@rameshsanth that sounds great, it will definitely allow me to solve it elegantly. Thank you

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

No branches or pull requests

2 participants