Skip to content

feat(cmd): add API validation tool for quick configuration testing #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

salignatmoandal
Copy link

What does this PR do?

This PR adds a simple CLI tool (cmd/validate-api/main.go) that allows users to quickly test their OpenAI API configuration without writing any code.

Why is this useful?

  • Quick diagnostics: Users can verify their API key and connection in seconds
  • Better error messages: Provides actionable guidance for common issues (auth, rate limits, network)
  • Developer experience: Helps new contributors and users troubleshoot setup issues
  • CI/CD integration: Can be used in scripts to validate configuration before running tests

What's included?

  • cmd/validate-api/main.go: Main validation tool (~100 lines)
  • Command line options: --api-key, --timeout, --verbose
  • Comprehensive error handling with actionable messages
  • Integration with existing environment variable support

How to test?

# Basic test
go run cmd/validate-api/main.go

# With options
go run cmd/validate-api/main.go --api-key sk-... --timeout 30s --verbose

# Test error handling (invalid key)
OPENAI_API_KEY=sk-invalid go run cmd/validate-api/main.go

Files changed

  • cmd/validate-api/main.go (new)
  • README.md (adds validation section)

Impact

  • No breaking changes: Doesn't affect existing API
  • Lightweight: ~100 lines, no external dependencies
  • Testable: Easy to validate manually
  • Maintainable: Simple, focused utility

Related Issues

N/A


Feel free to open an issue or PR if you have suggestions!

@salignatmoandal salignatmoandal requested a review from a team as a code owner July 8, 2025 16:56
@salignatmoandal salignatmoandal force-pushed the feat/add-api-validation-tool branch from 272e313 to 7211d1b Compare July 8, 2025 16:56
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