Skip to main content

CLI tool to configure Claude Code for AWS Bedrock

Project description

claude-bedrock-setup

PyPI version Python Versions License: MIT Tests Coverage

A command-line tool to configure Claude Code to use AWS Bedrock as its AI provider. This tool simplifies the process of discovering available Claude models in your AWS account and automatically configures Claude Code with the appropriate settings.

Features

  • 🔐 Automatic AWS authentication detection - Verifies your AWS credentials before proceeding
  • 🔍 Model discovery - Automatically lists all available Claude models in your AWS Bedrock account
  • ⚙️ Simple configuration - Interactive setup wizard guides you through the process
  • 🌍 Multi-region support - Works with any AWS region that supports Bedrock
  • 🔒 Secure - Credentials are handled by AWS SDK, settings are stored locally
  • 🚀 Fast setup - Get up and running in under 30 seconds

Prerequisites

  • Python 3.10 or higher
  • AWS CLI configured with valid credentials
  • AWS account with access to Amazon Bedrock
  • Claude Code application installed

Installation

Via pip (recommended)

pip install claude-bedrock-setup

Via pipenv

pipenv install claude-bedrock-setup

From source

git clone https://github.com/christensen143/claude-bedrock-setup.git
cd claude-bedrock-setup
pip install -e .

Quick Start

  1. Ensure AWS authentication is configured:

    aws configure
    # or
    aws sso login --profile your-profile
    
  2. Run the setup wizard:

    claude-bedrock-setup setup
    
  3. Follow the interactive prompts to select your preferred Claude model

That's it! Claude Code is now configured to use AWS Bedrock.

Usage

Interactive Setup (Recommended)

The easiest way to configure Claude is using the interactive setup wizard:

claude-bedrock-setup setup

This will:

  1. Verify your AWS authentication
  2. List available Claude models in your account
  3. Let you select your preferred model
  4. Save the configuration for Claude Code

Manual Configuration

If you prefer to configure specific settings manually:

claude-bedrock-setup configure --model <model-arn> --region us-west-2

Check Current Configuration

To view your current configuration:

claude-bedrock-setup status

Example output:

Claude Bedrock Configuration Status
===================================

✅ AWS Authentication: Valid
   Account: 123456789012
   User: user@example.com

✅ Configuration File: .claude/settings.local.json

Current Settings:
- AWS_REGION: us-west-2
- Model: Claude 3.5 Sonnet v2
- Max Output Tokens: 4096

Reset Configuration

To reset your configuration:

claude-bedrock-setup reset

Configuration Details

The tool creates a .claude/settings.local.json file in your current directory with the following settings:

{
  "CLAUDE_CODE_USE_BEDROCK": "1",
  "AWS_REGION": "us-west-2",
  "ANTHROPIC_MODEL": "arn:aws:bedrock:...",
  "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "4096",
  "MAX_THINKING_TOKENS": "1024"
}

The tool also automatically updates your .gitignore to exclude the settings file.

AWS Authentication

claude-bedrock-setup supports all standard AWS authentication methods:

  • AWS CLI profiles: aws configure
  • AWS SSO: aws sso login --profile your-profile
  • Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
  • IAM roles: When running on EC2 or with assumed roles

Required AWS Permissions

Your AWS credentials need the following permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock:ListInferenceProfiles",
        "bedrock:GetInferenceProfile"
      ],
      "Resource": "*"
    }
  ]
}

Troubleshooting

"No Claude models found"

This usually means your AWS account doesn't have access to Claude models in Bedrock. To fix:

  1. Log into AWS Console
  2. Navigate to Amazon Bedrock
  3. Go to Model Access
  4. Request access to Anthropic Claude models
  5. Wait for approval (usually immediate)
  6. Run claude-bedrock-setup setup again

"Access Denied" errors

If you're using AWS SSO or assumed roles, ensure your profile is active:

aws sso login --profile your-profile
export AWS_PROFILE=your-profile
claude-bedrock-setup setup

Region-specific issues

Some AWS regions don't support Bedrock. Supported regions include:

  • us-east-1 (N. Virginia)
  • us-west-2 (Oregon)
  • eu-west-1 (Ireland)
  • ap-southeast-1 (Singapore)

Use the --region flag to specify a different region:

claude-bedrock-setup setup --region us-east-1

Development

Setting up for development

git clone https://github.com/christensen143/claude-bedrock-setup.git
cd claude-bedrock-setup
make install-dev

Running tests

make test                 # Run tests
make test-coverage        # Run tests with coverage report
make lint                 # Run linting
make format              # Format code
make check               # Run all checks

Building for distribution

make build               # Build distribution packages
make upload-test         # Upload to TestPyPI
make upload              # Upload to PyPI

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (make check)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Please ensure:

  • All tests pass
  • Code coverage remains above 95%
  • Code follows the project style (run make format)
  • Commit messages are clear and descriptive

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with Click for the CLI interface
  • Uses Rich for beautiful terminal output
  • AWS SDK (boto3) for AWS interactions

Support

Changelog

See CHANGELOG.md for a detailed history of changes.

Roadmap

  • Support for multiple configuration profiles
  • Configuration templates for different use cases
  • Direct integration with Claude Code API
  • Support for other AI providers
  • Configuration validation and testing

Made with ❤️ by the Claude Setup team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_bedrock_setup-0.2.0.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_bedrock_setup-0.2.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file claude_bedrock_setup-0.2.0.tar.gz.

File metadata

  • Download URL: claude_bedrock_setup-0.2.0.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for claude_bedrock_setup-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eb5a2f14fbfc92636e6d3c2f81d5fafc55ae9c0a93e8cf5f8356749592028d3d
MD5 793f3eb60607bf5f0b3437678e9276bd
BLAKE2b-256 f5a4238d2df0978242173543a5f34a5d403be7d6f494cad03922364e198f1648

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_bedrock_setup-0.2.0.tar.gz:

Publisher: release.yml on christensen143/claude-bedrock-setup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_bedrock_setup-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_bedrock_setup-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4295f14a4495d49a18b6c96b08309bfceacacb073c706bcedd7aa51271d65d5
MD5 300e73083c57a0db8e72f4b9b8b40a06
BLAKE2b-256 0583b52ae23d0304c29c6892b9a7ba38e228aac9e850711441d051cfad1d59b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_bedrock_setup-0.2.0-py3-none-any.whl:

Publisher: release.yml on christensen143/claude-bedrock-setup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page