docs/tutorials/save-the-last-command-you-typed
Beginner3 min

Save the last command you typed

recall save --last pulls the last line from shell history.

What this does

Recall reads the last line in your shell history (not every keystroke of the day). It skips the recall save line itself, then saves that command to your vault. Nothing is executed.

01Run a command as usual

docker compose up -d --build# …it works. You want this next week.

02Save it with --last

recall save --last -n start-stack -t docker From zsh history: docker compose up -d --build✔ Saved as "start-stack"

Short form: recall save -L. Same --name / --tags as a normal local save. --group is Pro/cloud (ignored for Free local save).

03Where it works

✓ macOS / Linux — zsh or bash

✓ Windows — PowerShell, Git Bash, or WSL

✗ Windows cmd.exe — not supported. Use PowerShell, or paste: recall save "your command"

Same session tips

Recall reads history on disk. zsh and PowerShell usually write as you go. Bash sometimes waits until the shell exits — flush first:

bash
history -a && recall save --last

Only the last history line is considered — Recall does not sit in the background watching your shell. For older lines, use recall import history or your shell's own history. More: command reference.

// what's next
→ Save, run, and import from history→ Save a command by typing it out