npm i -g textgame
$ textgame-server
$ textgame
You'll need an OpenAI API key if you want to use chat-mode—which you do.
Plug your key into the .env
file and you're good to go.
I prefer not to save secrets in plaintext, ever. Instead, I like to use the One Password CLI to inject what I need into my tty's env.
One Password allows a vault address to be used in place of the secret value, like so:
OPENAI_API_KEY="op://services/openai-creds/api-key"
OPENAI_API_ORG="op://services/openai-creds/org"
set -a
source <(op inject -i .env)
set +a
op run --no-masking --env-file=./.env textgame-server
Apache-2.0