MCPcopy Index your code
hub / github.com/Byron/open-rs

github.com/Byron/open-rs @v5.3.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.3.6 ↗ · + Follow
50 symbols 91 edges 9 files 12 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Crates.io cross-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:

# macOS
$ open <path-or-url>
# Windows
$ start <path-or-url>
# Linux
$ xdg-open <path-or-url> || gio open <path-or-url> || gnome-open <path-or-url> || kde-open <path-or-url>
# WSL
$ powershell.exe -NoProfile -Command "Start-Process -FilePath '<path-or-url>'" || xdg-open <path-or-url> || gio open <path-or-url> || gnome-open <path-or-url> || kde-open <path-or-url>

To open a web browser, see the webbrowser crate, which offers functionality for that specific case.

Library Usage

Add this to your Cargo.toml

[dependencies]
open = "5"

…and open something using…

open::that("https://rust-lang.org");

…or, open something with an application of your choice

open::with("https://rust-lang.org", "firefox");

Follow this link for the API docs.

Binary Usage

This crate also implements a binary that acts like an opener itself.

cargo run 'file to open'

Credits

The implementation is based on the respective functionality of Cargo, but was improved to allow some error handling.

Extension points exported contracts — how you extend this code

IntoResult (Interface)
(no doc) [1 implementers]
src/lib.rs
CommandExt (Interface)
(no doc) [1 implementers]
src/lib.rs

Core symbols most depended-on inside this repo

wide
called by 4
src/windows.rs
with_command
called by 3
src/lib.rs
into_result
called by 3
src/lib.rs
status_without_output
called by 3
src/lib.rs
wrap_in_quotes
called by 3
src/windows.rs
that
called by 2
src/lib.rs
with
called by 2
src/lib.rs
commands
called by 2
src/lib.rs

Shape

Function 41
Class 4
Method 3
Interface 2

Languages

Rust100%

Modules by API surface

src/windows.rs15 symbols
src/lib.rs13 symbols
src/wsl.rs11 symbols
src/unix.rs2 symbols
src/redox.rs2 symbols
src/macos.rs2 symbols
src/ios.rs2 symbols
src/haiku.rs2 symbols
src/main.rs1 symbols

For agents

$ claude mcp add open-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact