diff --git a/.env.example b/.env.example index 4b3cbbc2a..7e7563bdd 100755 --- a/.env.example +++ b/.env.example @@ -39,3 +39,39 @@ VITE_CONTEXT_WINDOW=160000 CONTEXT_WINDOW=160000 # VITE_IS_PLATFORM=false + +# ============================================================================= +# AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION START +# ============================================================================= + +# Prerequisites: +# - AWS CLI must be installed and configured +# - Run 'aws configure' to set up your credentials and default region +# - Or ensure AWS credentials are available via environment variables or IAM roles + + +# To use AWS Bedrock instead of Anthropic API +# Uncomment the following lines and fill in the credentials +# CLAUDE_CODE_USE_BEDROCK=1 + +# AWS Credentials +# Or use AWS Profile (in ~/.aws/config and ~/.aws/credentials) + +# AWS_REGION=eu-central-1 +# AWS_PROFILE=default +# AWS_ACCESS_KEY_ID=your-access-key-id +# AWS_SECRET_ACCESS_KEY=your-secret-access-key + +# Default Anthropic models for switching using /model command (EU inference profiles) +# keep in mind that the models in different regions will have different prefixes +# ANTHROPIC_DEFAULT_SONNET_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" +# ANTHROPIC_DEFAULT_OPUS_MODEL="eu.anthropic.claude-opus-4-5-20251101-v1:0" +# ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" + +# Assign exact models for claude to use from startup +# ANTHROPIC_MODEL="eu.anthropic.claude-sonnet-4-5-20250929-v1:0" +# ANTHROPIC_SMALL_FAST_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0" + +# ============================================================================= +# AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION END +# ============================================================================= diff --git a/server/routes/cli-auth.js b/server/routes/cli-auth.js index 1de309d6a..ce10116b0 100644 --- a/server/routes/cli-auth.js +++ b/server/routes/cli-auth.js @@ -14,7 +14,8 @@ router.get('/claude/status', async (req, res) => { return res.json({ authenticated: true, email: credentialsResult.email || 'Authenticated', - method: 'credentials_file' + method: credentialsResult.isBedrock ? 'bedrock' : 'credentials_file', + isBedrock: credentialsResult.isBedrock || false }); } @@ -75,6 +76,16 @@ router.get('/codex/status', async (req, res) => { }); async function checkClaudeCredentials() { + // Check if using AWS Bedrock - no OAuth needed + if (process.env.CLAUDE_CODE_USE_BEDROCK === '1' || + process.env.CLAUDE_CODE_USE_BEDROCK === 'true') { + return { + authenticated: true, + email: 'AWS Bedrock', + isBedrock: true + }; + } + try { const credPath = path.join(os.homedir(), '.claude', '.credentials.json'); const content = await fs.readFile(credPath, 'utf8'); diff --git a/src/components/Settings.jsx b/src/components/Settings.jsx index 0d828a8e8..39716dbf1 100644 --- a/src/components/Settings.jsx +++ b/src/components/Settings.jsx @@ -602,7 +602,8 @@ function Settings({ isOpen, onClose, projects = [], initialTab = 'agents' }) { authenticated: data.authenticated, email: data.email, loading: false, - error: data.error || null + error: data.error || null, + isBedrock: data.isBedrock || false }); } else { setClaudeAuthStatus({ diff --git a/src/components/settings/AccountContent.jsx b/src/components/settings/AccountContent.jsx index e9b2d3fe7..2f67b04cc 100644 --- a/src/components/settings/AccountContent.jsx +++ b/src/components/settings/AccountContent.jsx @@ -89,28 +89,31 @@ export default function AccountContent({ agent, authStatus, onLogin }) { -