{"id":15654377,"url":"https://github.com/haya14busa/cachecmd","last_synced_at":"2025-04-30T22:50:24.847Z","repository":{"id":57577244,"uuid":"132017138","full_name":"haya14busa/cachecmd","owner":"haya14busa","description":"cache command!","archived":false,"fork":false,"pushed_at":"2022-05-11T09:34:47.000Z","size":26,"stargazers_count":27,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T20:42:55.249Z","etag":null,"topics":["cache","cli"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haya14busa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-03T15:45:55.000Z","updated_at":"2024-04-19T05:16:10.000Z","dependencies_parsed_at":"2022-09-11T22:50:50.604Z","dependency_job_id":null,"html_url":"https://github.com/haya14busa/cachecmd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haya14busa%2Fcachecmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haya14busa%2Fcachecmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haya14busa%2Fcachecmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haya14busa%2Fcachecmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haya14busa","download_url":"https://codeload.github.com/haya14busa/cachecmd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795387,"owners_count":21645019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cli"],"created_at":"2024-10-03T12:51:18.182Z","updated_at":"2025-04-30T22:50:24.828Z","avatar_url":"https://github.com/haya14busa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cachecmd\n\n[![Build Status](https://travis-ci.org/haya14busa/cachecmd.svg?branch=master)](https://travis-ci.org/haya14busa/cachecmd)\n[![codecov](https://codecov.io/gh/haya14busa/cachecmd/branch/master/graph/badge.svg)](https://codecov.io/gh/haya14busa/cachecmd)\n[![Go Report Card](https://goreportcard.com/badge/github.com/haya14busa/cachecmd)](https://goreportcard.com/report/github.com/haya14busa/cachecmd)\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\ncachecmd runs a given command and caches the result of the command.\nReturn cached result instead if cache found.\n\n## Installation\n\n```shell\ngo install github.com/haya14busa/cachecmd/cmd/cachecmd@latest\n```\n\n## Example\n\n```shell\n$ cachecmd -ttl=10s date +%S\n14 # First run\n$ sleep 5s\n$ cachecmd -ttl=10s date +%S\n14 # Read from cache\n$ sleep 5s\n$ cachecmd -ttl=10s date +%S\n24 # cache is expired. Run command again and update cache.\n\n# Force update: set -ttl=0\n$ cachecmd -ttl=0 date +%S\n\n# TTL is 10 min. Return cache result immediately from cache and update cache\n# in background for every run.\n$ cachecmd -ttl=10m -async sh -c 'date +%s; sleep 3s'\n\n# Cache result by current directory.\n$ cachecmd -ttl=10m -key=\"$(pwd)\" go list ./...\n# https://github.com/github/hub\n$ cachecmd -ttl=10m -key=\"$(pwd)\" -async hub issue\n```\n\n## :bird: Author\nhaya14busa (https://github.com/haya14busa)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaya14busa%2Fcachecmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaya14busa%2Fcachecmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaya14busa%2Fcachecmd/lists"}