npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xpert-ai/plugin-office-cli

v0.2.3

Published

Visual OfficeCLI app plugin for native DOCX, XLSX, and PPTX automation, rendering, versioning, and Agent editing.

Downloads

497

Readme

OfficeCLI

@xpert-ai/plugin-office-cli is an independent Xpert system app plugin that keeps native DOCX, XLSX, and PPTX files as the authoritative document state while exposing the OfficeCLI engine through a visual Workbench and Agent middleware tools.

It does not depend on or replace @xpert-ai/plugin-office-editor.

Capabilities

  • Create and import native .docx, .xlsx, and .pptx files.
  • Render OfficeCLI HTML previews inside an isolated Xpert Workbench iframe.
  • Select renderer elements that expose stable OfficeCLI paths.
  • Click rendered text, cells, or shapes and edit their content in an inline Chinese editor inside the preview.
  • Save direct edits back to the native Office file through OfficeCLI.
  • Permanently delete documents and their stored Workspace File versions from the Workbench after confirmation.
  • Keep the OfficeCLI L1/L2/L3 command model available to Agent tools without exposing a raw command console in the Workbench.
  • Use batch, dump, merge, validation, issue inspection, and raw OOXML fallback.
  • Store the current native file at a stable sandbox-visible Workspace File path under /workspace/files/office-cli/documents/<documentId>/.
  • Store hidden recovery snapshots in .versions while retaining only the latest five snapshots per document.
  • Restore an older version without deleting history.
  • Return native Office files as Agent artifacts.
  • Load OfficeCLI's pinned professional Word, Excel, financial-model, dashboard, and PowerPoint workflow guidance for the Agent.
  • Define real Word Title/Heading/TOC styles, repair legacy heading references, create a native clickable TOC, and enable TOC field updates when Word/WPS opens the file.
  • Install an OfficeCLI Skill and Assistant template.

Architecture

OfficeCLI Workbench / Agent tools
                |
       OfficeCliService
        |             |
Workspace Files    OfficeCliRuntimeService
        |             |
current + snapshots   pinned OfficeCLI binary

The Workbench never converts the authoritative file to a Univer snapshot. Preview HTML is generated from the current native file and treated as a derived view.

Each document has one stable current file:

/workspace/files/office-cli/documents/<documentId>/<fileName>

This is the same runtime workspace tree used by Xpert sandbox and file tools. Successful saves overwrite that stable current file and create a separate hidden recovery snapshot:

/workspace/files/office-cli/documents/<documentId>/.versions/v000001-<checksum>.<ext>

Existing records stored in the plugin's legacy office-cli/.../versions folder remain readable and migrate lazily to the standard files/... tree on their next successful save.

The Workbench delete_document action is a permanent aggregate delete. It removes the scoped document and version records and attempts to remove every corresponding Workspace File. The UI requires an explicit confirmation before invoking it.

Preview refreshes are coalesced by immutable version, keep the last successful preview visible while a new preview is generated, and stop waiting after 45 seconds with an actionable retry message. The OfficeCLI renderer itself is bounded to 40 seconds so the server can return an error before the Workbench watchdog expires.

Binary runtime

The plugin pins OfficeCLI v1.0.142. Release asset names and SHA-256 digests are recorded in assets/officecli-release.json.

Resolution order:

  1. OFFICECLI_BINARY_PATH, when configured.
  2. A checksum-verified binary in OFFICECLI_CACHE_DIR.
  3. A checksum-verified binary in Xpert's persistent per-user cache.
  4. A checksum-verified download from the pinned GitHub Release.

The default cache survives operating-system restarts:

  • macOS: ~/Library/Caches/xpert/office-cli/<version>
  • Linux: ${XDG_CACHE_HOME:-~/.cache}/xpert/office-cli/<version>
  • Windows: %LOCALAPPDATA%\xpert\office-cli\<version>

The plugin prewarms and validates this runtime during plugin bootstrap. Downloads are retried within a bounded ten-minute preparation window, and preview requests retry preparation if bootstrap could not reach GitHub. For production systems that cannot access GitHub Releases, provision the pinned executable in the deployment image and set OFFICECLI_BINARY_PATH; this removes the first-start network dependency entirely.

Supported assets:

  • Linux x64 and ARM64
  • Alpine Linux x64 and ARM64 (auto-detected; OFFICECLI_ALPINE=1 can force selection)
  • macOS x64 and ARM64
  • Windows x64 and ARM64

OfficeCLI auto-update and automatic resident mode are disabled for plugin executions. Each operation runs in a bounded temporary directory and receives a managed copy of the current Workspace File.

Safety

  • Child processes are spawned with argument arrays, never through a shell.
  • User commands cannot control the authoritative input/output file paths.
  • CSV/TSV import is accepted through stdin; merge data must be inline JSON.
  • Media properties accept inline data URIs, not server file paths or external URLs.
  • install, config, mcp, watch, open, and close are not document commands exposed by the plugin.
  • raw-set and add-part require dangerousConfirmed=true.
  • Output, argument, file size, download size, and execution time are bounded.
  • Every stored version is SHA-256 verified before execution.
  • Writes support optimistic concurrency through expectedVersionNumber.

Agent tools

  • officecli_create_document
  • officecli_list_documents
  • officecli_read_document
  • officecli_execute
  • officecli_get_versions
  • officecli_restore_version
  • officecli_get_file
  • officecli_help
  • officecli_load_skill
  • officecli_apply_word_design

Development

pnpm -C xpertai exec nx build @xpert-ai/plugin-office-cli
pnpm -C xpertai exec nx test @xpert-ai/plugin-office-cli
pnpm -C plugin-dev-harness build
node plugin-dev-harness/dist/index.js \
  --workspace ./xpertai \
  --plugin @xpert-ai/plugin-office-cli \
  --verbose

For a real runtime smoke test, either set OFFICECLI_BINARY_PATH or allow the pinned binary download. A configured binary must be executable by the Xpert server process.

Upstream

OfficeCLI is developed at https://github.com/iOfficeAI/OfficeCLI and licensed under Apache-2.0. The Xpert plugin code in this repository follows the repository AGPL-3.0 license.