@funtusov/heartbeat
v0.1.1
Published
Codex thread heartbeat CLI (auto-continue long tasks)
Downloads
158
Maintainers
Readme
@funtusov/heartbeat
Codex thread heartbeat CLI with local job tracking.
It periodically checks a Codex thread via codex app-server, and when the latest turn is terminal (completed, interrupted, failed) it starts a follow-up turn with your continuation prompt.
Install
npm i -g @funtusov/heartbeat
heartbeat --helpOr run without installing:
npx @funtusov/heartbeat --helpRequirements
codexCLI installed and authenticated (codex login)- Node.js >= 18
Commands
Start a background heartbeat
heartbeat start --thread-id 019c... --interval 15m --for 8hShow active/history jobs (table)
heartbeat statusColumns include:
STARTEDEVERYTHREADRUNS(times ran)LAST RUNNEXT RUNLAST ACTION
Stop one/all jobs
heartbeat stop <job-id>
heartbeat stop --allView job logs
heartbeat logs <job-id>
heartbeat logs --tail 50Clear old non-running jobs
# Remove stopped/failed/exited/completed jobs and their logs
heartbeat clear
# Preview first
heartbeat clear --dry-run
# Only clear jobs older than 7 days
heartbeat clear --older-than 7dForeground mode (legacy behavior)
heartbeat --interval 15m --until "tomorrow 7am"
# same as:
heartbeat run --interval 15m --until "tomorrow 7am"Follow-up prompt
Default prompt:
Continue working on this task. Pick the next highest-impact step, execute it, and report concise progress before stopping.
Override with --prompt or --prompt-file.
Notes
- Multiple concurrent heartbeat jobs are supported.
- Use
--yolowithrun/startto launch Codex ascodex --yolo app-server .... - By default, the first cycle waits one full
--interval;--oncestill runs immediately. - Default local state path is
~/.heartbeat(jobs + logs). heartbeat startdoes a preflightthread/resumecheck before daemonizing. If a thread id is stale/non-resumable, it fails immediately with remediation guidance.- If
--thread-idfails to resume, tryheartbeat run --once --dry-runwithout--thread-idto auto-pick a resumable thread in your current--cwd. heartbeat clearonly deletes non-running jobs; it does not stop running jobs.
