Configure Claude Project Planner - detects existing API keys or guides you through setup
Configures Claude Project Planner by detecting existing API keys or guiding setup.
/plugin marketplace add flight505/claude-project-planner/plugin install claude-project-planner@claude-project-plannerHelp the user configure the Claude Project Planner plugin for their environment.
First, check what API keys are already available in the user's environment:
# Check for existing keys (don't print values, just check existence)
echo "=== Checking Environment Variables ==="
[ -n "$CLAUDE_CODE_OAUTH_TOKEN" ] && echo "✅ CLAUDE_CODE_OAUTH_TOKEN: Found (Claude Max)" || echo "⬜ CLAUDE_CODE_OAUTH_TOKEN: Not set"
[ -n "$ANTHROPIC_API_KEY" ] && echo "✅ ANTHROPIC_API_KEY: Found" || echo "⬜ ANTHROPIC_API_KEY: Not set"
[ -n "$OPENROUTER_API_KEY" ] && echo "✅ OPENROUTER_API_KEY: Found" || echo "⬜ OPENROUTER_API_KEY: Not set"
[ -n "$PERPLEXITY_API_KEY" ] && echo "✅ PERPLEXITY_API_KEY: Found" || echo "⬜ PERPLEXITY_API_KEY: Not set"
For Claude Code CLI:
CLAUDE_CODE_OAUTH_TOKEN is preferred (Claude Max subscribers - automatic via browser login)ANTHROPIC_API_KEY is the alternative (direct API access)claude and authenticateFor Plugin Features (research, diagrams, images):
OPENROUTER_API_KEY enables research-lookup, project-diagrams, and generate-image skillsIf OPENROUTER_API_KEY is already set in the environment, confirm with the user:
"I detected OPENROUTER_API_KEY in your environment. This means the research and AI features are ready to use!
Would you like me to:
Most developers export keys in their shell profile (~/.zshrc, ~/.bashrc) - this is the recommended approach as it works across all projects.
If OPENROUTER_API_KEY is not found, guide the user:
"The research-lookup skill requires an OpenRouter API key for AI-powered research.
To set up:
Get your API key at: https://openrouter.ai/keys
Add to your shell profile (~/.zshrc or ~/.bashrc):
export OPENROUTER_API_KEY='sk-or-v1-your-key-here'
Reload your shell:
source ~/.zshrc
Or, if you prefer project-local configuration, I can store it in .claude/project-planner.local.md (gitignored)."
If the user wants project-local config, create .claude/project-planner.local.md:
---
# Project Planner Configuration
# This file is gitignored - safe for API keys
# OpenRouter API Key (for research-lookup, project-diagrams, generate-image)
openrouter_api_key: "USER_PROVIDED_KEY"
# Optional: Force specific research model
# research_model: "pro" # or "reasoning"
---
# Project Planner Local Configuration
This file contains project-specific configuration for Claude Project Planner.
It is automatically gitignored and safe for storing API keys.
## Configured Features
- Research Lookup: Enabled (via OpenRouter → Perplexity Sonar)
- Project Diagrams: Enabled (via OpenRouter → Nano Banana Pro)
- Image Generation: Enabled (via OpenRouter → FLUX/Gemini)
After setup, test that the keys work:
# Quick validation - just check the key format
if [ -n "$OPENROUTER_API_KEY" ]; then
if [[ "$OPENROUTER_API_KEY" == sk-or-* ]]; then
echo "✅ OPENROUTER_API_KEY format looks valid"
else
echo "⚠️ OPENROUTER_API_KEY doesn't match expected format (sk-or-...)"
fi
fi
Provide a summary of the configuration:
"## Setup Complete!
Claude Code Authentication:
Plugin Features:
Configuration Source: [Environment variables (~/.zshrc) / Project-local (.claude/project-planner.local.md)]
You're all set! Try /research-lookup to test the research feature."