▲ | udbhavs 3 days ago | |||||||||||||||||||||||||
Next, set your OpenAI API key as an environment variable: export OPENAI_API_KEY="your-api-key-here" Note: This command sets the key only for your current terminal session. To make it permanent, add the export line to your shell's configuration file (e.g., ~/.zshrc). Can't any 3rd party utility running in the same shell session phone home with the API key? I'd ideally want only codex to be able to access this var | ||||||||||||||||||||||||||
▲ | jsheard 3 days ago | parent | next [-] | |||||||||||||||||||||||||
If you let malicious code run unsandboxed on your main account then you probably have bigger problems than an OpenAI API key getting leaked. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | jjmarr 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
Just don't export it?
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | primitivesuave 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
You could create a shell function - e.g. `codex() { OPENAI="xyz" codex "$@" }'. To call the original command use `command codex ...`. People downvoting legitimate questions on HN should be ashamed of themselves. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | 3 days ago | parent | prev [-] | |||||||||||||||||||||||||
[deleted] |