fclicache - File-based Simple CLI Cache

Overview

Unit Test and Lint Status Docs.rs Crates.io

fclicache - File-based Simple CLI Cache

fclicache is a command-line utility that caches the output of resource-intensive commands, enabling faster retrieval of results when the same commands are executed repeatedly within a specified Time-to-Live (TTL) period. This tool is designed to enhance efficiency and save time, particularly in development environments where certain commands are run frequently.

Features

  • Efficient Caching: Saves the output of CLI commands, avoiding repeated execution of time-consuming operations.
  • Time-to-Live (TTL): Customizable cache duration to ensure the freshness of the cached data.
  • Simple Usage: Easy to integrate into existing workflows with minimal configuration.

Installation

Before installing fclicache, ensure you have Rust and Cargo installed on your system. If not, follow the installation guide here: https://www.rust-lang.org/tools/install.

To install fclicache, run the following command:

cargo install fclicache

Usage

To cache the output of a command using fclicache, wrap the desired command as follows:

fclicache --ttl [SECONDS] '[COMMAND]'

The tool caches the output of [COMMAND] for the duration specified by [SECONDS].

Example

# First execution: the 'sleep 10 && date' command will take approximately 10 seconds.
$ fclicache --ttl 3600 'sleep 10 && date'
Sat Feb 10 19:07:49 JST 2024

# Second execution: results are instantly retrieved from cache, showing the same output as the first execution.
$ fclicache --ttl 3600 'sleep 10 && date'
Sat Feb 10 19:07:49 JST 2024

Note

fclicache utilizes a simple file-based caching mechanism. This means that your command's output is written to a file. Therefore, it is advised not to use this tool for commands that produce sensitive or secure output.

Contributing

We are very open to any contributions! Your input is invaluable to us, and we strive to make incorporating your suggestions and improvements as seamless as possible.

  • Open to All: Whether it's feature suggestions, bug reports, or code improvements, every contribution is welcome.
  • Ongoing Maintenance: Even if this repository might appear inactive or outdated at times, rest assured that we actively review and accept pull requests.

Show Your Support

If you find fclicache useful, consider giving it a star on GitHub! Your support motivates us to continuously improve and maintain the project.

Star fclicache on GitHub

You might also like...
Simple CLI to (add, delete, update, create) i18n translation file 🔤 🦀
Simple CLI to (add, delete, update, create) i18n translation file 🔤 🦀

, Inrs Simple CLI to (add, delete, update, create) i18n translation file Copyright (C) 2020-2022 TheAwiteb https://github.com/TheAwiteb/inrs This pr

A simple CLI tool for converting CSV file content to JSON.

fast-csv-to-json A simple CLI tool for converting CSV file content to JSON. 我花了一個小時搓出來,接著優化了兩天的快速 CSV 轉 JSON CLI 小工具 Installation Install Rust with ru

A simple (but really fast!) CLI tool to convert an epub into a text file.

epub_to_txt A simple (but really fast!) CLI tool written in Rust to convert an epub into a text file (in Markdown format). Usage epub_to_txt filename.

A simple CLI tool to create python project file structure, written in Rust
A simple CLI tool to create python project file structure, written in Rust

Ezpie Create python projects blazingly fast What Ezpie can do? It can create a python project directory What kind of directory can Ezpie create? For c

Single File Assets is a file storage format for images

SFA (Rust) Single File Assets is a file storage format for images. The packed images are not guaranteed to be of same format because the format while

A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

A tool for determining file types, an alternative to file

file-rs a tool for determining file types, an alternative to file whats done determining file extension determining file type determining file's mime

SAORI for UKAGAKA. Convert a image file to resized png file.

Resized Png GitHub repository これは何? デスクトップマスコット、「伺か」で使用できるSAORIの一種です。 機能としては、指定した画像ファイルを拡大または縮小し、pngとして出力します。 「伺か」「SAORI」等の用語については詳しく説明いたしませんのでご了承下さい。

