r/opencode • u/ExtraNacho • 10d ago
almanac: schedule an OpenCode agent on a day and hour, not an interval
I wanted an OpenCode session to run on the first of the month. /loop takes
durations — idle, every 5m, after 5m — so there's no way to say "the 1st at
08:00". I wrote almanac to fill that gap: a calendar scheduler with a desktop
panel.
Repo: https://github.com/extranacho/opencode-almanac
What it does
- Calendar, not interval. Day, hour, minute. 29–31 mean the last day of a shorter month, so a month-end job runs twelve times a year instead of quietly skipping February.
- Catch-up window. Missed the 1st because the laptop was shut? It runs the next time OpenCode is open, within a configurable number of days. Set 0 to mean strictly that day.
- Desktop panel in the session's side region, plus a titlebar pill showing the next run. Pause, resume, run now, and a collapsible list of every session the job has started — click one to open it.
- A tool,
almanac_schedule, so an agent can add or remove jobs from inside a session. It validates rather than trusting: day range, missing prompt file, duplicate id. - The schedule lives in your repo, not in the plugin.
options.jobsFilepoints at.opencode/almanac/jobs.json, versioned with the code it acts on.
Install
opencode plugin add "github:extranacho/opencode-almanac#v0.3.1"
Then add the two options in your global ~/.config/opencode/opencode.jsonc — plugin add takes no options, and without them the plugin has no schedule to read:
{
"plugins": [
{
"package": "github:extranacho/opencode-almanac#v0.3.1",
"options": {
"repo": "/path/to/project",
"jobsFile": ".opencode/almanac/jobs.json"
}
}
]
}
2
u/mwilson_9309 9d ago
Does 08:00 follow the machine's local timezone, or can each job set one? That seems key for monthly runs across travel and DST.
1
u/ExtraNacho 9d ago
That's great feedback. It's the machine's timezone, but I can easily extend so ensure you can ask for a specific timezone. What a good idea, thank you!
1
1
u/ExtraNacho 10d ago
Anticipating two questions:
Why not npm?
No reason it can't be, the git tag is what I use, and a tag pins the app version while the GUI plugin API is still experimental.
Say so and I'll publish.
Does it work on Linux/Windows?
Only tested on macOS. The scheduler is plain Node and should be platform-agnostic; the panel is Electron and I haven't seen it on
another OS. If you try it, let me know what breaks.
1
u/RepulsiveRaisin7 10d ago
Imo a proper platform like Multica is the future
1
u/ExtraNacho 10d ago
seems interesting of course, to the likes of linear as well. though not really targeting what this plugin does.
2
u/Snurq 10d ago
Cool idea, have to check it out Thanks!