{"id":20106146,"url":"https://github.com/himkt/zsh-platform-switcher","last_synced_at":"2025-10-06T13:09:16.743Z","repository":{"id":237884100,"uuid":"795422179","full_name":"himkt/zsh-platform-switcher","owner":"himkt","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-16T11:33:44.000Z","size":13,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T01:32:51.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/himkt.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":"2024-05-03T08:45:45.000Z","updated_at":"2024-11-16T11:33:46.000Z","dependencies_parsed_at":"2024-05-03T13:31:28.076Z","dependency_job_id":"4bde8c4a-357a-4f96-8a65-9b37aafe6315","html_url":"https://github.com/himkt/zsh-platform-switcher","commit_stats":null,"previous_names":["himkt/platform-switcher"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/himkt/zsh-platform-switcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fzsh-platform-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fzsh-platform-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fzsh-platform-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fzsh-platform-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himkt","download_url":"https://codeload.github.com/himkt/zsh-platform-switcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fzsh-platform-switcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278614709,"owners_count":26016018,"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-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2024-11-13T17:49:13.375Z","updated_at":"2025-10-06T13:09:16.722Z","avatar_url":"https://github.com/himkt.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zsh-platform-switcher\n\nSwitching architecture with cleaning up environment variables with one command.\n\n```shell\n[arm64] \u003e use-platform x86_64\n[x86_64] \u003e uname -m\nx86_64\n[x86_64] \u003e use-platform arm64\n[arm64] \u003e uname -m\narm64\n```\n\n### Pre-requisite\n\nAdding the following code-snippet to your `.zshrc`.\nYou can customize `PROMPT` (I recommend you to show `current_platform` on your terminal).\n\n```zsh\nfunction current_platform () {\n  local platform=\"$(uname -m)\"\n\n  if [ \"$platform\" = \"x86_64\" ] ; then\n    echo \"[\\033[1;32m$platform\\033[0m]\"\n  elif [ \"$platform\" = \"arm64\" ]; then\n    echo \"[\\033[1;31m$platform\\033[0m]\"\n  fi\n}\nPROMPT=\"$(current_platform) \u003e \"\n```\n\n### Installation\n\nYou can use `zsh-platform-switcher` by loading `zsh-platform-switcher.zsh` on your zsh config.\nIf you can use a package manager like Sheldon:\n\nSheldon:\n\n```toml\n[plugins.zsh-platform-switcher]\ngithub = 'himkt/zsh-platform-switcher'\napply = ['source']\n```\n\n### Known issue\n\nhttps://github.com/himkt/zsh-platform-switcher/issues/1: `exit` does not work correctly. When hitting the enter key twice,\na platform will be silently reverted to `x86_64`.\n\n```zsh\n\u003e uname -m  # -\u003e arm64\n\u003e use-platform x86_64  # -\u003e change platform to x86_64\n\u003e uname -m  # -\u003e x86_64\n\u003e exit\n\u003e uname -m  # arm64\n\u003e uname -m  # x86_64  (!!)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Fzsh-platform-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimkt%2Fzsh-platform-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Fzsh-platform-switcher/lists"}