Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kutsan/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.
https://github.com/kutsan/reopen-cli
google-chrome macos open osascript
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/kutsan/reopen-cli
- Owner: kutsan
- License: gpl-3.0
- Created: 2018-02-25T18:10:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-06-19T01:51:07.000Z (over 1 year ago)
- Last Synced: 2024-09-30T17:03:26.621Z (3 months ago)
- Topics: google-chrome, macos, open, osascript
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 ''
```### 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"', ))
```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