
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
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 cannot 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 147,367 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.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.