# reopen-cli

> Improvement over `open` utility for macOS and Chrome; open URLs in the browser but instead of creating new tabs every time, use existing ones by mutating them.

Latest version **0.5.0** (published 2022-06-19) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install reopen-cli
pnpm add reopen-cli
yarn add reopen-cli
bun add reopen-cli
```

Provides the command `reopen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2022-06-19 |
| First published | 2018-02-25 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 41.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Kutsan Kaplan |
| Maintainers | kutsan |
| Keywords | open, osascript, cli |

## Links

- npm: https://www.npmjs.com/package/reopen-cli
- Repository: https://github.com/kutsan/reopen-cli
- Homepage: https://github.com/kutsan/reopen-cli#readme
- Issues: https://github.com/kutsan/reopen-cli/issues
- npm.io page: https://npm.io/package/reopen-cli

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.5.0 (latest) — 2022-06-19
- 0.4.0 — 2020-05-15
- 0.3.0 — 2020-05-15
- 0.2.1 — 2018-03-26
- 0.2.0 — 2018-03-12
- 0.1.0 — 2018-02-25

## README

<img width="100" src="https://github.com/kutsan/reopen-cli/raw/master/.github/assets/logo.png" alt="Logo" />

# reopen-cli

[![npm](https://img.shields.io/npm/v/reopen-cli)](https://www.npmjs.com/package/reopen-cli)

|        | Comparison with macOS's `open`       |
|--------|--------------------------------------|
| open   | ![](https://i.imgur.com/frcd25E.gif) |
| reopen | ![](https://i.imgur.com/PgMxiUH.gif) |

## Requirements

- `osascript` which is pre-installed macOS utility
- Google Chrome

## Features

- Should open Google Chrome if it's not already open.
- Should open a new window, if there is no window but Google Chrome is open.
- If there is only one window, one tab and it's new empty tab, it should use that tab.
- Should focus Google Chrome after opening the URL.
- Should focus first tab, if there is one or multiple.
- Should create a new tab, if there is none.
- Should preserve history.

## Installation

```sh
npm install --global reopen-cli
```

## Usage

### Synopsis

```sh
reopen '<url>'
```

### Example

```sh
reopen 'https://devdocs.io/#q=html'
reopen 'https://devdocs.io/#q=react'
```

### Using with vim

Although you can use with any URL, one particular example would be opening
[devdocs.io](https://devdocs.io) upon pressing `'keywordprg'` mapping which is `K` by default.

Create a command.

```vim
command! -nargs=* Docs call system(printf('reopen "https://devdocs.io/?q=%s"', <q-args>))
```

Set `'keywordprg'` to that command.

```vim
set keywordprg=:Docs
```

Now, pressing `K` under any keyword (or e.g. `:Docs child_process`) will bring
DevDocs docs and repeating that would replace current open tab.

## License

GPL-3.0

---
_Source: https://npm.io/package/reopen-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
