open

github.com/sindresorhus/open Developer Tools Open-source projectOpen source

Open URLs, files, or executables from command-line tools and scripts with the cross-platform open package.

github.com/sindresorhus/open
open homepage screenshot

About open

open is an open-source package that opens URLs, files, or executables from command-line tools and scripts. It opens targets in the default app for the file type or in a specified app with arguments, using the open command on macOS, start on Windows, and xdg-open on other platforms.

It is not for use in the browser, and Electron projects should use shell.openPath() instead. It is native ESM with no CommonJS export, makes no security guarantees for untrusted input, and has limits to the wait option.

Key features

  • Open URLs, files, or executables in default apps
  • Open targets in a specified app with arguments
  • Wait for opened app to exit before continuing
  • Open new app instance on macOS with option
  • Run apps in background on macOS without foreground focus
  • Support WSL paths to Windows apps
Best for: Developers writing command-line tools and scripts that need to open URLs, files, or apps.
Good for
  • Uses open on macOS, start on Windows, and xdg-open on other platforms
  • Uses spawn instead of exec
  • Includes xdg-open script for Linux
Watch out for
  • Not for browser use; Electron should use shell.openPath() instead
  • Makes no security guarantees; caller must sanitize untrusted input
  • Native ESM only with no CommonJS export

open at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Platforms
Linux, Windows
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

open alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in Developer Tools

Well-known listings from the same topic.

All 423

open FAQ

Can I use open in the browser?
No. It is meant for command-line tools and scripts, not in the browser. For Electron, use shell.openPath() instead.
Can I use open with CommonJS?
No. It is native ESM and no longer provides a CommonJS export. Convert to ESM or use the dynamic import() function.
Why does wait not work as expected with browsers?
Browsers use a single-instance architecture where new URLs are passed to the existing process, causing the command to exit immediately. Use the newInstance option on macOS to force a new browser instance, or avoid using wait with browsers.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing