
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
The open-cli npm package allows you to open files, URLs, or applications using the command line. It is a simple and efficient tool for automating the opening of various resources directly from the terminal.
Open a URL
This feature allows you to open a URL in the default web browser. The code sample demonstrates how to open Google's homepage.
open-cli 'https://www.google.com'
Open a file
This feature allows you to open a file with the default application associated with its file type. The code sample demonstrates how to open a text file located at a specific path.
open-cli './path/to/file.txt'
Open an application
This feature allows you to open an application by its name. The code sample demonstrates how to open the Calculator application.
open-cli 'Calculator'
The opn package is similar to open-cli in that it allows you to open files, URLs, or applications from the command line. However, opn is more focused on being a programmatic API for opening things, whereas open-cli is more command-line oriented.
The open package is another alternative that provides similar functionality. It is a more modern and actively maintained package compared to opn. It also offers more options and flexibility for opening files, URLs, or applications.
Open stuff like URLs, files, executables. Cross-platform.
$ npm install --global open-cli
$ open-cli --help
Usage
$ open-cli <file|url> [--wait] [--background] [-- <app> [args]]
$ cat <file> | open-cli [--extension] [--wait] [--background] [-- <app> [args]]
Options
--wait Wait for the app to exit
--background Do not bring the app to the foreground (macOS only)
--extension File extension for when stdin file type can't be detected
Examples
$ open-cli https://sindresorhus.com
$ open-cli https://sindresorhus.com -- firefox
$ open-cli https://sindresorhus.com -- 'google chrome' --incognito
$ open-cli unicorn.png
$ cat unicorn.png | open-cli
$ echo '<h1>Unicorns!</h1>' | open-cli --extension=html
The following file types are automagically detected when using stdin mode.
FAQs
Open stuff like URLs, files, executables. Cross-platform.
The npm package open-cli receives a total of 162,728 weekly downloads. As such, open-cli popularity was classified as popular.
We found that open-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.