{"id":17169762,"url":"https://github.com/naftulikay/aws-env","last_synced_at":"2025-10-05T09:52:08.421Z","repository":{"id":19215256,"uuid":"86519074","full_name":"naftulikay/aws-env","owner":"naftulikay","description":"A utility script for exporting an AWS profile as environment variables.","archived":false,"fork":false,"pushed_at":"2023-08-28T21:45:34.000Z","size":67,"stargazers_count":58,"open_issues_count":4,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-07T23:05:11.225Z","etag":null,"topics":["aws","buildout","python","python2","python3"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naftulikay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-28T23:59:27.000Z","updated_at":"2025-03-11T13:11:53.000Z","dependencies_parsed_at":"2024-06-19T03:04:50.014Z","dependency_job_id":"b0f02da8-8921-4766-bf99-c5e8f233496d","html_url":"https://github.com/naftulikay/aws-env","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/naftulikay/aws-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Faws-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Faws-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Faws-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Faws-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naftulikay","download_url":"https://codeload.github.com/naftulikay/aws-env/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naftulikay%2Faws-env/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278437956,"owners_count":25986760,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","buildout","python","python2","python3"],"created_at":"2024-10-14T23:27:16.279Z","updated_at":"2025-10-05T09:52:08.393Z","avatar_url":"https://github.com/naftulikay.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-env [![Build Status][build.svg]][build]\n\nA utility for exporting a given AWS credentials profile to environment variables. Useful for crossing\nmachine boundaries with SSH and Vagrant.\n\n## Background\n\nThe `aws` CLI and other tools such as Terraform can use an INI-format file located at `~/.aws/credentials` to\nstore different \"profiles\" and credentials/configuration for each. While this works fairly well, storing all\ncredentials in a single, unencrypted file is far from ideal.\n\nThis utility allows users to store profiles in multiple files, optionally using GnuPG for file encryption so that\nsecrets are never stored in plaintext when stored. `aws-env` will use an ordered loading system to load from:\n\n 1. the traditional `~/.aws/credentials` file in plaintext.\n 2. a GnuPG (`gpp`) encrypted file at `~/.aws/credentials.asc` or `~/.aws/credentials.gpg`.\n 3. both encrypted and plaintext profiles within the `~/.aws/credentials.d` directory, either with a suffix of\n    `*.gpg`/`*.asc`/`*.ini`, or without a file suffix.\n\nWhen using multiple files, `aws-env` creates prefixed names for profiles in case of multiple files containing the\nsame profile id. See the output of `aws-env list` for more information.\n\nOther features, such as the ability to use SSO profiles, are not supported yet, but this work is being tracked\nin #19.\n\n## Usage\n\nShamelessly ripped from `aws-env -h`:\n\n```\naws-env 2.0.0\n\nUSAGE:\n    aws-env [OPTIONS] \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n        --log-level \u003clog-level\u003e    Set the logging level for the utility [default: error]  [possible values: trace,\n                                   debug, info, warn, error]\n\nSUBCOMMANDS:\n    export    Export the specified profile\n    help      Prints this message or the help of the given subcommand(s)\n    list      List available profiles\n\n```\n\n### Listing Available Profiles\n\nTo list available profiles, use `aws-env list` command:\n\n```text\naws-env-list 2.0.0\nList available profiles\n\nUSAGE:\n    aws-env list [FLAGS] [OPTIONS]\n\nFLAGS:\n    -h, --help         Prints help information\n        --no-header    Exclude the header when printing to a TTY\n    -V, --version      Prints version information\n\nOPTIONS:\n    -F, --format \u003cformat\u003e    The output format [default: table]  [possible values: table, plain, csv, json]\n```\n\nListing profiles will never expose sensitive data, only the presence of profiles within the configuration files.\nBy default, the `table` format is used to display the profiles:\n\n```text\nprofile   prefix/profile priority file\n――――――――― ―――――――――――――― ―――――――― ――――――――――――――――――――――――――――\nhello     a/hello        00       ~/.aws/credentials.d/a.ini\ngoodbye   a/goodbye      01       ~/.aws/credentials.d/a.ini\nencrypted enc/encrypted  02       ~/.aws/credentials.d/enc.asc\ndefault   /default       03       ~/.aws/credentials\n```\n\nThe `profile` field is the name of the profile within a file, e.g. `[default]` will yield a name of `default`.\nThe `prefix/profile` field is a generated, qualified path to a profile, which is useful when multiple profiles\nwith the same name exist across multiple files. Both the profile name and the `prefix/profile` format are used\nduring lookup in `aws-env export`. The `priority` field is a generated field showing the load order of profiles,\nthe larger the value of `priority`, the higher precedence it has when collisions occur.\n\nFinally, the `file` field simply points to the file from which the given profile was found.\n\n### Exporting a Profile\n\nFor information on how profiles are loaded, see the previous section.\n\n`aws-env export` will dump the specified profile in shell commands to standard output.\n\n```text\naws-env-export 2.0.0\nExport the specified profile\n\nUSAGE:\n    aws-env export \u003cprofile_name\u003e\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nARGS:\n    \u003cprofile_name\u003e    The profile name to export. This can be either the bare profile name or a URI. See the 'list'\n                      command for URI format\n```\n\nFor example, to export the `default` profile mentioned above, run `aws-env export default`, and you will see output\nlike:\n\n```shell\nexport AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID\nexport AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY\n```\n\nAdditionally, qualified names can be used to resolve collisions. `aws-env export default` and `aws-env export /default`\nrefer to the same profile as described above.\n\n#### Directly Exporting to Shell\n\nSimply dumping the profile credentials to standard out does not mean that these are exported to your shell session.\nIn most shells, to directly export the credentials to the shell session, you can have your shell execute the output\nfrom `aws-env`:\n\n```shell\n$(aws-env export default)\n```\n\nWhen you run this in an interactive shell session, you won't see any output from the command, but you should be able\nto now see that the environment variables have been set correctly:\n\n```shell\n$ env | grep AWS_\nAWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID\nAWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY\n```\n\n## Installation\n\nTo install, clone the Git repository locally, and run `cargo install --path .` to install `aws-env` to your `PATH`\nunder `~/.cargo/bin`. You'll need a functional Rust compilation environment to install from source like this.\n\n## License\n\nLicensed at your discretion under either:\n\n - [Apache Software License, Version 2.0](./LICENSE-APACHE)\n - [MIT License](./LICENSE-MIT)\n\n [build]: https://github.com/naftulikay/aws-env/actions/workflows/rust.yml\n [build.svg]: https://github.com/naftulikay/aws-env/actions/workflows/rust.yml/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaftulikay%2Faws-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaftulikay%2Faws-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaftulikay%2Faws-env/lists"}