Skip to content

A professional command-line interface (CLI) tool built with Python and boto3 to interact with Amazon S3.

Notifications You must be signed in to change notification settings

ayushsgit/S3-Manager-CLI-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

S3 Manager CLI

A Python CLI tool built with boto3 and click to demonstrate core AWS S3 operations.

Features

  • Generate HTML observability dashboard (S3 + EC2)
  • Create S3 buckets
  • Upload files
  • Download files
  • List objects in a bucket
  • Generate pre-signed URLs for temporary access
image

Project Structure

s3-manager-project/
β”œβ”€β”€ s3_manager/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ cli.py
β”‚   └── dashboard.py
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── test_cli.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ setup.py
β”œβ”€β”€ policy.json
└── README.md

Setup

  1. Install Python 3.8+
  2. Install the tool:
    pip install -e .
  3. Configure AWS Credentials: Ensure you have AWS credentials set up via one of these methods:
    • aws configure (sets up the default profile)
    • aws configure --profile my-profile
    • Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

Usage

# Generate Resource Dashboard
s3-manager -p my-profile report

# Get help
s3-manager --help
s3-manager create-bucket --help

# Create a bucket (bucket names must be GLOBALLY unique)
s3-manager --profile my-profile --region us-east-1 create-bucket my-unique-bucket-name-123

# Upload a file
s3-manager -p my-profile upload-file my-unique-bucket-name-2 ./my-photo.jpg --object-key images/vacation.jpg

# List objects
s3-manager -p my-profile list-objects my-unique-bucket-name-2

# Generate a pre-signed URL
s3-manager -p my-profile generate-presigned-url my-unique-bucket-name-2 images/vacation.jpg --expires-in 300

# Download a file
s3-manager -p my-profile download-file my-unique-bucket-name-2 images/vacation.jpg ./downloaded-photo.jpg

About

A professional command-line interface (CLI) tool built with Python and boto3 to interact with Amazon S3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages