https://github.com/byron/open-rs
Open a path or URL with the system-defined program
https://github.com/byron/open-rs
Last synced: about 1 month ago
JSON representation
Open a path or URL with the system-defined program
- Host: GitHub
- URL: https://github.com/byron/open-rs
- Owner: Byron
- License: mit
- Created: 2015-02-27T15:42:17.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2026-04-19T04:58:36.000Z (about 2 months ago)
- Last Synced: 2026-04-19T06:32:23.059Z (about 2 months ago)
- Language: Rust
- Homepage: http://byron.github.io/open-rs
- Size: 800 KB
- Stars: 391
- Watchers: 1
- Forks: 58
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://crates.io/crates/open)
[](https://github.com/Byron/open-rs/actions?query=workflow%3Across-platform-testing)
Use this library to open a path or URL using the program configured on the system. It is equivalent to running one of the following:
```bash
# macOS
$ open
# Windows
$ start
# Linux
$ xdg-open || gio open || gnome-open || kde-open || wslview
```
To open a web browser, see the [webbrowser](https://docs.rs/webbrowser) crate, which offers functionality for that specific case.
# Library Usage
Add this to your Cargo.toml
```toml
[dependencies]
open = "5"
```
…and open something using…
```Rust
open::that("https://rust-lang.org");
```
…or, open something with an application of your choice
```Rust
open::with("https://rust-lang.org", "firefox");
```
Follow this link for the [API docs](https://docs.rs/open).
# Binary Usage
This crate also implements a binary that acts like an opener itself.
```shell
cargo run 'file to open'
```
# Credits
The implementation is based on the respective functionality of [Cargo](https://github.com/rust-lang/cargo), but was improved to allow some error handling.