Post

Quick Tip: Installing AWS CLI v2 with uv Tool

A quick tip on using uv tool to install and manage AWS CLI v2, making Python-based CLI tool installation easier.

Quick Tip: Installing AWS CLI v2 with uv Tool

The Problem with Traditional Installation Methods

If you’re managing your Python environments with uv, you might have encountered these issues:

Using Homebrew:

1
brew install awscli

While this works, Homebrew installs AWS CLI with its own Python version, managed by brew rather than uv. This creates a separate Python ecosystem outside of uv’s control.

Using uv tool install:

1
uv tool install awscli

This command only installs AWS CLI v1, not the newer v2 that most users want.

The Solution: Install AWS CLI v2 with uv

Here’s how to install AWS CLI v2 while keeping everything managed by uv:

1
uv tool install git+https://github.com/aws/aws-cli.git@v2

This command:

  • Installs AWS CLI v2 directly from the official GitHub repository
  • Uses uv’s Python environment management
  • Keeps all your Python tools in one unified ecosystem

Verify Installation

After installation, verify that AWS CLI v2 is installed:

1
aws --version

You should see output confirming v2 is being used:

1
aws-cli/2.x.x Python/3.x.x ...

Notice the version starts with 2.x.x, confirming you have AWS CLI v2 installed via uv!

All rights reserved.