Homebrew for code snippets. Run, search, and edit reusable code utilities from your terminal.
curl -fsSL https://tempercode.dev/install.sh | bashWorks on macOS, Linux, and WSL. No dependencies required.
Download the latest binary for your platform from Releases and add it to your PATH.
Execute JavaScript snippets directly in your terminal:
# Using named arguments
temper run title-case --str="hello world"
# Hello World
# Using stdin
echo "hello world" | temper run pascal-case
# HelloWorldChain snippets with Unix pipes:
echo "[3,1,4,1,5,9]" | temper run array-sort
# [1,1,3,4,5,9]temper search json
# Found 5 snippet(s):
#
# json-parse Parse JSON string to object
# json-stringify Convert object to JSON string
# ...temper listFilter by type:
temper list -t utility
temper list -t algorithmtemper info slugify
# SLUGIFY
# Convert a string to a URL-friendly slug
#
# PARAMETERS
# str (string, required) - The string to convert
#
# CODE
# str.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-")
#
# EXAMPLE OUTPUT
# hello-worldDownload a snippet and open it in your editor:
temper edit slugifyUses $EDITOR environment variable.
temper open slugifySnippets are cached locally for offline use.
# Refresh cache with latest snippets
temper cache refresh
# Clear all cached snippets
temper cache clear
# Show cache status
temper cache status| Command | Description |
|---|---|
run <slug> |
Execute a JavaScript snippet |
search <query> |
Search for snippets by name or description |
list |
List all available snippets |
info <slug> |
Show detailed snippet information |
edit <slug> |
Download and open in $EDITOR |
open <slug> |
Open snippet in browser |
cache refresh |
Update local snippet cache |
cache clear |
Clear cached snippets |
cache status |
Show cache statistics |
Environment variables:
| Variable | Description | Default |
|---|---|---|
TEMPER_API_URL |
API base URL | https://tempercode.dev |
TEMPER_CACHE_DIR |
Cache directory | ~/.temper/cache |
EDITOR |
Editor for edit command |
vim |
Requires Bun.
# Install dependencies
bun install
# Run in development
bun run dev --help
# Build single binary
bun run build
# Build for all platforms
bun run build:allMIT