Cacher
A command-line tool for caching command outputs to save time when running repetitive commands.
Features
- Cache command outputs in memory and on disk
- Retrieve cached results instead of re-running commands
- Set time-to-live (TTL) for cached entries
- Force execution to bypass cache
- List all cached commands
- Clear specific or all cached entries
- Get hash ID for any command
Installation
# Clone the repository
# Build the project
# Optional: Install the binary
Usage
Run a command with caching
# Basic usage
# With TTL (time-to-live) in seconds
# Force execution (ignore cache)
List cached commands
Clear cache
# Clear all cache
# Clear specific command
Get hash ID for a command
How it works
Cacher uses SHA-256 hashing to generate unique identifiers for each command. When you run a command through Cacher, it:
- Checks if the command is already cached in memory
- If not found in memory, checks if it's cached on disk
- If not found or if cache is expired (based on TTL), executes the command
- Stores the result in both memory and disk cache
The cache is stored in your system's cache directory:
- macOS:
~/Library/Caches/cacher/ - Linux:
~/.cache/cacher/ - Windows:
C:\Users\{username}\AppData\Local\cacher\
Development
Running tests
Building documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.