Command Harvester

Stop re-typing the same terminal commands. Command Harvester notices the commands you run again and again, and turns them into one-click tasks, npm scripts or status bar buttons.

Why
Every project has a handful of commands you type all day: starting containers, reseeding a database, running one test file, deploying to staging. You dig them out of shell history, mistype a flag, and your teammates never even learn they exist.
Command Harvester watches the integrated terminal quietly. Once a command has worked three times, it asks once whether you want to keep it, and saves it where you choose:
| Save as |
Where it lives |
Best for |
| VS Code task |
.vscode/tasks.json |
Commands the whole team needs. Commit the file and everyone gets them. |
| npm script |
package.json |
Commands that belong next to the project's other scripts |
| Status bar button |
Your workspace only |
Personal shortcuts you click all day |
Features
- Zero setup. Install it and keep working. It learns from the commands you actually run, not from a config file you have to write.
- Spots the part that changes. Run
git checkout -b feature/cart, then feature/login, then feature/search, and you're offered one command, git checkout -b ‹value›, that asks for the value and remembers the last one you used.
- Polite, not pushy. One suggestion per command. “Not Now” waits a few more runs before asking again; “Never” means never. Trivial commands like
cd, ls and git status are ignored, and so is anything already in your tasks.json or package.json.
- Only what worked. Failed runs don't count, so typos and broken commands never get suggested.
- Secrets stay out. Commands that look like they contain credentials (
--token=…, API_KEY=…, Bearer …, https://user:pass@…, known key formats, long random strings) are never recorded, so they can't end up in a file you commit.
- Gentle with your files. Comments, indentation and line endings in
tasks.json and package.json are kept exactly as they were. A file with a syntax error is left alone.
Quick start
- Install Command Harvester.
- Work in the integrated terminal (Ctrl+`) as usual.
- When the suggestion appears, choose Save…, pick where the command should go, and give it a name.
Don't want to wait? Open the Command Palette and run Command Harvester: Show Frequent Commands to save any command you've already run.
Commands
| Command |
What it does |
| Command Harvester: Show Frequent Commands |
Pick any recorded command and save it right away |
| Command Harvester: Remove Status Bar Buttons |
Remove buttons you no longer need |
| Command Harvester: Reset History and Ignored Commands |
Start over in this workspace |
Settings
| Setting |
Default |
Description |
commandHarvester.enabled |
true |
Turn watching on or off |
commandHarvester.threshold |
3 |
Successful runs before a command is suggested (minimum 2) |
commandHarvester.detectParameters |
true |
Offer one command when only a single argument changes |
commandHarvester.ignoredCommands |
cd, ls, git status, … |
Never suggest these. An entry matches any command that starts with the same words |
Privacy
Everything stays on your machine. Command history is kept per workspace in VS Code's own storage, nothing is sent anywhere, and there's no telemetry.
Requirements and limitations
- Terminal shell integration must be on. It is by default for PowerShell, bash, zsh and fish in VS Code's integrated terminal.
cmd.exe and external terminals aren't supported. See Terminal Shell Integration.
- On Windows, npm scripts run in
cmd.exe, not PowerShell. Save commands that use PowerShell-only syntax as a task or button instead.
- One changing value per command. Commands where two or more arguments change aren't merged into one.
Feedback
Found a bug or have an idea? Open an issue. Want to help build it? See CONTRIBUTING.md.
License
MIT
| |