Skip to content

fix(config): detect placeholder API keys as missing#142

Closed
Redestiny wants to merge 1 commit intoNarcooo:masterfrom
Redestiny:env-placeholder-detection
Closed

fix(config): detect placeholder API keys as missing#142
Redestiny wants to merge 1 commit intoNarcooo:masterfrom
Redestiny:env-placeholder-detection

Conversation

@Redestiny
Copy link
Copy Markdown

@Redestiny Redestiny commented Apr 1, 2026

Summary

  • Align placeholder API key detection across doctor, init, and config loading so example values like your-api-key-here and sk-your-key-here are treated as missing config.
  • Sync .env.example with currently supported optional env settings to reduce drift between docs and actual behavior.
  • Add regression tests covering placeholder API keys and the generated .env template from init.

Type of change

  • Bug fix
  • New feature
  • Refactor (no behavior change)
  • Docs / SKILL.md
  • Test
  • Performance

Motivation (optional)

  • Example API key placeholders could be misread by the CLI as real configuration, which makes doctor output and first-time setup guidance misleading.
  • This change keeps the example files, validation logic, and tests aligned.

Changes

File Change
.env.example Normalize the API key placeholder
packages/core/src/utils/config-loader.ts Add shared placeholder API key detection and treat placeholder values as missing
packages/core/src/index.ts Export the shared API key detection helper for CLI reuse
packages/cli/src/utils.ts Add a helper to detect configured API keys from .env file contents
packages/cli/src/commands/init.ts Reuse the shared detection logic and clean up duplicated / missing .env example lines
packages/cli/src/commands/doctor.ts Stop treating placeholder API keys as valid config
packages/core/src/__tests__/config-loader.test.ts Add regression coverage for placeholder API keys
packages/cli/src/__tests__/cli-integration.test.ts Add regression coverage for init output and doctor behavior

Testing

  • pnpm test

@Redestiny Redestiny closed this by deleting the head repository Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant