Commands
Every command, grouped by the kind of file it works on.
| Spreadsheets | |
|---|---|
formula | Evaluate a formula against data you pass as JSON. |
query | Print a cell range from an .xlsx as tab-separated values. |
save | Write sheets into an existing .xlsx, in place. It cannot create a new file. |
| Word documents | |
word | Sections and page setup, the body text with --body, or the full structure as JSON with --extract. |
comments | List the comments, resolve or reopen a thread, or reply to one. |
revisions | List the tracked changes, or accept or reject them, all at once or one at a time. |
| Presentations | |
slides | List the slides with their titles and text, or write slides into an existing .pptx. |
pdf | info, merge, split, and protect: page and character counts, combine files, split at a page, or add a password. |
| Any format | |
load | A workbook's sheets with their formulas, a deck's slides, or a document's sections. |
detect | Identify a document's type from its file extension. |
validate | Open, save, and reopen a file or a folder of files, and report whether anything was lost. |
Some commands change the file you name. save, slides --save, and pdf protect write to the file itself, and so do comments and revisions when they resolve, reply, accept, or reject, unless you add -o with a new file name.
Made for Scripts
The command is built on the same document engine as the app, and it behaves the way shell tools do.
- Output is plain text, tab-separated values for a cell range, or JSON for a document's structure, so it works with
awk,cut,jq, and the rest of your tools. - A failure, such as a missing file, prints a message to standard error and exits with status 1, so a script can stop on it.
- A formula that cannot be evaluated prints an error value such as
#VALUE!, as a spreadsheet cell would, and exits with status 0. - It reads and writes files itself, so it runs in scripts and scheduled jobs without the app open.
Terminal
$ lynxoffice formula '=SUM(A1:A3)' \
--data '[["10"],["20"],["30"]]'
60
$ lynxoffice comments "Green Coffee Contract.docx"
Comments in Green Coffee Contract.docx:
• #0 Ana Ruiz: Twenty-one days matches our export schedule.
• #1 Tom Hale: We need the harvest date on the label as well.
$ lynxoffice word "Green Coffee Contract.docx" --extract \
| jq -r '.body[] | select(.runs[0].formatting.bold) | .text'
2. Quality and rejection
3. Provenance records
$ lynxoffice pdf info "Green Coffee Contract.pdf"
Pages: 1
Characters: 1662
Has text: true
Install
-
1
Install the command
lynxofficeis a separate program that needs macOS 14 or later. Install it with Homebrew:brew install lynxoffice/tap/lynxofficeEvery release is also on GitHub, signed with KDAN's Developer ID, notarized by Apple, and listed with its SHA-256 checksum. Homebrew is the simpler way to install it and keep it up to date.
-
2
Run it
Open Terminal and run
lynxoffice helpfor every command, with its options and an example of each.
Frequently Asked Questions
How do I install it?
Install it with Homebrew, by running brew install lynxoffice/tap/lynxoffice in Terminal. It is a separate program and needs macOS 14 or later. Every release is also on GitHub, at github.com/LynxOffice/lynxoffice-cli-mac, signed with KDAN's Developer ID and notarized by Apple.
Does LynxOffice need to be open?
No. The command reads and writes files itself, so it works in scripts and scheduled jobs whether or not the app is running.
What does it print, and how do errors look?
Plain text by default, tab-separated values for a cell range, and JSON for a document's structure. A failure, such as a missing file, prints a message to standard error and exits with status 1.
Is it the same engine as the app?
Yes. The command-line tool is built on the same document engine as the app and the MCP server. The tool cards on the app's Home screen name the command that does the same job.
Free During Early Release
Download LynxOffice, open any document, and try the six AI tools.