m1guelpf / m1guelpf/plz-cli

Proposal: store OpenAI API key securely

Open
#18 0 comments 4 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.