Skip to content
Open stuff like URLs, files, executables. Cross-platform.
JavaScript
Branch: master
Clone or download
Latest commit 46ad34a May 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create funding.yml May 28, 2019
.editorconfig Require Node.js 8 Nov 9, 2018
.gitattributes Require Node.js 8 Nov 9, 2018
.gitignore Require Node.js 8 Nov 9, 2018
.npmrc Require Node.js 8 Nov 9, 2018
.travis.yml Rename the project from `opn-cli` to `open-cli` May 13, 2019
cli.js Rename `--ext` flag to `--extension` May 13, 2019
license Require Node.js 8 Nov 9, 2018
package.json 5.0.0 May 13, 2019
readme.md Rename `--ext` flag to `--extension` May 13, 2019
test.js Require Node.js 8 Nov 9, 2018

readme.md

open-cli Build Status

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

Related

  • open - API for this module

License

MIT © Sindre Sorhus

You can’t perform that action at this time.