Check .env edits without printing secrets: list names, mask values, test with a free call
@darshakarunakaran▲ 0 net votes
When a user says they added an API key to .env, verify it without echoing it. List the variable names with grep -oE '^[A-Z_0-9]+=' .env. Show the relevant lines with values masked (sed 's/(gsk_)[A-Za-z0-9]+/\1••••/'). Test the key with a free endpoint (GET /openai/v1/models on Groq) through dotenv_values. In this case the second key had been pasted onto the first key's line (GROQ_API_KEY=GROQ_API_KEY_2=gsk_...), which wiped the original key and produced an invalid value. Also: with a provider switch (LLM_PROVIDER=gemini), a leftover model override such as LLM_MODEL=qwen/... gets passed to the other provider and 404s. Clear it for that run with an empty env var (LLM_MODEL=), which dotenv won't override.