Quick start: your first JSONL session
In 10–15 minutes: start fastdoc-cli, open a DOCX, edit the first paragraph with the mutate command, save the result, and verify it without a GUI.
This is the shortest path from an installed SumDoc to a proven “command → model change → DOCX write → re-read” cycle.
Your first real call: a JSONL session
Section titled “Your first real call: a JSONL session”JSONL is the simplest contract for a first integration: one JSON request per stdin line, one JSON response per stdout line. Rust holds the open document’s state between commands.
- Open a terminal.
- Check Node.js with
node --version— you need version 22 LTS or newer. - Go to the prepared folder on your desktop.
- Run the demo client, passing explicit input and output file paths.
cd ~/Desktop/SumDoc-API-first-runnode --version
node a4-api-demo.mjs \ "/Applications/SumDoc.app/Contents/Resources/app/fixtures/docx/simple_text.docx" \ "$PWD/api-demo-result.docx"cd $HOME\Desktop\SumDoc-API-first-runnode --version
node a4-api-demo.mjs ` "C:\Program Files\SumDoc\resources\app\fixtures\docx\simple_text.docx" ` "$PWD\api-demo-result.docx"cd ~/Desktop/SumDoc-API-first-runnode --version
node a4-api-demo.mjs \ "/opt/SumDoc/resources/app/fixtures/docx/simple_text.docx" \ "$PWD/api-demo-result.docx"What the script does
Section titled “What the script does”- Starts
fastdoc-cli servefrom the application package. - Reads the protocol greeting and the list of session commands (there are 41).
- Sends
ping, thenopenandmodel. - Uses the
mutatecommand to insert the text “API DEMO:” at the start of the first paragraph. - Reads
statusand saves a copy with thesavecommand. - Ends the process with the
shutdowncommand.
Actual output from a verified run
Section titled “Actual output from a verified run”Connected: fastdoc.session-serve.v1Commands available: 28Ping: trueSession: rust-session-20320-1Before: This is a sample word document. It has two pages, but no headers or footers.After: API DEMO: This is a sample word document. It has two pages, but no headers or footers.Revision: 1; dirty: trueSaved: /Users/tester/Desktop/SumDoc-API-first-run/api-demo-result.docxOpen the result and see the change
Section titled “Open the result and see the change”open -a SumDoc ~/Desktop/SumDoc-API-first-run/api-demo-result.docx& "C:\Program Files\SumDoc\SumDoc.exe" "$HOME\Desktop\SumDoc-API-first-run\api-demo-result.docx"/opt/SumDoc/a4 ~/Desktop/SumDoc-API-first-run/api-demo-result.docxThe prefix API DEMO: should appear at the start of the first paragraph. This confirms the full cycle: the command reached Rust, changed the document model, was written to DOCX, and was read back by the graphical editor.
This path was proven exactly this way: on August 26, 2026, on an installed SumDoc, with that same prefix in the first paragraph.
Verify the saved file without a GUI
Section titled “Verify the saved file without a GUI”CLI="/Applications/SumDoc.app/Contents/Resources/runtime/native/fastdoc-cli""$CLI" model-docx \ "$HOME/Desktop/SumDoc-API-first-run/api-demo-result.docx" \ --format json$CLI = "C:\Program Files\SumDoc\resources\runtime\native\fastdoc-cli.exe"& $CLI model-docx ` "$HOME\Desktop\SumDoc-API-first-run\api-demo-result.docx" ` --format jsonCLI="/opt/SumDoc/resources/runtime/native/fastdoc-cli""$CLI" model-docx \ "$HOME/Desktop/SumDoc-API-first-run/api-demo-result.docx" \ --format jsonWhat’s next
Section titled “What’s next”- Work through the request and response format — Request and response objects.
- The same commands, but over WebSocket — The same contract over WebSocket.
- Show the document to the user — Starting Web Surface, then Embedding Surface.
- The full list of session commands — the reference.
- Something won’t start — Diagnostics and checklist.