Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otiai10/tie
Mix multiple commands stream, keep all foreground and kill all in one Ctrl+C
https://github.com/otiai10/tie
ctrl-c kill multiple-processes sigint stderr stdout
Last synced: 2 months ago
JSON representation
Mix multiple commands stream, keep all foreground and kill all in one Ctrl+C
- Host: GitHub
- URL: https://github.com/otiai10/tie
- Owner: otiai10
- License: mit
- Created: 2017-07-31T08:02:38.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-10-10T07:41:58.000Z (3 months ago)
- Last Synced: 2024-10-16T13:02:11.203Z (3 months ago)
- Topics: ctrl-c, kill, multiple-processes, sigint, stderr, stdout
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tie
[![Go](https://github.com/otiai10/tie/actions/workflows/go.yml/badge.svg)](https://github.com/otiai10/tie/actions/workflows/go.yml)
[![codecov](https://codecov.io/gh/otiai10/tie/branch/master/graph/badge.svg)](https://codecov.io/gh/otiai10/tie)
[![Go Report Card](https://goreportcard.com/badge/github.com/otiai10/tie)](https://goreportcard.com/report/github.com/otiai10/tie)The opposite of `tee`, merges multiple command io stream and controls like 1 command.
```
-> command 1 stream ─┐
-> command 2 stream ─┤
└─ stdout/stderr/SIGINT to kill both
```# install
```sh
% go get -u github.com/otiai10/tie
# then just hit `tie`
```# why?
When you need to start 2 file watchers, and kill them at the same time, like this
```sh
% nohup rails server &
% nohup npm start-webpack &
# then
% pkill rails
% pkill start-webpack
# <- annoying :(
```# usage
```sh
% tie
> rails server # return key
> npm start-webpack # return key
> # return key again[0] ... # Rails log here
[1] ... # npm log here# To kill both, just Ctrl+C once!
```# examples
by interactive mode
![i](https://user-images.githubusercontent.com/931554/28806719-843a9ffe-76ac-11e7-80c0-13b378ecf7c4.png)
by one-line mode
![o](https://user-images.githubusercontent.com/931554/28806757-aef046c2-76ac-11e7-8d47-be1f2b299fbb.png)
in both ways, you can kill all the commands by just 1 Ctrl+C