Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,40 @@ 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 (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
# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_SONNET_MODEL # default
# export ANTHROPIC_MODEL=$ANTHROPIC_DEFAULT_OPUS_MODEL # uncomment to use opus as default
# export ANTHROPIC_SMALL_FAST_MODEL=$ANTHROPIC_DEFAULT_HAIKU_MODEL

# =============================================================================
# AWS BEDROCK CONFIGURATION & ANTHROPIC MODEL FOR AWS BEDROCK CONFIGURATION END
# =============================================================================
13 changes: 12 additions & 1 deletion server/routes/cli-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down Expand Up @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion src/components/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
41 changes: 22 additions & 19 deletions src/components/settings/AccountContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,31 @@ export default function AccountContent({ agent, authStatus, onLogin }) {
</div>
</div>

<div className="border-t border-gray-200 dark:border-gray-700 pt-4">
<div className="flex items-center justify-between">
<div>
<div className={`font-medium ${config.textClass}`}>
{authStatus?.authenticated ? t('agents.login.reAuthenticate') : t('agents.login.title')}
</div>
<div className={`text-sm ${config.subtextClass}`}>
{authStatus?.authenticated
? t('agents.login.reAuthDescription')
: t('agents.login.description', { agent: config.name })}
{/* Hide login section for Bedrock users */}
{!authStatus?.isBedrock && (
<div className="border-t border-gray-200 dark:border-gray-700 pt-4">
<div className="flex items-center justify-between">
<div>
<div className={`font-medium ${config.textClass}`}>
{authStatus?.authenticated ? t('agents.login.reAuthenticate') : t('agents.login.title')}
</div>
<div className={`text-sm ${config.subtextClass}`}>
{authStatus?.authenticated
? t('agents.login.reAuthDescription')
: t('agents.login.description', { agent: config.name })}
</div>
</div>
<Button
onClick={onLogin}
className={`${config.buttonClass} text-white`}
size="sm"
>
<LogIn className="w-4 h-4 mr-2" />
{authStatus?.authenticated ? t('agents.login.reLoginButton') : t('agents.login.button')}
</Button>
</div>
<Button
onClick={onLogin}
className={`${config.buttonClass} text-white`}
size="sm"
>
<LogIn className="w-4 h-4 mr-2" />
{authStatus?.authenticated ? t('agents.login.reLoginButton') : t('agents.login.button')}
</Button>
</div>
</div>
)}

{authStatus?.error && (
<div className="border-t border-gray-200 dark:border-gray-700 pt-4">
Expand Down