Proposal: store OpenAI API key securely
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Description
I think that exposing secrets such as API keys to persistant shell variables is not safe.
One solution is to add this alias-like function to `.bashrc/.zshrc`
```sh
# API key is in the global scope only during this command's execution
function pls() { # called "pls" so that it does not clash with "plz"
export OPENAI_API_KEY=$(<~/.openai_api_key) # API key is stored in a separate file
plz $1
unset OPENAI_API_KEY
}
```
The other solution is to implement safe storage and retrieval in "plz" itself. Maybe using an OS native solution like "keychain" in OSX.
But I feel like this is too much to ask for.
Sadly I am unfamiliar with rust. So, I can't contribute right away.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed .bashrc/.zshrc function and how plz handles OPENAI_API_KEY. Compare temporary shell exposure with native secure storage such as the macOS Keychain. Done requires an agreed storage and retrieval design before implementation can be scoped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100