Terminal Scheduler
Prompt automation for terminal-based agents — right in your VS Code integrated terminal, no tmux.


Why
Driving terminal-based agentic tools (Claude Code, opencode, …) with scheduled prompts works great under tmux — you script the keystrokes and let them fly. But if you live in VS Code's integrated terminal, tmux means a context switch you may not be able to (or want to) make every time: another multiplexer to attach, another pane layout, agents running outside the editor you're already in.
Terminal Scheduler gives you that same "send this prompt at this time" power inside the integrated terminal you already use. You declare jobs in a small JSON/JSONL file; at each job's time the extension types the text — prompts, commands, Enter, control keys — into the terminal you name. Simple, but enough to automate a real agent loop.
Install
code --install-extension mitgh.terminal-scheduler
Or search "Terminal Scheduler" in the Extensions view.
Usage
Create .vscode/terminal-schedule.jsonl in your workspace (or point terminalScheduler.configPath at any file). One job per line (a .json array works too):
{"target":"opencode","datetime":"in 5 minutes","text":"run the tests\n","enabled":true}
{"target":"build","datetime":"2026-07-12T09:00:00","text":"npm run build\n","enabled":false}
At each job's time, the text is sent to the terminal named target (created if it doesn't exist).
| field |
meaning |
target |
terminal name; created if missing |
datetime |
ISO 8601 (2026-07-12T09:00:00), epoch ms, or a relative duration ("1 day", "5 seconds", "2h"). Past-due fires on load. |
text |
sent verbatim to the terminal's stdin — include \n for Enter (\r submits in a TUI), \uXXXX for control keys |
enabled |
false = ignored |
run_count |
optional seed; the live counter is tracked separately (see below) |
Sending keystrokes
text is written straight to the terminal. Use control characters for special keys — Enter → \n, submit-in-a-TUI → \r, Ctrl-C → , Up arrow → [A. It writes to the pty stdin (simulated typing), not raw DOM key events.
Commands
- Terminal Scheduler: Reload Config
- Terminal Scheduler: Run All Pending Jobs Now
- Terminal Scheduler: Reset Run State
- Terminal Scheduler: Show Log
Safety
- Your config file is read-only to the extension — it is never rewritten.
- Run state (has-a-job-fired, how many times) lives in the extension's own storage, written atomically, so an interrupted write can't corrupt anything. A
run_count in the config is only an optional seed.
- One malformed job disables itself with a precise error; the healthy jobs still run.
Develop
make install # deps
make test # unit tests
make build # esbuild bundle -> dist/extension.js
make package # produce the .vsix
Internals: architecture.md.
License
Apache-2.0