Many Office automation setups assume that you must install Word, Excel, and PowerPoint. Server jobs and AI agent pipelines may need to read and write documents and inspect the content as HTML or PNG without setting up Office. You may want to convert the same input with a command and keep the result as an automation artifact. Repeating conversions in an offline environment lets you include document processing in continuous verification. I tested that premise by building OfficeCLI, a single-binary CLI for Word, Excel, and PowerPoint, from source and converting its bundled Excel dashboard to PNG.
OfficeCLI is open-source software for reading and writing Word, Excel, and PowerPoint files without Office and rendering them as HTML or PNG. The project publishes its source under the Apache 2.0 License(*1). The trial covered five stages: the build, a version check, the rendering error, its fix, and the final conversion.
1. Build a self-contained binary
From the root of the OfficeCLI source tree, publish a self-contained binary for Linux x64.
dotnet publish src/officecli/officecli.csproj -c Release -r linux-x64 -o publish --self-contained true --nologo
The publish command succeeded and created a 35MB single binary in the publish directory. The build took about 6 minutes and spent time trimming assemblies for size. The log included the following message:
Optimizing assemblies for size. This process might take a while.
2. Check the version
I passed --version to the binary from the build.
./publish/officecli --version
The binary reported version 1.0.136.
3. Reproduce the missing headless browser error
I converted the repository's bundled assets/showcase/sales-dashboard.xlsx to a screenshot without changing the input.
./publish/officecli view assets/showcase/sales-dashboard.xlsx screenshot -o out.png
The command failed. In an environment without native Word, Excel, or PowerPoint, OfficeCLI falls back to a rendering path that uses HTML and a headless browser. The command returns this error when no Chrome, Edge, Chromium, or Firefox installation is available:
No headless browser available. Install Chrome/Edge/Chromium or Firefox, or `pip install playwright && playwright install chromium`. Last error: no headless backend available
The Excel input was valid. Screenshot generation required a headless browser, and the environment had no browser available. A browser is a prerequisite for PNG rendering in an environment without Office.
4. Add Playwright's Chromium
I installed Chromium from an Ubuntu/Debian package as my initial attempt. That route failed.
apt-get install chromium
which chromium
The package manager installed a snap stub package and no browser binary, so which chromium returned nothing. This state can occur in a container when Chromium comes through the OS package manager.
Installing Playwright in a Python virtual environment and downloading its self-contained Chromium build worked.
python3 -m venv pw-venv
pw-venv/bin/pip install playwright
pw-venv/bin/playwright install --with-deps chromium
Playwright downloads a Chromium build of about 300MB. The build does not depend on the system package manager, and you can use it without a network connection once the download finishes.
5. Convert the Excel dashboard to PNG
With Playwright's Chromium available, I reran the same conversion with sales-dashboard.png as the output name.
./publish/officecli view assets/showcase/sales-dashboard.xlsx screenshot \
--screenshot-width 1180 --screenshot-height 620 -o sales-dashboard.png
Rendering succeeded. The process worked with the network disconnected and required no network connection during conversion.
The sample input is a fictional “Q4 2025 Global Sales Dashboard.” The default viewport (1600×1200) displayed a partial view of the sheet and left large margins, so I set --screenshot-width 1180 --screenshot-height 620 to match the amount of content. OfficeCLI reproduced the Excel sheet in the PNG image below, including its bar chart, pie chart, and KPI cards.
Bring document processing into a daily pipeline
You can add document reading, writing, and preview generation to a CLI workflow without waiting for Office to start. Once you have the self-contained binary and downloaded Chromium, you can repeat the same conversion in an environment without network access. You can make modified Excel-to-PNG review a routine verification step alongside builds and AI agent processing. You can shift document work from opening files by hand to producing reproducible artifacts.
Sources
*1 iOfficeAI/OfficeCLI, https://github.com/iOfficeAI/OfficeCLI, Apache 2.0 License