{"id":13539600,"url":"https://github.com/hiro-o918/awsctx","last_synced_at":"2025-05-07T06:50:18.104Z","repository":{"id":37022472,"uuid":"303044758","full_name":"hiro-o918/awsctx","owner":"hiro-o918","description":"Context Manager for AWS Profiles With Fuzzy Finder","archived":false,"fork":false,"pushed_at":"2025-03-28T22:26:39.000Z","size":603,"stargazers_count":17,"open_issues_count":8,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T23:26:54.218Z","etag":null,"topics":["aws","cli","fuzzy-search","profile-manager","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/awsctx","language":"Rust","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/hiro-o918.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-11T04:52:15.000Z","updated_at":"2024-12-06T10:46:47.000Z","dependencies_parsed_at":"2024-02-20T02:27:35.394Z","dependency_job_id":"f44ee27d-7bc7-4047-843a-0bbc9030172f","html_url":"https://github.com/hiro-o918/awsctx","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiro-o918%2Fawsctx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiro-o918%2Fawsctx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiro-o918%2Fawsctx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiro-o918%2Fawsctx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiro-o918","download_url":"https://codeload.github.com/hiro-o918/awsctx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831184,"owners_count":21810780,"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","cli","fuzzy-search","profile-manager","rust"],"created_at":"2024-08-01T09:01:28.858Z","updated_at":"2025-05-07T06:50:18.076Z","avatar_url":"https://github.com/hiro-o918.png","language":"Rust","funding_links":[],"categories":["Rust","cli"],"sub_categories":[],"readme":"# awsctx\n![](https://github.com/hiro-o918/awsctx/workflows/lint/badge.svg?branch=main)\n![](https://img.shields.io/crates/v/awsctx)\n![](https://img.shields.io/github/v/release/hiro-o918/awsctx?sort=semver)\n[![codecov](https://codecov.io/gh/hiro-o918/awsctx/branch/main/graph/badge.svg?token=TNNLDEJQYJ)](https://codecov.io/gh/hiro-o918/awsctx)\n\nContext manager for AWS profiles with a fuzzy finder\n\n## Demo\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./misc/demo.gif\" alt=\"demo\" width=\"80%\" /\u003e\n\u003c/div\u003e\n\n## Usage\n`help` command shows usage of each command.\n\n```console\n$ awsctx --help\nUSAGE:\n    awsctx [OPTIONS] [SUBCOMMAND]\n\nOPTIONS:\n    -h, --help\n            Print help information\n\n    -v, --verbose\n            Enable verbose output\n\n    -V, --version\n            Print version information\n\nSUBCOMMANDS:\n    active-context\n            Show active context in the credentials\n    auth\n            Auth awscli with the specified profile by pre-defined scripts, then make it active\n    completion\n            Generate completion script\n    help\n            Print this message or the help of the given subcommand(s)\n    list-contexts\n            List all the contexts in the credentials\n    refresh\n            Auth awscli for the active profile by pre-defined scripts\n    use-context\n            Updates a default profile by a profile name\n```\n\n## Installation\n### Homebrew (macOS only)\n```console\n$ brew tap hiro-o918/homebrew-tap\n$ brew install awsctx\n```\n\n### CLI\n**NOTE: [jq](https://github.com/stedolan/jq) required**\n\n:arrow_down: Download a binary and move to `/usr/local/bin`\n\n#### macOS\n```console\n$ curl -s https://api.github.com/repos/hiro-o918/awsctx/releases/latest \\\n  | jq -r '.assets[] | select(.name | test(\"^awsctx_v[0-9]+\\\\.[0-9]+\\\\.[0-9]+_x86_64-apple-darwin\\\\.tar\\\\.gz$\")) | .browser_download_url' \\\n  | xargs wget -O - \\\n  | tar zxvf - \\\n  \u0026\u0026 mv awsctx /usr/local/bin\n```\n\n#### Linux\n```console\n$ curl -s https://api.github.com/repos/hiro-o918/awsctx/releases/latest \\\n  | jq -r '.assets[] | select(.name | test(\"^awsctx_v[0-9]+\\\\.[0-9]+\\\\.[0-9]+_x86_64-unknown-linux-musl\\\\.tar\\\\.gz$\")) | .browser_download_url' \\\n  | xargs wget -O - \\\n  | tar zxvf - \\\n  \u0026\u0026 mv awsctx /usr/local/bin\n```\n\n## Configurations\n### configs.yaml\n`awsctx` refers to configurations in `~/.awsctx/configs.yaml`.\nIf you run `awsctx` once, configuration file is generated, or you can manually create new one to `~/.awsctx/configs.yaml`\n\nThe following is usage and an example of `configs.yaml`\n```yaml\n# Configurations for awsctx\n# You can manually edit configurations according to the following usage\n\n# To use subcommand `auth` or `refresh`, fill the below configs for each profile.\nauth_commands:\n  # configuration for `foo` profile with aws configure\n  foo: |\n    # you can use pre-defined parameter `{{profile}}` which is replaced by key of this block\n    # In this case, `{{profile}}` is replaced by `foo`\n    aws configure --profile {{profile}}\n  # configuration for `bar` profile with [onelogin-aws-cli](https://github.com/physera/onelogin-aws-cli)\n  bar: |\n    # In this case, name of one-login configuration is same as `profile`\n    onelogin-aws-login -C {{profile}} --profile {{profile}} -u user@example.com\n  # default configuration for profiles without auth configuration\n  __default: |\n    aws configure --profile {{profile}}\n```\n\n### Configure Completion\nTo enable completion, run the below command.\nIf you install `awsctx` by homebrew, this operation is not required\n\n```console\n$ awsctx completion --shell zsh \u003e /path/to/completions/_awsctx\n```\nPlease replace `/path/to` with a path in your environment.\n`bash`, `elvish` and `fish` are also available as a `--shell` option\n\n\n## How it Works\n### Login\nAuthorize your shell by some ways with specified profile name.\nThen, you get `~/.aws/credentials` like\n```\n[foo]\naws_access_key_id = XXXXXXXXXXX\naws_secret_access_key = XXXXXXXXXXX\naws_session_token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n[bar]\naws_access_key_id = YYYYYYYYYYY\naws_secret_access_key = YYYYYYYYYYY\naws_session_token = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\n```\n\n### Update the default profile by CLI\n`use-context` update `~/.aws/credentials` to contain `default` profile that the values are same as specified in the option.\n\n```console\n$ awsctx use-context -p foo\n```\ne.g. the above commands updates credentials as the below.\n```\n[foo]\naws_access_key_id = XXXXXXXXXXX\naws_secret_access_key = XXXXXXXXXXX\naws_session_token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n[bar]\naws_access_key_id = YYYYYYYYYYY\naws_secret_access_key = YYYYYYYYYYY\naws_session_token = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\n\n[default]\naws_access_key_id = XXXXXXXXXXX\naws_secret_access_key = XXXXXXXXXXX\naws_session_token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiro-o918%2Fawsctx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiro-o918%2Fawsctx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiro-o918%2Fawsctx/lists"}