Crates.io | kadabra |
lib.rs | kadabra |
version | 0.1.0 |
source | src |
created_at | 2021-01-04 19:52:11.749768 |
updated_at | 2021-01-04 19:52:11.749768 |
description | Easily share data between different terminal windows |
homepage | https://github.com/denisidoro/abra |
repository | https://github.com/denisidoro/abra |
max_upload_size | |
id | 331782 |
size | 48,419 |
A tool that makes data sharing between terminal windows easy.
abra can be used for displaying info about the current working directory, for splitting stdout and stderr and much more.
The recommended way to install abra is by running:
brew install denisidoro/tools/abra
You can also run:
cargo install abra-cli
If these package managers aren't available, you can download a pre-compiled binary here and extract it to your $PATH
.
Some abra calls are quite verbose, so the use of aliases is recommended.
Since this is a very common use case, abra provides a hook for you.
If you call the following...
eval "$(abra hook bash)" # If you use bash, add this to ~/.bashrc
eval "$(abra hook zsh)" # If you use zsh, add this to ~/.zshrc
Then you can open a new terminal window and call abra rx --channel pwd --cmd 'ls {}'
.
Whenever you cd
into a directory, the sidebar will reflect the changes.
Let's say that you want to run some tests but errors should appear in a different window.
You can use anonymous pipes with abra for that purpose:
The commands are:
abra rx --channel test_out # window 1
abra rx --channel test_err # window 2
cargo test > >(abra tx --channel test_out) 2> >(abra tx --channel test_err) # window 3
Let's say you want to see the contents of a file in a window but show only the lines that contain "foo" in another window:
abra rx --channel filter --cmd 'echo "{}" | grep foo' # window 1
cat myfile.txt |& tee >(abra tx --channel filter) # window 2
Some CLIs will detect that they are being piped and will hide color information by default.
To circumvent this, each CLI may offer different paramenters: --color=always
and export COLORTERM=truecolor
are some examples.
In some cases, you need to trick an application into thinking its stdout is a terminal, not a pipe. For these cases you can call abra faketty --cmd '<your command>'
.
In theory, you could run the following to achieve similar results:
mkfifo tmp
tail -f tmp
echo foo > tmp # in another window
That said:
echo foo > tmp
is blocking in case tmp
isn't open for reading
abra tx
will terminate immediately if there's no abra rx
processabra rx
windows reacting to the same abra tx
call