test-api-keys-ai-universe
Test API keys against jleechanorg/ai_universe repository services
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- type
- testing
- scope
- project
- description
- Test API keys against jleechanorg/ai_universe repository services
03 SKILL.md 正文
Test API Keys Against AI Universe Repository
This skill provides a script to test API keys from your .bashrc against the actual services used by the jleechanorg/ai_universe repository.
Overview
The script:
- Clones the
ai_universerepository to/tmp - Tests API keys against the actual API endpoints used by the repo
- Validates GitHub access to the repository
- Tests LLM API keys (Gemini, OpenAI, Anthropic, Perplexity, OpenRouter)
- Provides a summary of test results
Prerequisites
curlinstalled (usually pre-installed on macOS/Linux)gitinstalled- API keys configured in
~/.bashrc - Internet connection
Usage
Basic Usage
# Run the test script
bash /tmp/test_ai_universe_api_keys.sh
The script will:
- Load API keys from
~/.bashrc - Clone the
ai_universerepository to/tmp/ai_universe_api_test_*/ - Test each API key against its respective service
- Display results and cleanup temporary files
What Gets Tested
The script tests the following API keys (loaded from ~/.bashrc):
| API Key | Service | Purpose in AI Universe |
|---|---|---|
GITHUB_TOKEN |
GitHub API | Repository access and authentication |
GEMINI_API_KEY |
Google Gemini | Primary AI model for game master |
OPENAI_API_KEY |
OpenAI | Multi-model synthesis |
ANTHROPIC_API_KEY |
Anthropic Claude | Multi-model synthesis |
PERPLEXITY_API_KEY |
Perplexity | Multi-model synthesis |
OPENROUTER_API_KEY |
OpenRouter | Multi-model synthesis |
Expected Output
========================================
AI Universe API Key Testing
========================================
Loading API keys from ~/.bashrc...
Cloning ai_universe repository...
✅ Repository cloned successfully
Checking API key usage in repository...
✅ Found API key references in:
- backend/server.py
- frontend/src/services/ai.ts
Testing API keys...
Testing GitHub repo access...
✅ GitHub token valid - Can access repo: jleechanorg/ai_universe
Testing Gemini API...
✅ Gemini API key valid - Can list models
Testing OpenAI API...
✅ OpenAI API key valid
Testing Anthropic API...
✅ Anthropic API key valid
Testing Perplexity API...
✅ Perplexity API key valid
Testing OpenRouter API...
✅ OpenRouter API key valid
========================================
Test Summary
========================================
Passed: 6
Failed: 0
Total: 6
✅ All API keys are valid!
Troubleshooting
Script Not Found
If the script doesn't exist at /tmp/test_ai_universe_api_keys.sh, you can recreate it:
# The script is created automatically, but if needed, you can ask Claude to recreate it
# or copy it from the project documentation
API Keys Not Found
If you see "❌ API_KEY not set" errors:
-
Verify keys are in
.bashrc:grep -E "export (GITHUB_TOKEN|GEMINI_API_KEY|OPENAI_API_KEY|ANTHROPIC_API_KEY|PERPLEXITY_API_KEY|OPENROUTER_API_KEY)=" ~/.bashrc -
Reload your shell:
source ~/.bashrc -
Check key format:
- Keys should be exported with
export KEY_NAME="value" - No spaces around the
=sign - Quotes are optional but recommended
- Keys should be exported with
GitHub Access Denied
If GitHub token test fails:
-
Check token permissions:
- Token needs
reposcope for private repositories - Token needs
read:orgfor organization repositories
- Token needs
-
Verify token is valid:
curl -H "Authorization: Bearer $GITHUB_TOKEN" \ https://api.github.com/user -
Regenerate token if needed:
- Go to https://github.com/settings/tokens
- Create new token with appropriate scopes
API Key Invalid Errors
If an API key test fails:
-
Check the key value:
echo $GEMINI_API_KEY # Replace with the failing key name -
Verify key hasn't expired:
- Some API keys have expiration dates
- Check your account dashboard for the service
-
Check quota/credits:
- Some services may show "valid" but have no credits
- Check your account balance
Repository Clone Fails
If the repository clone fails:
-
Check network connectivity:
ping github.com -
Verify repository exists:
curl -I https://github.com/jleechanorg/ai_universe -
Check GitHub access:
- Repository might be private
- Your GitHub token needs appropriate permissions
Integration with Other Tools
Use with CI/CD
You can integrate this script into CI/CD pipelines:
# Example GitHub Actions workflow
- name: Test API Keys
run: |
bash /tmp/test_ai_universe_api_keys.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
# ... other keys
Use with Monitoring
Set up a cron job to test keys periodically:
# Add to crontab (crontab -e)
# Test API keys daily at 2 AM
0 2 * * * bash /tmp/test_ai_universe_api_keys.sh >> /tmp/api_key_test.log 2>&1
Security Notes
- Temporary Files: The script creates temporary directories in
/tmp/that are automatically cleaned up - API Keys: Keys are loaded from
~/.bashrcbut not logged or stored - Repository: Only clones the repository temporarily for analysis
- Network: Makes API calls to validate keys - ensure you're on a secure network
Related Skills
- ai-universe-auth.md - Authentication setup for AI Universe MCP server
- ai-universe-httpie.md - Using HTTPie with AI Universe APIs
- gcp-deployment.md - GCP deployment and service management
Script Location
The script is located at:
- Path:
/tmp/test_ai_universe_api_keys.sh - Working Directory:
/tmp/ai_universe_api_test_*/(temporary, auto-cleaned) - Repository Clone:
/tmp/ai_universe_api_test_*/ai_universe/(temporary)
Maintenance
The script is automatically maintained and can be recreated if needed. To update:
- Ask Claude to recreate the script
- Or modify the script directly at
/tmp/test_ai_universe_api_keys.sh
Example Workflow
# 1. Test all API keys
bash /tmp/test_ai_universe_api_keys.sh
# 2. If GitHub fails, check token
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user
# 3. If Gemini fails, test directly
curl "https://generativelanguage.googleapis.com/v1beta/models?key=$GEMINI_API_KEY"
# 4. Fix any issues and re-run
bash /tmp/test_ai_universe_api_keys.sh
04 同仓库更多 Skills
instinct
Use when the user invokes /instinct or /in, or asks to "message Instinct", "ask Instinct", "tell Instinct", "check Instinct", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.
hr
Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.
history-resume
Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.
grok
Alias for the canonical grokbot browser conversation workflow; /grok talks to the Grok bot the same way /dot talks to Dot.
codexa-bench
Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.