Skip to main content

shist

A small TUI for picking commands out of your shell history and copying them to the clipboard. Targets bash primarily; zsh is supported the same way.

How it works

  • In bash/zsh, after sourcing the shell integration (recommended): shist is a shell function that pipes your shell's own history builtin into the tool. That's the live, in-memory history of the current session, including anything you typed that hasn't been flushed to a history file yet.
  • Standalone (no shell integration, or in a shell without a history builtin): running shist directly reads a history file instead — --file PATH, or $HISTFILE, or ~/.bash_history / ~/.zsh_history depending on --shell/$SHELL. This can miss very recent commands the live shell hasn't written to disk yet.

Install

pip install shist

Then add the shell integration to your .bashrc and/or .zshrc:

eval "$(shist --print-shell-init)"

Open a new shell (or source your rc file) and run shist.

Using it

There are three panels; Tab cycles through them: search → history → selection → back to search. This keeps typing fully separate from the single-key list commands — c, d, -, [, ] are always literal query text while you're in the search panel, and only act as commands once you've tabbed into history or selection.

Search (active on start):

  • Type to filter (fuzzy substring match); Backspace edits it.
  • ↑/↓ (Ctrl+P/Ctrl+N) still browse the history list live; Shift+↑/Shift+↓ page through it.
  • Tab moves to the history panel.

History panel (browse & add):

  • ↑/↓ move the highlight, not wrapping past either end; Shift+↑/Shift+↓ move a page at a time.
  • c adds the highlighted command to the selection, at the end.
  • Tab moves to the selection panel.

Selection panel (the running list of what you've added, in order):

  • ↑/↓ move the highlight, not wrapping past either end; Shift+↑/Shift+↓ move a page at a time.
  • d or - removes the highlighted entry.
  • [ / ] move the highlighted entry earlier/later.
  • Tab moves back to search.

Any panel:

  • Enter confirms: copies the selection, newline-joined in order; with nothing added, copies just the highlighted history entry.
  • Esc / Ctrl+C cancels without copying anything.

Known limitations

  • A custom HISTTIMEFORMAT in bash gets treated as part of the command text when reading piped history output — not specially parsed out.
  • Plain POSIX sh/dash has no history builtin, so there's no live-history mode for it; only the standalone/file-fallback mode applies.

Metadata

Release files for shist 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shist 0.1.2
File Size Uploaded Provenance
shist-0.1.2.tar.gz 15.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shist 0.1.2
File Interpreter ABI Platform
shist-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.4 kB

Release files / shist-0.1.2.tar.gz

Download URL shist-0.1.2.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f6e5d94032de972feaee113e3f8597753974e44ae22b27c57944a0078c5d1b36
BLAKE2b-256 checksum
How to use checksums
e929fb9957fd9e1351716b123e279920d3b0b62a2bae371881ea17ffb37cadf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Release files / shist-0.1.2-py3-none-any.whl

Download URL shist-0.1.2-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec11f930dcb8a3a59a62cf8395b8c64f1ac0d4dc437a588fa0dc6312f05d7cc6
BLAKE2b-256 checksum
How to use checksums
df573365e182d54f4dd498452815951965ff4f71943e3ccf3c161528d7d8d161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

Security for shist 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for shist-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page