{"_id":"@aionui/officecli-sdk","_rev":"3-640a2f37628b2bd88b8882ba89e67644","name":"@aionui/officecli-sdk","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aionui/officecli-sdk","version":"0.1.0","keywords":["officecli","office","docx","xlsx","pptx","word","excel","powerpoint","ooxml","sdk"],"author":{"name":"goworm"},"license":"Apache-2.0","_id":"@aionui/officecli-sdk@0.1.0","maintainers":[{"name":"goworm","email":"zmworm@gmail.com"}],"homepage":"https://github.com/iOfficeAI/OfficeCLI/tree/main/sdk/node","bugs":{"url":"https://github.com/iOfficeAI/OfficeCLI/issues"},"dist":{"shasum":"2b5f095a3efc4336fd74af760d8ea9ddf4407778","tarball":"https://registry.npmjs.org/@aionui/officecli-sdk/-/officecli-sdk-0.1.0.tgz","fileCount":4,"integrity":"sha512-vxnBnYmFJWrS7J36Sg1/MAaeh5p1lVL+qe/3iLAC/hz3UNcpWpbaEQ5CzqcPr2uN17oXhObLp+sOzWG9YQW9Zw==","signatures":[{"sig":"MEUCIQDI3Ht0ooQTPcGlpwXa5+k0VTWz66pyHsxi2p6jqqmrVQIgesq0ntDRZ7g2PVFmAqVLHycW2HwTJTP3wnI4BE7v6kE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34768},"main":"index.js","types":"index.d.ts","engines":{"node":">=18"},"gitHead":"a685aa19fba39ff82835bd64bd0f4f0122e19439","_npmUser":{"name":"goworm","email":"zmworm@gmail.com"},"repository":{"url":"git+https://github.com/iOfficeAI/OfficeCLI.git","type":"git","directory":"sdk/node"},"_npmVersion":"11.4.2","description":"Node.js SDK for officecli — a thin async client over the officecli resident pipe (read/write .docx/.xlsx/.pptx).","directories":{},"_nodeVersion":"22.17.0","dependencies":{"@officecli/officecli":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/officecli-sdk_0.1.0_1782491681682_0.7285052361615503","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aionui/officecli-sdk","version":"0.1.1","keywords":["officecli","office","docx","xlsx","pptx","word","excel","powerpoint","ooxml","sdk"],"author":{"name":"goworm"},"license":"Apache-2.0","_id":"@aionui/officecli-sdk@0.1.1","maintainers":[{"name":"goworm","email":"zmworm@gmail.com"}],"homepage":"https://github.com/iOfficeAI/OfficeCLI/tree/main/sdk/node","bugs":{"url":"https://github.com/iOfficeAI/OfficeCLI/issues"},"dist":{"shasum":"0bf8fd1af1c686a77335256956b8476596e27ecd","tarball":"https://registry.npmjs.org/@aionui/officecli-sdk/-/officecli-sdk-0.1.1.tgz","fileCount":4,"integrity":"sha512-1/tO213NtQRogZVVHz1OxYfxbieJXNkUEvmTmVfldHr9gp8koNzklko0oOmP89JJST11Uet2Xiepo91bPh2lDw==","signatures":[{"sig":"MEUCIDehQ9SbXf+X92ufN1JN0IAt/KL/FjGOnIFqyhpGFenZAiEAwIbTKG/X7WFp/EXQx9OXpqsrq0vyEOdnn7YwM0KD5gI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aionui%2fofficecli-sdk@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":34768},"main":"index.js","types":"index.d.ts","engines":{"node":">=18"},"gitHead":"76d9816ada2c913a2273b293a14fb3c0b40abdf3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:086906fe-ab66-4a0c-af0e-8e70c7df2932"}},"repository":{"url":"git+https://github.com/iOfficeAI/OfficeCLI.git","type":"git","directory":"sdk/node"},"_npmVersion":"11.17.0","description":"Node.js SDK for officecli — a thin async client over the officecli resident pipe (read/write .docx/.xlsx/.pptx).","directories":{},"_nodeVersion":"24.17.0","dependencies":{"@officecli/officecli":"^1.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/officecli-sdk_0.1.1_1782492469642_0.9193135852087653","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aionui/officecli-sdk","version":"0.1.2","description":"Node.js SDK for officecli — a thin async client over the officecli resident pipe (read/write .docx/.xlsx/.pptx).","license":"Apache-2.0","author":{"name":"goworm"},"homepage":"https://github.com/iOfficeAI/OfficeCLI/tree/main/sdk/node","repository":{"type":"git","url":"git+https://github.com/iOfficeAI/OfficeCLI.git","directory":"sdk/node"},"bugs":{"url":"https://github.com/iOfficeAI/OfficeCLI/issues"},"keywords":["officecli","office","docx","xlsx","pptx","word","excel","powerpoint","ooxml","sdk"],"main":"index.js","types":"index.d.ts","engines":{"node":">=18"},"dependencies":{"@officecli/officecli":"^1.0.0"},"gitHead":"ef1b99a729207ddaa2ebc358379ef367cc3f3db4","_id":"@aionui/officecli-sdk@0.1.2","_nodeVersion":"24.17.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-zsTqKOXcoNXzq1WAAvu7RI46VwXj8auzWY+Cmt/yZr+XhoCYhwyZy0cFLP0SwDLePwLd1pZ29wtl4dJIm0QxTw==","shasum":"a488b3e0979f27a6ac4b098360a10968ebf6a074","tarball":"https://registry.npmjs.org/@aionui/officecli-sdk/-/officecli-sdk-0.1.2.tgz","fileCount":4,"unpackedSize":35171,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aionui%2fofficecli-sdk@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCun6dJGrHByKwdeY5Kzp35U0PVPpFUGMn2/cGWUcPX5QIgbuYB6ixP2FUWIfr3zL2qYyB6EAnVl5mgeUYdXQIB/KM="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:086906fe-ab66-4a0c-af0e-8e70c7df2932"}},"directories":{},"maintainers":[{"name":"goworm","email":"zmworm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/officecli-sdk_0.1.2_1782648275138_0.031000416029696165"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-26T16:34:41.526Z","modified":"2026-06-28T12:04:35.552Z","0.1.0":"2026-06-26T16:34:41.819Z","0.1.1":"2026-06-26T16:47:49.770Z","0.1.2":"2026-06-28T12:04:35.276Z"},"bugs":{"url":"https://github.com/iOfficeAI/OfficeCLI/issues"},"author":{"name":"goworm"},"license":"Apache-2.0","homepage":"https://github.com/iOfficeAI/OfficeCLI/tree/main/sdk/node","keywords":["officecli","office","docx","xlsx","pptx","word","excel","powerpoint","ooxml","sdk"],"repository":{"type":"git","url":"git+https://github.com/iOfficeAI/OfficeCLI.git","directory":"sdk/node"},"description":"Node.js SDK for officecli — a thin async client over the officecli resident pipe (read/write .docx/.xlsx/.pptx).","maintainers":[{"name":"goworm","email":"zmworm@gmail.com"}],"readme":"# @aionui/officecli-sdk\n\nA thin **async** Node.js client over [officecli](https://github.com/iOfficeAI/OfficeCLI)'s\nresident pipe. It does one thing: forward a command to the running resident and\nhand back the response. There is no second vocabulary to learn — a command is the\nsame object you'd put in an officecli `batch` list.\n\n```bash\nnpm install @aionui/officecli-sdk\n```\n\nInstalling the SDK pulls `@officecli/officecli`, which bundles an auto-updating\nnative binary — so the CLI comes with it and you don't manage it separately. If\nthe binary is ever missing, the SDK provisions it on first use (downloads the\nbundled signed binary, or falls back to the official installer).\n\n## Usage\n\n```js\nconst oc = require('@aionui/officecli-sdk');\n\nconst doc = await oc.create('report.xlsx', ['--force']);\ntry {\n  await doc.send({ command: 'set', path: '/Sheet1/A1', props: { text: 'Hello' } });\n  const a1 = await doc.send({ command: 'get', path: '/Sheet1/A1' }); // → envelope object\n  console.log(a1);\n\n  // Many writes in one round-trip:\n  await doc.batch([\n    { command: 'set', path: '/Sheet1/B1', props: { text: '42' } },\n    { command: 'set', path: '/Sheet1/C1', props: { text: 'world' } },\n  ]);\n} finally {\n  await doc.close(); // flushes to disk\n}\n```\n\nOn Node ≥ 24 you can use `await using` and skip the explicit close:\n\n```js\nawait using doc = await oc.open('existing.xlsx');\nawait doc.send({ command: 'get', path: '/body/p[1]' });\n```\n\n## Two surfaces\n\n- **bootstrap** (infrequent): `create()` / `open()` spawn one CLI process.\n- **hot path**: `send()` / `batch()` are pure pipe round-trips, no per-command\n  process spawn.\n\n## API\n\n- `await create(path, args?, options?)` → `Document` — make a new file. Extra CLI\n  flags pass through verbatim (`['--force']`, `['--type', 'docx']`).\n- `await open(path, options?)` → `Document` — open an existing file.\n- `Document.send(item, asJson = true, timeoutMs?)` — forward one command.\n  `asJson = false` requests plain-text output (view/raw/dump).\n- `Document.batch(items, { force = true, stopOnError = false, timeoutMs? })`.\n- `Document.alive(timeoutMs?)` — is a resident serving this file?\n- `Document.close()` — stop the resident (flushes to disk).\n- `install()` — run the official installer (unix only).\n\n`options`: `{ binary?, timeoutMs?, autoInstall? }`. Pass `binary` to point at a\nspecific officecli; `autoInstall: false` to disable provisioning a missing CLI.\n\n## Errors vs business outcomes\n\nTransport/process failures throw `OfficeCliError`. Business outcomes are **not**\nexceptions — they live in the returned envelope's `success` field, exactly like\nthe CLI's exit code. Check `result.success` yourself.\n\n## Lifecycle\n\n```js\n// Owner — close on exit:\nconst d = await oc.open(f);\ntry { /* ... */ } finally { await d.close(); }\n\n// Borrow — leave a resident another program owns running:\nconst d = await oc.open(f);\nawait d.send(/* ... */); // no close()\n```\n\nA dead resident is transparently restarted and the command retried once. An\nalive-but-busy pipe raises `OfficeCliError` (retry, or `close()` and reopen) —\nthe SDK never bypasses a live resident, which would race its save.\n\nLicensed under Apache-2.0.\n","readmeFilename":"README.md"}