{"id":16982228,"url":"https://github.com/maxpatiiuk/github-resolver","last_synced_at":"2026-04-17T01:31:18.560Z","repository":{"id":210589226,"uuid":"655484056","full_name":"maxpatiiuk/github-resolver","owner":"maxpatiiuk","description":"A CLI script for rapidly opening the GitHub webpage for current file/folder on a correct branch","archived":false,"fork":false,"pushed_at":"2025-03-15T02:02:24.000Z","size":284,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T10:08:56.132Z","etag":null,"topics":["cli","github","github-cli","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/maxpatiiuk.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":"2023-06-19T02:09:29.000Z","updated_at":"2025-03-15T02:02:28.000Z","dependencies_parsed_at":"2023-12-03T22:21:20.337Z","dependency_job_id":"41a0aa2c-40f8-4b50-8194-567537da5c14","html_url":"https://github.com/maxpatiiuk/github-resolver","commit_stats":null,"previous_names":["maxpatiiuk/github-resolver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxpatiiuk/github-resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpatiiuk%2Fgithub-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpatiiuk%2Fgithub-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpatiiuk%2Fgithub-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpatiiuk%2Fgithub-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxpatiiuk","download_url":"https://codeload.github.com/maxpatiiuk/github-resolver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxpatiiuk%2Fgithub-resolver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31911429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","github","github-cli","terminal"],"created_at":"2024-10-14T02:07:37.082Z","updated_at":"2026-04-17T01:31:18.552Z","avatar_url":"https://github.com/maxpatiiuk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI integration with GitHub Web UI\n\nA CLI script for rapidly opening the GitHub webpage for current file/folder on a\ncorrect branch.\n\nIt can also do the reverse: given a github URL, open that file locally\n\n- Supports GitHub Enterprise\n- Supports repositories cloned with SSH\n- Supports multiple git remotes\n\n## Installation\n\nNode.js 16+ is required\n\nInstall dependencies:\n\n```\nnpm install\n```\n\nAdd this to your shell init file. Change the \"dir\" variable to the directory in\nwhich this repository is located.\n\n```sh\ngu() {\n  local dir=~/s/javascript/github-resolver\n  local output=$(node \"${dir}/dist/main.js\" $@)\n  if [[ \"${output}\" =~ \"^cd \" ]]; then\n    eval ${output}\n  else\n    echo \"${output}\"\n  fi\n}\n```\n\n## Open current directory in GitHub\n\nOpen your terminal to any directory inside a clonned repository. Then:\n\n```sh\n# Open current folder on current branch in GitHub\ngu\n\n# Open ./main.js on current branch in GitHub\n# All of these varians do the same thing. Pick whichever you like:\ngu main.js\ngu ./main.js\ngu --file ./main.js\ngu --file=./main.js\ngu -f./main.js\n\n# Open ../main.js on production in GitHub\ngu ../main.js production\ngu production ../main.js\ngu --branch=production --file=../main.js\ngu -b=production -f ../main.js\n\n# Open current folder on the production branch on the URL configuered for git remote \"origin2\"\ngu production origin2\ngu --branch production --remote origin2\ngu origin2 production\n\n# Open the repository pull requests page\ngu --pr\n\n# By adding \"--dry\", you can output the web url, but don't open it\ngu ./main.js --dry\n# Could even write it to file:\ngu ./main.js --dry \u003e url.txt\n# Or pass to a different program:\ngu ./main.js --dry | less\n```\n\n## Open GitHub Webpage in terminal\n\nNavigates to the directory or the file based on GitHub URL.\n\nBefore running the script, `cd` to correct repository.\n\nFor example, this will navigate to the root directory of current repository:\n\n```sh\ngu https://github.com/specify/specify7/tree/production/\n```\n\nBesides navigation, it would also list files in that directory using `ls`\ncommand. That behaviour can be customized by setting `LIST_FILES` environment\nvariable to the command you want to run instead\n\nFor example:\n\n```sh\n# In the init file:\nexport LIST_FILES=\"ls -ahl\"\n\n# Later:\ngu https://github.com/specify/specify7/tree/production/\n```\n\nAnd this will open the `README.md` file in your editor:\n\n```sh\ngu https://github.com/specify/specify7/blob/production/README.md\n```\n\nYou can customize the used editor by setting an `EDITOR` environment variable:\n\n```sh\n# In the init file:\nexport EDITOR=\"vim\"\n\n# Later:\ngu https://github.com/specify/specify7/tree/production/\n```\n\nBy default it would use system's default editor associated with the file\nextension of the file you are trying to open.\n\n\u003e Note, this script would not change the current branch as that could lead to\n\u003e loss of uncommitted changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpatiiuk%2Fgithub-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxpatiiuk%2Fgithub-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxpatiiuk%2Fgithub-resolver/lists"}