{"id":14069722,"url":"https://github.com/4U6U57/wsl-open","last_synced_at":"2025-07-30T06:32:31.553Z","repository":{"id":27037434,"uuid":"112230617","full_name":"4U6U57/wsl-open","owner":"4U6U57","description":"Open files with xdg-open on Bash for Windows in Windows applications. Read only mirror from GitLab, see link :point_right:","archived":false,"fork":false,"pushed_at":"2022-05-26T17:19:37.000Z","size":410,"stargazers_count":513,"open_issues_count":8,"forks_count":27,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-09T05:46:05.209Z","etag":null,"topics":["linux","windows-subsystem","wsl","xdg-open"],"latest_commit_sha":null,"homepage":"http://gitlab.com/4U6U57/wsl-open","language":"Shell","has_issues":false,"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/4U6U57.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":"CODEOWNERS","security":null,"support":null}},"created_at":"2017-11-27T18:08:36.000Z","updated_at":"2025-06-05T03:22:02.000Z","dependencies_parsed_at":"2022-07-09T14:00:20.885Z","dependency_job_id":null,"html_url":"https://github.com/4U6U57/wsl-open","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/4U6U57/wsl-open","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4U6U57%2Fwsl-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4U6U57%2Fwsl-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4U6U57%2Fwsl-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4U6U57%2Fwsl-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4U6U57","download_url":"https://codeload.github.com/4U6U57/wsl-open/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4U6U57%2Fwsl-open/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267822686,"owners_count":24149670,"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-07-30T02:00:09.044Z","response_time":70,"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":["linux","windows-subsystem","wsl","xdg-open"],"created_at":"2024-08-13T07:07:10.189Z","updated_at":"2025-07-30T06:32:31.299Z","avatar_url":"https://github.com/4U6U57.png","language":"Shell","funding_links":[],"categories":["WSL Tools","Shell"],"sub_categories":["10. GUI Apps"],"readme":"# wsl-open (:open_file_folder: :arrow_right: :computer:)\n\n[![pipeline\nstatus](https://gitlab.com/4U6U57/wsl-open/badges/master/pipeline.svg)](https://gitlab.com/4U6U57/wsl-open/commits/master)\n[![npm\nversion](https://img.shields.io/npm/v/wsl-open.svg)](http://npmjs.com/package/wsl-open)\n\nUtility for opening files within the [Windows Subsystem for Linux][wsl] command\nline in Windows GUI applications.\n\n## Usage\n\nJust run **wsl-open** with the file/directory/URL that you want to open.\n\n```bash\nwsl-open { FILE | DIRECTORY | URL }\n\n```\n\n- `FILE` paths can be relative or absolute\n- `DIRECTORY` paths are the same, with a possible limitation*\n- `URL`s must include the protocol (`http://`, `https://`, `ftp://`, etc) or\n  begin with `www`, which is consistent with how `xdg-open` handles URLs\n\n\u003e *If using a WSL build without the `wslpath` (prior to Build 1803 - released\n\u003e April 2018), only Windows directories can be opened\n\n### Examples\n\n```bash\n# Opens in your Windows default image viewer\nwsl-open image.png\n\n# Relative and absolute paths work\nwsl-open ../Downloads/resume.pdf\nwsl-open /home/other/README.txt\n\n# Directories under Windows\nwsl-open /mnt/c/Users/4u6u5/Music\n\n# Opens your Windows default browser\nwsl-open http://google.com\n```\n\n### Set file associations\n\nThe real benefit of **wsl-open** is setting it as the default program in the\nWindows Subsystem for a particular filetype. This allow you to use Linux's\nstandard `xdg-open` utility to open files, and wsl-open will handle the rest!\nThis keeps your scripts platform agnostic.\n\n```bash\n# Set association for file type\nwsl-open -a image.png\n\n# Now, you can open up any PNG with xdg-open, and wsl-open will handle it\nxdg-open another_image.png\n\n# Unassociate wsl-open with a file type\nwsl-open -d image.png\n\n# Associate wsl-open with links (set wsl-open as your shell's BROWSER)\nwsl-open -w\n\n# Now URL's work as well!\nxdg-open https://gitlab.com/4U6U57/wsl-open\n\n# And this allows other programs that depend on xdg-open to use it as well!\nnpm repo wsl-open # Same as the previous command\n```\n\n\u003e **Protip**: I like to furthur generalize my scripts by setting `alias\n\u003e open='xdg-open'` on my Linux machines, which make them behave more like macOS\n\n### Full specification\n\nFor full details on how the script operates, feel free to check out the\n[manpage][manpage] or [design specification][design]\n\n## Installation\n\n### npm\n\nThe easiest way to get it is to use the [Node Package Manager][npm] and install\nit globally.\n\n```bash\n# Get npm if you don't have it already\nsudo apt-get install -yqq npm\n\n# Install\nsudo npm install -g wsl-open\n```\n\n### Standalone\n\n**wsl-open** is actually just a single, self contained bash script, so the bare\nminimum installation is simply downloading the script (either by cloning the\nrepo or via `curl`) and then adding it to your path. Here is an example:\n\n```bash\n# Make a bin folder in your home directory\nmkdir ~/bin\n\n# Add the bin folder to your PATH in your bashrc\necho '[[ -e ~/bin ]] \u0026\u0026 export PATH=$PATH:~/bin' \u003e\u003e ~/.bashrc\n\n# Download the script to a file named 'wsl-open'\ncurl -o ~/bin/wsl-open https://raw.githubusercontent.com/4U6U57/wsl-open/master/wsl-open.sh\n```\n\n[wsl]: https://msdn.microsoft.com/en-us/commandline/wsl/about\n[npm]: https://npmjs.com\n[manpage]: MANUAL.md\n[design]: DESIGN.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4U6U57%2Fwsl-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4U6U57%2Fwsl-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4U6U57%2Fwsl-open/lists"}