cd packages/rycode
bun test src/auth/__tests__/Expected output:
β
24 pass (auto-detect.test.ts)
β
38 pass (cli.test.ts)
β
33 pass (integration.test.ts)
---
β
95+ pass total
The binary has been built and is ready to test:
./bin/rycodeNote: You'll see the Matrix rain splash screen, then the authentication issue will appear because you still have test API keys.
You have two options:
./scripts/add-api-keys.shThis will guide you through adding real API keys for:
- Claude (Anthropic)
- Gemini (Google)
- OpenAI
- Grok (optional)
- Qwen (optional)
cd packages/rycode
# Add Claude
bun run src/auth/cli.ts auth anthropic "sk-ant-api03-YOUR-REAL-KEY"
# Add Gemini
bun run src/auth/cli.ts auth google "AIzaYOUR-REAL-KEY"
# Add OpenAI
bun run src/auth/cli.ts auth openai "sk-YOUR-REAL-KEY"
# Verify
bun run src/auth/cli.ts listOnce you have 2+ providers authenticated:
./bin/rycodeThen:
- Type
/modelto open model selector - Press
Tabto cycle between providers - Press
Enterto select a model
You should see all your authenticated providers and be able to cycle through them!
bun test src/auth/__tests__/auto-detect.test.tsTests:
- Environment variable detection (7 tests)
- Config file handling (2 tests)
- CLI tool detection (2 tests)
- Message generation (3 tests)
- Import functionality (3 tests)
- Onboarding UI (3 tests)
- Integration scenarios (4 tests)
bun test src/auth/__tests__/cli.test.tsTests:
- Command parsing (4 tests)
- Check command (5 tests)
- Auth command (6 tests)
- List command (4 tests)
- Auto-detect command (3 tests)
- Cost command (3 tests)
- Health command (4 tests)
- Recommendations (3 tests)
- JSON output (3 tests)
- Security validation (3 tests)
bun test src/auth/__tests__/integration.test.tsTests:
- Single provider flows (5 tests)
- Multi-provider setup (3 tests)
- Model selection (4 tests)
- Auto-detection (3 tests)
- Error handling (4 tests)
- Performance validation (4 tests)
- User journeys (3 tests)
# 1. Check for existing credentials
cd packages/rycode
bun run src/auth/cli.ts auto-detect
# 2. Add first provider (Claude recommended)
bun run src/auth/cli.ts auth anthropic "sk-ant-api03-..."
# 3. Add second provider for Tab cycling
bun run src/auth/cli.ts auth google "AIza..."
# 4. Verify
bun run src/auth/cli.ts list
# 5. Test in TUI
cd ../..
./bin/rycodecd packages/rycode
# Check specific provider
bun run src/auth/cli.ts check anthropic
# Check all providers
bun run src/auth/cli.ts list
# Check provider health
bun run src/auth/cli.ts health anthropiccd packages/rycode
# View current costs
bun run src/auth/cli.ts cost
# Should show:
# - Today's cost
# - Month cost
# - Projection
# - Savings tip (if any)Solution: Some tests may take time. Increase timeout:
bun test --timeout 30000 src/auth/__tests__/Solution: Your auth.json has test keys. Fix with:
rm ~/.local/share/rycode/auth.json
./scripts/add-api-keys.shSolution: You need at least 2 real authenticated providers:
cd packages/rycode
bun run src/auth/cli.ts list # Should show 2+ providersSolution: Check API keys are valid:
cd packages/rycode
# Test each provider
bun run src/auth/cli.ts check anthropic
bun run src/auth/cli.ts check google
bun run src/auth/cli.ts check openaiRun integration tests to see performance:
cd packages/rycode
bun test src/auth/__tests__/integration.test.ts --grep "Performance"Expected results:
- Authentication: < 1000ms β
- Status Check: < 100ms β
- List Providers: < 200ms β
- Auto-Detect: < 500ms β
The GitHub Actions workflow will run automatically on push.
Manual trigger:
# Push changes to trigger CI
git push origin dev
# Or use GitHub web interface:
# Actions β Auth System Tests β Run workflowGenerate coverage report:
cd packages/rycode
bun test --coverage src/auth/__tests__/View coverage:
open coverage/index.htmlTarget: 90%+ coverage β
- Claude: https://console.anthropic.com/
- Gemini: https://makersuite.google.com/app/apikey
- OpenAI: https://platform.openai.com/api-keys
- Auth file:
~/.local/share/rycode/auth.json - Binary:
./bin/rycode - Tests:
packages/rycode/src/auth/__tests__/
# Run all tests
bun test src/auth/__tests__/
# Run TUI
./bin/rycode
# Fix authentication
./scripts/add-api-keys.sh
# Check status
bun run src/auth/cli.ts list- Authentication Setup: Add 2+ real API keys
- Tab Cycling: Verify you can switch between providers
- Model Selection: Verify models appear for each provider
- Test Suite: Verify all 95+ tests pass
- Cost Tracking: Use the CLI and check costs after some usage
- Health Checks: Verify provider health status
- Auto-Detection: Test if existing env vars are detected
- Performance: Run performance benchmarks
- Coverage: Generate and review coverage report
- CI/CD: Verify GitHub Actions workflow runs
β
All 95+ tests pass
β
Binary runs without errors
β
At least 2 providers authenticated
β
Tab cycling works in /model selector
β
Models appear for each provider
β
Can send messages and get responses
- β
Binary built:
bin/rycode(25MB) - β Tests passing: 24/24 auto-detect tests
β οΈ Authentication: Test keys (need real keys)- β³ Tab cycling: Pending real API keys
-
Add Real API Keys (Required):
./scripts/add-api-keys.sh
-
Test Tab Cycling:
./bin/rycode # Type: /model # Press: Tab
-
Verify All Tests Pass:
cd packages/rycode bun test src/auth/__tests__/
-
Start Coding:
./bin/rycode # You're ready! π
π€ Generated by Claude Code AI System Status: Ready for Testing β All Systems: GO π