https://github.com/dhth/tash
s[tash] content that you can access later
https://github.com/dhth/tash
Last synced: 4 months ago
JSON representation
s[tash] content that you can access later
- Host: GitHub
- URL: https://github.com/dhth/tash
- Owner: dhth
- License: mit
- Created: 2025-02-07T15:24:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-01T23:39:44.000Z (4 months ago)
- Last Synced: 2026-03-02T01:57:00.473Z (4 months ago)
- Language: Rust
- Homepage: https://tools.dhruvs.space/tash
- Size: 135 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
tash
`s[tash]` content that you can access later.
🤔 Motivation
---
Every now and then, I find myself accessing some piece of string content (a
`curl` request, a shell command, or literally anything else) several times over
a period of time. While modern clipboard managers help in recalling previously
copied data, they require some searching. I needed a command line tool that
would make saving and querying string content quick and easy. So, I wrote
`tash`.
💾 Installation
---
**homebrew**:
```sh
brew install dhth/tap/tash
```
**cargo**:
```sh
cargo install tash
```
Or get the binaries directly from a Github [release][1]. Read more about
verifying the authenticity of released artifacts
[here](#-verifying-release-artifacts).
⚡️ Usage
---
### Help
```text
Usage: tash
Commands:
delete Delete one or more content items
empty Empty entire stash
ls List stashed content keys
get Get content from stash
push Stash content
help Print this message or the help of the given subcommand(s)
```
### Basic Usage
```bash
# push content to tash from stdin
echo -n "some content" | tash push key
cat << EOF | tash push key
Multi line
content goes
here.
EOF
# push content to tash from a file
tash push key -f path/to/file.txt
# push content from a flag
tash push key -d "content goes here"
# push content while preventing overwrites
tash push key -d "content goes here" -p
# push content to tash from system clipboard
tash push key -c
# get content from tash
tash get key
# get content from tash and copy to system clipboard
tash get key -c
# get content from tash and only copy to system clipboard
tash get key -c --no-output
# get content from tash and remove it from its store
tash get key --pop
# list content saved to tash
tash ls
# delete content items
tash delete key1 key2 key3
# empty tash's store
tash empty
```
### Fetch content using fzf
The process of fetching content can be made easier by making use of a fuzzy
finder like [fzf](https://github.com/junegunn/fzf).
```bash
#!/usr/bin/env bash
selected_key=$(
tash ls |
fzf \
--reverse \
--preview 'tash get {}' \
--preview-window=right:70% \
--preview-border=vertical \
--border=none
)
if [ -z "$selected_key" ]; then
exit 0
fi
tash get "${selected_key}" -nc
```
### Delete multiple entries using fzf
Same for deletion for content.
```bash
#!/usr/bin/env bash
selected_keys=$(
tash ls |
fzf \
--multi \
--reverse \
--preview 'tash get {}' \
--preview-window=right:70% \
--preview-border=vertical \
--border=none |
xargs
)
if [ -z "$selected_keys" ]; then
exit 0
fi
tash delete ${selected_keys}
```
🔐 Verifying release artifacts
---
In case you get the `tash` binary directly from a [release][1], you may want
to verify its authenticity. Checksums are applied to all released artifacts, and
the resulting checksum file is attested using [Github Attestations][2].
Steps to verify (replace `A.B.C` in the commands below with the version you
want):
1. Download the sha256 checksum file for your platform from the release:
```shell
curl -sSLO https://github.com/dhth/tash/releases/download/vA.B.C/tash-x86_64-unknown-linux-gnu.tar.xz.sha256
```
2. Verify the integrity of the checksum file using [gh][3].
```shell
gh attestation verify tash-x86_64-unknown-linux-gnu.tar.xz.sha256 --repo dhth/tash
```
3. Download the compressed archive you want, and validate its checksum:
```shell
curl -sSLO https://github.com/dhth/tash/releases/download/vA.B.C/tash-x86_64-unknown-linux-gnu.tar.xz
sha256sum --ignore-missing -c tash-x86_64-unknown-linux-gnu.tar.xz.sha256
```
3. If checksum validation goes through, uncompress the archive:
```shell
tar -xzf tash-x86_64-unknown-linux-gnu.tar.xz
cd tash-x86_64-unknown-linux-gnu
./tash -h
# profit!
```
[1]: https://github.com/dhth/tash/releases
[2]: https://github.blog/news-insights/product-news/introducing-artifact-attestations-now-in-public-beta/
[3]: https://github.com/cli/cli