Skip to main content

Quick Look Zsh - Cache command outputs for instant retrieval

Project description

qlookz (quick look zsh)

Quick command output retrieval.

I wanted a tool to remember slow command outputs, and retrieve them without running everything again. This also persists across shells.

Pretty good for kubernetes outputs.

Installation

pip install qlookz

Quick Start

Cache a command's output

Prefix any command with qq to run it and cache the output:

qq curl https://api.example.com/data
qq ls -la /some/directory
qq kubectl get pods -A

Retrieve cached output

Use ql with the same command to instantly retrieve the cached output:

ql curl https://api.example.com/data
ql ls -la /some/directory
ql kubectl get pods -A

The cached output will be displayed with a header showing when it was cached and how long the original command took.

Commands

Command Description
qq <command> Run command and cache its output
ql <command> Retrieve cached output for the command
qlookz list List all cached commands
qlookz clear Clear all cached commands
qlookz delete <command> Delete a specific cache entry
qlookz prune <age> Remove entries older than age (e.g., 1h, 7d, 30m)
qlookz version Show version
qlookz help Show help

Examples

# Cache a slow API response
qq curl -s https://api.github.com/repos/python/cpython/commits

# Later, in any terminal, retrieve it instantly
ql curl -s https://api.github.com/repos/python/cpython/commits

# List what's cached
qlookz list

# Clean up old entries
qlookz prune 7d

# Clear everything
qlookz clear

How It Works

  • Command outputs are stored in ~/.qlookz/cache/
  • Each command is hashed to create a unique cache key
  • Both stdout and stderr are captured and cached
  • Exit codes are preserved when retrieving from cache
  • Cache files are plain JSON for easy inspection

Cache Location

By default, cache files are stored in:

~/.qlookz/cache/

Each cached command is stored as a JSON file containing:

  • The original command
  • stdout and stderr output
  • Exit code
  • Timestamp
  • Duration

Development

# Clone the repository
git clone https://github.com/qlookz/qlookz.git
cd qlookz

# Install in development mode
pip install -e .

# Run tests
python -m pytest

License

MIT License - see LICENSE for details.

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

qlookz-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qlookz-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file qlookz-0.1.0.tar.gz.

File metadata

  • Download URL: qlookz-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qlookz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e0eadb7f353c27beae56e871b5f602575f75bbe4fdacefdbb56a866b74132b79
MD5 c5d07f43a37c86a5e6da808d5a2d6106
BLAKE2b-256 1f8be18e91eb31ab86f9c7a14bdf9b75e39365537d120baf39d637f0de3a1332

See more details on using hashes here.

Provenance

The following attestation bundles were made for qlookz-0.1.0.tar.gz:

Publisher: publish.yml on tanmaysachan/qlookz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qlookz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qlookz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qlookz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2bb243117fca2e95ad42683eca0e603fcf8628a25daa4e4c07d877af6492ba9
MD5 13bf0fd49ff156e04cf75e80881e54fd
BLAKE2b-256 f11b0b64b934e478faeb83461c50f3d7a1f3f4b4fafd4c2aa1719ab01da357f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for qlookz-0.1.0-py3-none-any.whl:

Publisher: publish.yml on tanmaysachan/qlookz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page