{"id":20400928,"url":"https://github.com/youtype/awscliv2","last_synced_at":"2025-06-20T23:08:06.411Z","repository":{"id":39792864,"uuid":"291325227","full_name":"youtype/awscliv2","owner":"youtype","description":"Wrapper for dockerized AWS CLI v2","archived":false,"fork":false,"pushed_at":"2024-09-27T01:36:39.000Z","size":6560,"stargazers_count":37,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-19T02:59:34.324Z","etag":null,"topics":["aws","awscli","docker"],"latest_commit_sha":null,"homepage":"https://youtype.github.io/awscliv2/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youtype.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-29T18:17:49.000Z","updated_at":"2025-01-23T13:34:38.000Z","dependencies_parsed_at":"2022-07-15T00:30:46.385Z","dependency_job_id":"61f8b7e4-e6f8-479b-95a0-667520d04f84","html_url":"https://github.com/youtype/awscliv2","commit_stats":{"total_commits":95,"total_committers":5,"mean_commits":19.0,"dds":"0.12631578947368416","last_synced_commit":"fcb5be3e63489abbc9e0ac6fb2cff86e526ce584"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/youtype/awscliv2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youtype%2Fawscliv2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youtype%2Fawscliv2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youtype%2Fawscliv2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youtype%2Fawscliv2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youtype","download_url":"https://codeload.github.com/youtype/awscliv2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youtype%2Fawscliv2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261010644,"owners_count":23096773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","awscli","docker"],"created_at":"2024-11-15T04:47:12.253Z","updated_at":"2025-06-20T23:08:01.394Z","avatar_url":"https://github.com/youtype.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CLI v2 for Python\n\n[![PyPI - awscliv2](https://img.shields.io/pypi/v/awscliv2.svg?color=blue\u0026label=awscliv2)](https://pypi.org/project/awscliv2)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/awscliv2.svg?color=blue)](https://pypi.org/project/awscliv2)\n[![PyPI - Downloads](https://static.pepy.tech/badge/awscliv2)](https://pepy.tech/project/awscliv2)\n\nWrapper for [AWS CLI v2](https://awscli.amazonaws.com/v2/documentation/api/latest/index.html).\n\n- [AWS CLI v2 for Python](#aws-cli-v2-for-python)\n  - [Features](#features)\n  - [Before you start](#before-you-start)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [From command line](#from-command-line)\n    - [Docker fallback](#docker-fallback)\n    - [Extra commands](#extra-commands)\n    - [As a Python module](#as-a-python-module)\n  - [Development](#development)\n  - [How to help](#how-to-help)\n  - [Versioning](#versioning)\n  - [Latest changes](#latest-changes)\n\n## Features\n\n- No dependency hell, like with original [awscli](https://pypi.org/project/awscli/)\n- Can install and update `awscliv2` binaries\n- Provides access to all AWS services\n- Has Python interface `awscliv2.api.AWSAPI`\n\n## Before you start\n\n- This is not an official AWS CLI v2 application, [rant there](https://github.com/aws/aws-cli/issues/4947)\n- Check the source code of this app, as you are working with sensitive data\n- By default this app uses [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image\n- To use [binaries for your OS](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html), run `awsv2 --install`\n- Cross-check the source code again, probably I want to\n  [steal your credentials](https://blog.sonatype.com/python-packages-upload-your-aws-keys-env-vars-secrets-to-web)!\n\n## Installation\n\n```bash\npython -m pip install awscliv2\n```\n\nYou can add an alias to your `~/.bashrc` or `~/.zshrc` to use it as a regular `AWS CLI v2`\n\n```bash\nalias aws='awsv2'\n```\n\n## Usage\n\n### From command line\n\nInstall `AWS CLI v2`:\n\n```bash\n# do not worry if this fails, you can still use awsv2 if you have docker installed\nawsv2 --install\n```\n\nConfigure default profile if needed:\n\n```bash\nAWS_ACCESS_KEY_ID='my-access-key'\nAWS_SECRET_ACCESS_KEY='my-secret-key'\n\n# --configure \u003cprofile_name\u003e \u003caws_access_key_id\u003e \u003caws_secret_access_key\u003e [\u003caws_session_token\u003e]\nawsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY}\nawsv2 configure set region us-west-1\n```\n\nUse `AWS CLI` as usual:\n\n```bash\n# alias for\n# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@\nawsv2 s3 ls\n\n# or as a python module\npython -m awscliv2 s3 ls\n```\n\nAlso, you can check [scripts/example.sh](https://github.com/youtype/awscliv2/blob/main/scripts/example.sh)\n\n### Docker fallback\n\nUnless you run `awsv2 --install` once, application will use [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image. The image is not ideal, and it uses `root` user, so fix downloaded file permissions manually. Or just run `awsv2 --install`\n\nUpdate it with `docker pull amazon/aws-cli`.\n\nContainer uses two volumes:\n\n- `$HOME/.aws` -\u003e `/root/.aws` - credentials and config store\n- `$(cwd)` -\u003e `/aws` - Docker image workdir\n\n### Extra commands\n\n`awscliv2` contains a few commands to make your life easier, especially in CI or any non-TTY environment.\n\n- `awsv2 -U/--update/--install` - Install `AWS CLI v2`\n- `awsv2 --configure \u003cprofile_name\u003e \u003caws_access_key_id\u003e \u003caws_secret_access_key\u003e [\u003caws_session_token\u003e] [\u003cregion\u003e]` - set profile in `~/.aws/credentials`\n- `awsv2 --assume-role \u003cprofile_name\u003e \u003csource_profile\u003e \u003crole_arn\u003e` - create a new profile with assume role credentials\n- `awsv2 -V/--version` - Output `awscliv2` and `AWS CLI v2` versions\n\n### As a Python module\n\nBasic usage\n\n```python\nfrom awscliv2.api import AWSAPI\nfrom awscliv2.exceptions import AWSCLIError\n\naws_api = AWSAPI()\n\ntry:\n    output = aws_api.execute([\"s3\", \"ls\"])\nexcept AWSCLIError as e:\n    print(f\"Something went wrong: {e}\")\nelse:\n    print(output)\n```\n\nInstall binaries for your OS from Python\n\n```python\nfrom awscliv2.installers import install_multiplatform\n\ninstall_multiplatform()\n```\n\nYou can also set credentials or assume roles\n\n```python\nfrom awscliv2.api import AWSAPI\n\naws_api = AWSAPI()\n\naws_api.set_credentials(\n    profile_name=\"my_profile\",\n    aws_access_key_id=\"access_key\",\n    aws_secret_access_key=\"secret_key\",\n    region=\"us-east-1\",\n)\naws_api.assume_role(\n    profile_name=\"my_profile\",\n    source_profile=\"source_profile\",\n    role_arn=\"role_arn\",\n)\n```\n\n## Development\n\n- Install [uv](https://docs.astral.sh/uv/): `curl -LsSf https://astral.sh/uv/install.sh | sh`\n- Install dependencies: `uv sync --all-extras --dev`\n- Run manual pre-commit: `./scripts/before_commit.sh`\n\n## How to help\n\n- Ping AWS team to release an official PyPI package\n- Share your experience in issues\n\n## Versioning\n\n`awscliv2` version follows [PEP 440](https://www.python.org/dev/peps/pep-0440/).\n\n## Latest changes\n\nFull changelog can be found in [Releases](https://github.com/youtype/awscliv2/releases).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoutype%2Fawscliv2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoutype%2Fawscliv2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoutype%2Fawscliv2/lists"}