My own image file format created for fun! Install the "hif_opener.exe" to open hif files. clone the repo and compile to make your own hif file

Why am i creating this? I wanted to create my own image format since I was 12 years old using Windows 7, tryna modify GTA San Andreas. That day, when

Comments
  • feat: Implement `--clean` flag for forced cache clearing

    feat: Implement `--clean` flag for forced cache clearing

    Introduce the --clean flag, enabling users to explicitly command the program to purge the existing cache.

    This enhancement ensures more control over cache management, facilitating immediate cache clearance without disrupting the workflow.

    opened by Miyoshi-Ryota 1
  • feat: Implement `--clean` flag for forced cache clearing

    feat: Implement `--clean` flag for forced cache clearing

    Introduce the --clean flag, enabling users to explicitly command the program to purge the existing cache.

    This enhancement ensures more control over cache management, facilitating immediate cache clearance without disrupting the workflow.

    opened by Miyoshi-Ryota 0
  • fix: Ensure command results are re-cached post-expiration

    fix: Ensure command results are re-cached post-expiration

    Previously, once the cache expired, command results weren't re-cached, leading to repeated command executions on every request.

    This fix ensures results are properly cached again after the initial cache expiration.

    opened by Miyoshi-Ryota 0
Releases(v1.0.2)
  • v1.0.2(Feb 19, 2024)

    Including the following changes:

    • fix: Ensure command results are re-cached post-expiration #1
    • feat: Implement --clean flag for forced cache clearing #4

    Full Changelog: https://github.com/Miyoshi-Ryota/fclicache/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
Owner
mr-csce
Network engineer.
mr-csce
Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

Harikesh Ranjan Sinha 5 May 2, 2024
A Rust based simple cli to delete all files included in `.gitignore` file from your repo

clean-local A simple CLI to remove all the files and folders included in the .gitignore file. Written in RUST Supports glob and wildcard paths in .git

Vilva Athiban P B 5 Jul 8, 2023
FileSorterX is an automatic file sorting application that sorts your files into folders based on their file extension

FileSorterX is an automatic file sorting application that sorts your files into folders based on their file extension. With FileSorterX, you can easily keep your files organized and find what you need quickly.

Xanthus 22 Apr 4, 2023
A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.)

FS Dir Cache A CLI tool for CIs and build scripts, making file system based caching easy and correct (locking, eviction, etc.) When working on build s

Dawid Ciężarkiewicz 5 Aug 29, 2023
Find and clean heavy build or cache directories.

ProjClean Find and clean heavy build or cache directories. ProjClean finds directories such as node_modules(node), target(rust), build(java) and their

null 42 Sep 25, 2022
Download pdbs from symbol servers and cache locally, parse symbol paths from env vars

symsrv This crate lets you download and cache pdb files from symbol servers, according to the rules from the _NT_SYMBOL_PATH environment variable. It

Markus Stange 6 Sep 15, 2022
Run if inputs have changed, otherwise use cache

Boost Why Boost? Our planet is burning, and everywhere I look I see CI pipelines repeating work that has already been done. Tools such as TurboRepo, N

Stuart Harris 6 Jul 28, 2022
Fast turbo remote cache server written in Rust

Fast turbo remote cache server written in Rust. if you are using turbo and you want to have a self hosted remote cache server this is for you.

Salama Ashoush 10 May 24, 2023
An expressive Rust library for interacting with a cache.

Amnesia An expressive Rust library for interacting with a Cache. Features Driver-Based Architecture: Easily switch between different caching strategie

Miguel Piedrafita 25 Dec 28, 2023
dlfile is a very simple, straightforward CLI to download a file

dlfile dlfile is a very simple, straightforward CLI to download a file, except it... Only downloads over HTTPS Requires TLS 1.2 or higher Executes in

Colin 3 Oct 21, 2022