-
Notifications
You must be signed in to change notification settings - Fork 0
Home
xirothedev edited this page Aug 25, 2026
·
2 revisions
Office document automation for opencode 2: draft lifecycle, version history, locks, comments, format conversion, and template batch generation. Exposes one tool, officecli, plus an edit override that forces binary files through the draft lifecycle.
- npm:
@xirothedev/openoffice-plugin-opencode - Repo: github.com/xirothedev/opencode-office-plugin
Add to opencode.json (project root or ~/.config/opencode/opencode.json):
{
"plugins": ["@xirothedev/openoffice-plugin-opencode"]
}Then ask opencode: "Create a Word document at /tmp/test.docx with a table". The agent calls officecli(action="create") to open a draft, and officecli(action="accept") to write the real file.
-
Draft —
create/editnever touch the real file. Changes live in a draft under the plugin data dir. -
Accept — the single write path.
acceptflushes the draft to disk, records a history snapshot, releases the lock. -
Lock — a per-file claim, not a mutex. Acquired lazily on the first mutating call. A stale lock (default 24h) can be taken over with
force-release. -
History — every
acceptrecords a snapshot;revertrestores one through a new draft + accept.
| Format | Read | Write | Notes |
|---|---|---|---|
| Text / Markdown | yes | yes | native |
| yes | yes | write needs pandoc + LaTeX engine | |
| DOCX / XLSX / PPTX | yes | yes | pandoc + docx/exceljs backends |
| Images (PNG, JPG) | yes | yes | via annotate overlays; no pixel editing |
- Install — requirements, config, local dev, troubleshooting
-
Usage — every
officecliaction with parameters - Comment Workflow — suggestions, approvals, track changes
- Configuration — options, env vars, data storage
| Wiki page | Source of truth in repo |
|---|---|
| Home |
README.md, docs/DESIGN.md
|
| Install |
docs/INSTALL.md, docs/TESTING.md
|
| Usage |
src/plugin/tools/officecli.ts (schemas), README.md
|
| Comment Workflow | docs/COMMENT-WORKFLOW.md |
| Configuration |
src/core/options.ts, README.md
|
If an action signature changes in src/plugin/tools/officecli.ts, update the Usage page in the same PR. Domain terms (Draft, Accept, Lock, Orphaned draft, …) are defined in docs/CONTEXT.md.
License: MIT.