Skip to content
/ open Public

A tool for opening URL's using their OS defined default application.

Notifications You must be signed in to change notification settings

pastdev/open

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open

A tool for opening URL's using their OS defined default application. This is an abstraction around standard OS specific default program opening commands:

After installation, you can simply open urls:

# open a web browser at a specific url
open https://github.com/pastdev/open

# open an image viewer
open ~/pictures/me.jpg

# open a text editor
open /tmp/app.out

Installation

open is a self contained binary that has pre-built releases for various platforms. You may find this script valuable for installation:

# note this command uses clconf which can be found here:
#   https://github.com/pastdev/clconf
(
  # where do you want this installed?
  binary="${HOME}/.local/bin/open"
  # one of linux, darwin, windows
  platform="linux"
  curl \
    --location \
    --output "${binary}" \
    "$(
      curl --silent https://api.github.com/repos/pastdev/open/releases/latest \
        | clconf \
          --pipe \
          jsonpath "$..assets[*][?(@.name =~ /askai-${platform/windows/windows.exe}/)].browser_download_url" \
          --first)"
  chmod 0755 "${binary}"
)

Development

Use the default go run:

go run ./cmd/open "https://github.com/pastdev/open"

About

A tool for opening URL's using their OS defined default application.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages