{"id":21393978,"url":"https://github.com/mchirico/switch-context","last_synced_at":"2026-05-21T07:44:18.763Z","repository":{"id":60749016,"uuid":"544506750","full_name":"mchirico/switch-context","owner":"mchirico","description":"switch-context is a CLI tool to switch between AWS profiles and other environments (ARGO, alias, git)","archived":false,"fork":false,"pushed_at":"2023-01-24T14:15:23.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T01:41:57.407Z","etag":null,"topics":["aws"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mchirico.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}},"created_at":"2022-10-02T16:49:29.000Z","updated_at":"2022-11-17T19:47:50.000Z","dependencies_parsed_at":"2023-02-13T22:16:50.703Z","dependency_job_id":null,"html_url":"https://github.com/mchirico/switch-context","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchirico%2Fswitch-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchirico%2Fswitch-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchirico%2Fswitch-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mchirico%2Fswitch-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mchirico","download_url":"https://codeload.github.com/mchirico/switch-context/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878614,"owners_count":20362463,"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"],"created_at":"2024-11-22T14:13:57.854Z","updated_at":"2026-05-21T07:44:18.703Z","avatar_url":"https://github.com/mchirico.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go](https://github.com/mchirico/switch-context/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/mchirico/switch-context/actions/workflows/go.yml)\n# Switch-context\n\nThis project was originally created by [Dara]( https://github.com/DaraDadachanji)\n\n## Installation\n\nInstall Go from the [official website](https://go.dev/)\n\nclone this repository and build the executable. Then move it to your bin folder\n\n```bash\ngit clone https://github.com/mchirico/switch-context.git\ncd switch-context\ngo mod tidy\ngo build -o switch-context\nmv ./switch-context ~/bin/switch-context\n```\n\nadd the following snippet to your .bashrc\n\n```bash\n\n# switch-context\nfunction sc() {\n    if [ \"$#\" -ne 1 ]; then\n\tswitch-context  -f ~/.switchcontext/switchcontext\n\treturn\n    fi\n    switch-context  $1 -f ~/.switchcontext/switchcontext \u003e/dev/null\n    source ~/.switchcontext/switchcontext\n}\nsource ~/.switchcontext/switchcontext\n\n\n```\n\nThis allows the environment variable changes to persist in the shell session.\n\n## Configuration\n\ncreate a folder in your home directory named `.switchcontext`\nand a file inside named `profiles.yaml`\n\nfor example:\n\nDon't use \"~\" as home in profiles.yaml.  Instead\nwrite out the full path.\n\n```yaml\nlog:\n  filename: switchcontext.log\n  maxSize: 10\n  maxBackups: 5\n  maxAge: 30\nprofiles:\n  usprod:\n    env:\n      AWS_PROFILE: default\n      AWS_REGION: us-east-1\n    kube: us-prod\n    bash:\n      PS1: '\\h:\\W (usp) \\u\\$'\n    argo:\n      ARGO_BASE_HREF: 'localhost:2746'\n      ARGO_HTTP1: true\n      ARGO_NAMESPACE: \"argo\"\n      ARGO_SECURE: true\n      ARGO_SERVER: \"workflows.reports.com:443\"\n      ARGO_TOKEN: unset\n    alias:\n      argo: argo --kubeconfig ~/.kube/config list --insecure-skip-verify --insecure-skip-tls-verify\n      dev: kubectl run --rm -i --tty dev --image=mchirico/ubuntu:latest --restart=Never --pod-running-timeout=6m0s -- bash -il\n      badalias: unalias\n  ukprod:\n    env:\n      AWS_PROFILE: ukprod\n      AWS_REGION: eu-west-2\n    kube: uk-prod\n    bash:\n      PS1: '\\h:\\W (ukp) \\u\\$'\n\n```\n\n## Usage\n\nCall `sc` and then the name of your profile\n\n`sc usprod`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchirico%2Fswitch-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmchirico%2Fswitch-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmchirico%2Fswitch-context/lists"}