Preview and confirm scripts before executing them.
Project description
hold-your-shell
hold-your-shell is a command line program (TUI) that previews shell
scripts (or any shebang script) in a pager, and asks the user to
confirm execution.
This single file program is written for Python 3.x and only uses the stdlib.
Install
Pip install:
pip install hold-your-shell
Manual install:
HY_BIN=~/.local/bin/hold-your-shell
mkdir -p $(dirname ${HY_BIN})
wget -O ${HY_BIN} https://raw.githubusercontent.com/EnigmaCurry/hold-your-shell/refs/heads/master/hold_your_shell/hold_your_shell.py
chmod +x ${HY_BIN}
Usage
- Pipe any script to the stdin of
hold-your-shell. - The script will be previewed on the first tab shown:
Script Preview. - Press TAB to cycle through the other tabs, including
Env Vars. - Use the up, down, PgUp, PgDown,
j, orkkeys to scroll the text. - Use the left, right,
h, orlkeys to select the action and pressEnterto confirm.- Choose
Yesto run the script. - Choose
Noto cancel and quit (default). - Choose
Editto open the script in your preferred$EDITOR, allowing you to customize it before running it.
- Choose
Examples
Read from stdin
echo "whoami" | hold-your-shell
echo -e '#!/bin/python\nprint("Hello from Python!")' | hold-your-shell
cat <<'EOF' | hold-your-shell
echo "What is your name?"
read NAME
echo "Hello $NAME"
EOF
curl https://get.docker.com/ | hold-your-shell
Read from file
cat <<EOF > test.txt
#!/bin/env python
print("Hello from Python!")
EOF
hold-your-shell --consume test.txt
--consume will delete the input file immediately after it reads
it.
Linger
echo whoami | hold-your-shell --linger
--linger will have the program remain running after completion of
the script until a key is pressed.
Development
See DEVELOPMENT.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hold_your_shell-0.1.6.tar.gz.
File metadata
- Download URL: hold_your_shell-0.1.6.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d9efe1a28d48af27aaa9d65e21c76ac7fcbef79136bd9d72c22d6257c661d46
|
|
| MD5 |
2103aa83e5c6a595b3f71ea57c690e0f
|
|
| BLAKE2b-256 |
e538da0679daa55db849deeb641bcb28bfd59f680b5645705a36757cd1c62166
|
Provenance
The following attestation bundles were made for hold_your_shell-0.1.6.tar.gz:
Publisher:
publish.yml on EnigmaCurry/hold-your-shell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hold_your_shell-0.1.6.tar.gz -
Subject digest:
2d9efe1a28d48af27aaa9d65e21c76ac7fcbef79136bd9d72c22d6257c661d46 - Sigstore transparency entry: 221545684
- Sigstore integration time:
-
Permalink:
EnigmaCurry/hold-your-shell@38262658b8e37f231374018e6d8dc32a695621a9 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/EnigmaCurry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38262658b8e37f231374018e6d8dc32a695621a9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hold_your_shell-0.1.6-py3-none-any.whl.
File metadata
- Download URL: hold_your_shell-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
353c412bbfd893bac21f6323b5f5b227a2b823788c84b93f27fb6d45a7664cc1
|
|
| MD5 |
9e01b5103a86be938ce31c95e32f4a2d
|
|
| BLAKE2b-256 |
7471966ad115970577b140bfc6b167d832dcea6a6474206f1c57e481df2a66b5
|
Provenance
The following attestation bundles were made for hold_your_shell-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on EnigmaCurry/hold-your-shell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hold_your_shell-0.1.6-py3-none-any.whl -
Subject digest:
353c412bbfd893bac21f6323b5f5b227a2b823788c84b93f27fb6d45a7664cc1 - Sigstore transparency entry: 221545686
- Sigstore integration time:
-
Permalink:
EnigmaCurry/hold-your-shell@38262658b8e37f231374018e6d8dc32a695621a9 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/EnigmaCurry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@38262658b8e37f231374018e6d8dc32a695621a9 -
Trigger Event:
push
-
Statement type: