docs/tutorials/templates-with-variables
Intermediate10 minFree (local) · Pro (sync)

Templates with variables

One command shape, different arguments. Free stores templates locally; Pro syncs to the cloud.

Free vs Pro

Free: create and edit templates in the VS Code extension or edit ~/.recall/templates.json. Soft cap ~50. CLI recall template … still requires login. Pro syncs templates with the cloud.

The problem

You probably have commands like these that you run constantly with different values:

kubectl logs my-app-7d9f8c -n production --tail 100kubectl logs auth-service-abc -n staging --tail 50kubectl logs frontend-xyz -n production --tail 200

Same command, different values every time. Templates solve this with {placeholders}.

01Free: save a template in VS Code

In VS Code open recall → Templates → create. Name it kube-logs and use a pattern like:

kubectl logs {pod} -n {namespace} --tail {lines}

Stored in ~/.recall/templates.json. No account needed.

Example shapes

docker-run
docker run -it --rm -v $(pwd):/app {image} bash
vars: image
pg-dump
pg_dump -U {user} -h {host} {database} > {output}.sql
vars: user, host, database, output
ssh-tunnel
ssh -L {local_port}:localhost:{remote_port} {user}@{host}
vars: local_port, remote_port, user, host
aws-s3-sync
aws s3 sync {local_dir} s3://{bucket}/{prefix} --delete
vars: local_dir, bucket, prefix

02Pro: CLI templates (login required)

After login on Pro/Team, save and run templates from the terminal:

recall template save kube-logs "kubectl logs {pod} -n {namespace} --tail {lines}"✔ Template "kube-logs" savedrecall template run kube-logs? pod: my-app-7d9f8c? namespace: production? lines: 100 Rendered: kubectl logs my-app-7d9f8c -n production --tail 100recall template run kube-logs --dry-runrecall sync
// what's next
→ Share templates with your team using org vaults→ Import commands from your existing dotfiles