Deterministic routine timer CLI for orchestrator integration.
Per MVP_SPEC.md — designed for routine-orchestrator to call without ambiguity.
- sessionId-first: Multi-active sessions allowed. Commands target specific sessions by ID.
- Deterministic: All state-changing commands require
--ts RFC3339timestamp. - JSON output: Machine-readable output for orchestrator integration.
- SQLite storage: Persistent storage with proper schema.
npm install# Create a routine
routine add --name "Deep Work" --rule "daily>=30m" --ts 2026-01-31T09:00:00+09:00
# Start a session
routine start --routine "Deep Work" --ts 2026-01-31T09:00:00+09:00 --format json
# Check active sessions
routine active --format json
# Pause a session
routine pause --session ses_01H... --ts 2026-01-31T09:15:00+09:00
# Resume a session
routine resume --session ses_01H... --ts 2026-01-31T09:20:00+09:00
# Stop a session
routine stop --session ses_01H... --ts 2026-01-31T10:00:00+09:00
# Get today's summary
routine today --date 2026-01-31 --format json| Command | Description | Required Args |
|---|---|---|
add |
Create a routine | --name, --rule, --ts |
list |
List all routines | - |
show |
Show routine details | --routine |
start |
Start a new session | --routine, --ts |
active |
List active sessions | - |
status |
Get session status | - |
pause |
Pause a session | --session, --ts |
resume |
Resume a session | --session, --ts |
stop |
Stop a session | --session, --ts |
today |
Daily summary | - |
log- Backfill a sessionamend- Modify a sessionrm- Delete a sessionstreak- Show streakskip- Skip a dateunskip- Remove skip
--format <human|json>- Output format (default: human)--db <path>- Database path (default: ~/.routine/routine.sqlite3)--tz <IANA_TZ>- Timezone for date interpretation
- No implicit system clock for state changes: All state-changing commands require
--ts RFC3339. - Strict time format: Only RFC3339 with timezone offset (e.g.,
2026-01-31T09:00:00+09:00). - sessionId-first: pause/resume/stop require explicit
--session. - No ambiguity: CLI fails with error codes + details when input is ambiguous.
ERR_TS_REQUIRED---tsmissing for state-changing commandERR_INVALID_TIME_FORMAT- Invalid RFC3339/date formatERR_ROUTINE_NOT_FOUND- Routine not foundERR_AMBIGUOUS_ROUTINE- Multiple routines match nameERR_SESSION_NOT_FOUND- Session not foundERR_SESSION_REQUIRED---sessionmissingERR_SESSION_NOT_ACTIVE- Session already stoppedERR_INVALID_STATE- Invalid state transition (e.g., pause paused)ERR_END_BEFORE_START- Stop time before start timeERR_NOT_IMPLEMENTED- Command not implemented
0- Success1- Generic failure2- User input error3- Not found4- Ambiguity/conflict5- Not implemented
npm testMIT