# PowerShell LLM/CC Environment Switch - {{env_name}}
# Generated by fnva

{{#if config.anthropic_auth_token}}
# Anthropic/GLM-CC environment
$env:ANTHROPIC_AUTH_TOKEN = "{{config.anthropic_auth_token}}"
{{/if}}

{{#if config.anthropic_base_url}}
$env:ANTHROPIC_BASE_URL = "{{config.anthropic_base_url}}"
{{/if}}

{{#if config.default_model}}
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "{{config.default_model}}"
{{/if}}

{{#if config.api_key}}
$env:OPENAI_API_KEY = "{{config.api_key}}"
{{/if}}

{{#if config.openai_base_url}}
$env:OPENAI_API_BASE = "{{config.openai_base_url}}"
{{/if}}

{{#if config.base_url}}
$env:OPENAI_API_BASE = "{{config.base_url}}"
{{/if}}

{{#if config.model}}
$env:OPENAI_MODEL = "{{config.model}}"
{{/if}}

{{#if config.temperature}}
$env:OPENAI_TEMPERATURE = "{{config.temperature}}"
{{/if}}

{{#if config.max_tokens}}
$env:OPENAI_MAX_TOKENS = "{{config.max_tokens}}"
{{/if}}

# Set fnva environment tracking
$env:FNVA_CURRENT_{{#if (eq env_type "Cc")}}CC{{else}}LLM{{/if}} = "{{env_name}}"
$env:FNVA_ENV_TYPE = "{{#if (eq env_type "Cc")}}CC{{else}}LLM{{/if}}"

# Claude Code specific settings
{{#if config.anthropic_auth_token}}
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
$env:API_TIMEOUT_MS = "30000"
{{/if}}

# Verify the switch
Write-Host "✅ Switched to {{#if (eq env_type "Cc")}}Claude Code (CC){{else}}LLM{{/if}} environment: {{env_name}}" -ForegroundColor Green

{{#if config.anthropic_auth_token}}
Write-Host "🔑 Anthropic Auth Token: ✓" -ForegroundColor Yellow
{{/if}}

{{#if config.anthropic_base_url}}
Write-Host "🌐 Base URL: {{config.anthropic_base_url}}" -ForegroundColor Yellow
{{/if}}

{{#if config.default_model}}
Write-Host "🤖 Default Model: {{config.default_model}}" -ForegroundColor Yellow
{{/if}}