Skip to content

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 7, 2025

Add ability to store API keys in configuration

Description

This PR implements the functionality requested in issue #134, allowing users to store API keys in the configuration file as an alternative to setting environment variables.

Changes

  • Added API key fields to the default configuration in config.ts
  • Updated the API key retrieval logic in $default.ts to check both the config file and environment variables
  • Added special handling for API keys in the config command with security warnings and confirmation
  • Added example to the help text for setting API keys

Security Considerations

  • Added warnings about the security implications of storing API keys in plaintext
  • Added a confirmation prompt before storing API keys
  • Environment variables still take precedence over stored configuration

Testing

  • Manually tested setting and using API keys from configuration
  • Verified that the confirmation prompt works correctly
  • Confirmed that environment variables take precedence when both are set

Related Issues

Fixes #134

@bhouston bhouston merged commit a018feb into main Mar 7, 2025
1 check passed
Copy link

🎉 This PR is included in version mycoder-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bhouston bhouston deleted the feature/api-keys-in-config branch March 12, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to store API keys in configuration

1 participant