open-cli

Open stuff like URLs, files, executables. Cross-platform.

MIT 15 个版本
安装
npm install open-cli
yarn add open-cli
pnpm add open-cli
bun add open-cli
README

open-cli

Open stuff like URLs, files, executables. Cross-platform.

Install

npm install --global open-cli

Usage

$ 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.

  • open - API for this package
版本列表
9.0.0 2026-03-25
8.0.0 2023-12-19
7.2.0 2023-03-20
7.1.0 2022-10-05
7.0.1 2021-08-30
7.0.0 2021-06-15
6.0.1 2020-03-26
6.0.0 2020-03-19
5.0.0 2019-05-13
1.0.5 2015-10-19
1.0.4 2015-10-09
1.0.3 2015-10-08
1.0.2 2015-10-04
1.0.1 2015-10-04
1.0.0 2015-10-04