Kasoku (加速, "acceleration" in Japanese) is a fast, consistent command execution tool with intelligent caching. It makes rebuilding, retesting, and rerunning commands instant by caching outputs and detecting changes in inputs.
- Pattern-based Command Caching: Define patterns to automatically cache any matching commands
- Smart Change Detection: Only re-executes when inputs actually change
- Local & Remote Caching: Cache locally for speed, remotely for teams
- Shell Integration: Transparent command interception via shell hooks
- Multi-backend Support: S3, GCS, Azure, custom Kasoku server, or filesystem
- Analytics: Track cache hits, time saved, and performance metrics
- Team Collaboration: Share cache across teams with self-hosted or cloud server
- FIFO Eviction: Predictable cache eviction strategy for remote caching
Homebrew (Recommended):
# Tap the Bushido Collective repository
brew tap thebushidocollective/kasoku
# Install Kasoku
brew install kasoku
# Or in one command:
brew install thebushidocollective/kasoku/kasokuInstall Script:
curl -fsSL https://kasoku.dev/install.sh | shGo Install:
go install github.com/thebushidocollective/kasoku/cmd/kasoku@latestFrom Source:
git clone https://github.com/thebushidocollective/kasoku
cd kasoku
make build
sudo mv kasoku /usr/local/bin/See INSTALL.md for more options.
- Initialize a project:
kasoku initThis creates a kasoku.yaml configuration file.
- Configure commands to cache:
version: "1"
commands:
go:
patterns:
- "go build*"
- "go test*"
working_dir: "."
inputs:
files:
- "go.mod"
- "go.sum"
globs:
- "**/*.go"
outputs:
- path: "."
optional: true
cache:
local:
enabled: true
path: "~/.kasoku/cache"
max_size: "10GB"- Run commands:
kasoku exec go build -o myapp
kasoku exec go test ./...Or use shell integration for transparent caching:
# Add to ~/.bashrc or ~/.zshrc
eval "$(kasoku shell bash)"
# Now these are automatically cached:
go build -o myapp
go test ./...
npm run buildKasoku consists of three main components:
The command-line tool that intercepts and caches commands.
Key features:
- Pattern matching for automatic command detection
- Local LRU cache with size limits
- Remote cache integration
- Analytics tracking
- Shell hook generation
Location: cmd/kasoku/
The cache server for remote caching and team collaboration.
Key features:
- RESTful API for cache operations
- User authentication (JWT + API tokens)
- Multi-user and team support
- FIFO eviction with storage quotas
- Analytics collection
- Multiple storage backends (local, S3, GCS)
Location: server/
See server/README.md for deployment guide
Pluggable storage backends for remote caching:
- Custom Kasoku Server: Full-featured with auth, analytics, quotas
- S3: AWS S3 or S3-compatible storage
- GCS: Google Cloud Storage
- Azure: Azure Blob Storage
- Filesystem: Local or network filesystem
- Login:
kasoku login https://kasoku.dev- Enable remote cache in
kasoku.yaml:
cache:
remote:
enabled: true
url: https://kasoku.dev- Run commands - they'll automatically sync to remote cache!
- Deploy server:
cd server
docker-compose up -d- Create account:
curl -X POST http://localhost:8080/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "Your Name", "password": "secure-password"}'- Login from CLI:
kasoku login http://localhost:8080- Configure remote cache in
kasoku.yaml:
cache:
remote:
enabled: true
type: "custom"
url: "http://localhost:8080"See server/README.md for detailed deployment instructions.
Patterns determine which commands to cache:
commands:
go:
patterns:
- "go build*" # Matches "go build", "go build -o app", etc.
- "go test*" # Matches "go test ./...", etc.
make:
patterns: [] # Empty array = cache ALL make commandsThe full command (including all arguments) is hashed, so go build -o app1 and go build -o app2 have separate cache entries.
Define what should trigger cache invalidation:
inputs:
files:
- "package.json"
- "Makefile"
globs:
- "src/**/*.ts"
- "**/*.go"
environment:
- "NODE_ENV"
- "GOOS"
- "GOARCH"Define what should be cached:
outputs:
- path: "dist"
optional: false
- path: "node_modules"
optional: true # Don't fail if it doesn't existcache:
local:
enabled: true
path: "~/.kasoku/cache"
max_size: "10GB" # LRU eviction when exceededcache:
remote:
enabled: true
type: "custom"
url: "https://kasoku.dev"
token: "your-api-token" # Optional, uses ~/.kasoku/credentials.json if logged incache:
remote:
enabled: true
type: "s3"
s3_bucket: "my-cache-bucket"
s3_region: "us-east-1"kasoku exec <command>- Execute a command with cachingkasoku run <name>- Run a named command from configkasoku hash <command>- Show hash details for a command
kasoku cache list- List cached entrieskasoku cache clear- Clear local cache
kasoku login [url]- Login to a Kasoku serverkasoku logout- Logoutkasoku whoami- Show current login statuskasoku token create <name>- Create API token for CI/CD
kasoku stats- Show cache statistics and time saved
kasoku init- Create kasoku.yaml templatekasoku shell <bash|zsh|fish>- Generate shell integration
Kasoku can transparently intercept commands via shell hooks:
# Bash/Zsh
eval "$(kasoku shell bash)"
# Fish
kasoku shell fish | sourceThis automatically searches for kasoku.yaml in current or parent directories. If found, matching commands are cached. If not found, commands execute normally.
Speed up repeated build/test cycles:
# First run: ~30s
go build -o myapp
# Subsequent runs with no changes: instant!
go build -o myappShare cache across CI runs:
# GitHub Actions example
- name: Login to Kasoku
run: kasoku login ${{ secrets.KASOKU_URL }}
env:
KASOKU_TOKEN: ${{ secrets.KASOKU_TOKEN }}
- name: Build
run: kasoku exec go build -o myappShare cache across team members:
- Deploy self-hosted kasoku-server
- Team members login once
- Everyone benefits from shared cache
- Local caching only
- No signup required
- Unlimited storage (limited by disk)
- 2GB remote cache
- FIFO eviction
- CI/CD integration
- Analytics dashboard
- Single user
- 50GB+ storage
- Multiple users
- Shared team cache
- Priority support
- Same features as cloud (minus billing)
- Deploy on your infrastructure
- See server/README.md
kasoku/
├── cmd/
│ └── kasoku/ # CLI application
├── internal/
│ ├── analytics/ # Analytics tracking
│ ├── cache/
│ │ ├── local/ # Local cache with LRU eviction
│ │ └── remote/ # Remote cache implementations
│ ├── client/ # Kasoku server API client
│ ├── config/ # Configuration parsing
│ ├── credentials/ # Auth credentials management
│ ├── executor/ # Command execution engine
│ ├── hash/ # Input hashing
│ └── storage/ # Storage backends (S3, GCS, Azure, custom)
└── server/
├── cmd/
│ └── kasoku-server/ # Server application
├── internal/
│ ├── api/ # REST API handlers
│ ├── auth/ # Authentication (JWT, API tokens)
│ ├── cache/ # Cache service with FIFO eviction
│ ├── db/ # Database operations (GORM)
│ ├── models/ # Data models
│ └── storage/ # Artifact storage (local, S3)
├── Dockerfile
├── docker-compose.yml
└── README.md
# Build CLI
go build -o kasoku ./cmd/kasoku
# Build server
cd server
go build -o kasoku-server ./cmd/kasoku-servergo test ./...Contributions welcome! See CONTRIBUTING.md for guidelines.
Elastic License v2 - see LICENSE file for details.
Kasoku is source-available software that allows:
- ✅ Self-hosting for personal or commercial use
- ✅ Modification and redistribution
- ✅ Use in production environments
- ❌ Offering Kasoku as a competing hosted service
The license protects our SaaS business while enabling you to run Kasoku anywhere you choose.
Kasoku © The Bushido Collective
Inspired by build caching tools like Bazel, Buck, and Turborepo, but designed to work with any command-line tool without requiring build system changes.