Let OpenSpec update itself, and ship it without needing Node
Two things keep coming up together:
- Nothing can update OpenSpec without a person at a terminal. The only upgrade path is inside
openspec update, in a project, behind an "Upgrade to vX now?" prompt, and only for npm installs (shouldOfferUpgrade()bails unless both the input and the output are a terminal;runGlobalUpgrade()hard-codesnpm install -g). Tools that build on OpenSpec can't offer "Update now". - OpenSpec needs Node first. New users install Node before
npm install -gworks. And since npm is the only channel, OpenSpec never owns its install: updating means working out whether npm, pnpm, bun, Volta or yarn put it there, by elimination.
Today
$ curl -fsSL https://openspec.dev/install.sh | sh
(doesn't exist; you need Node, then npm install -g @fission-ai/openspec)
$ openspec upgrade --yes
error: unknown command 'upgrade'
What we'd like
$ curl -fsSL https://openspec.dev/install.sh | sh # macOS, Linux
$ irm https://openspec.dev/install.ps1 | iex # Windows
Installed OpenSpec 1.13.2 to ~/.openspec/bin
$ openspec upgrade --yes
Updating OpenSpec 1.13.2 → 1.14.0…
Updated to 1.14.0.
$ openspec upgrade --yes --json
{ "schemaVersion": 1, "status": "upgraded", "from": "1.13.2", "to": "1.14.0", "installedBy": "openspec" }
- A copy OpenSpec installed (it keeps a small receipt) updates itself. No prompts, no project needed.
- A copy a package manager installed runs that manager's own update (
npm,pnpm,bun,volta), headless. - If it can't tell who installed it, or can't write to that folder:
"status": "manual"with the exact command. It doesn't guess. - If the update fails:
"status": "failed"with the error, and the old version still works. Keep the existing check that the new version is really the one on PATH.
What we looked at
- Claude Code: started on npm, deprecated npm installs in v2.1.15 for a native installer that updates itself in the background. Its npm package now just delivers the same native binary through per-platform optional dependencies (v2.1.113). For Homebrew and WinGet it runs
brew upgrade/winget upgradeitself, opt-in (CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1), and warns when the npm folder isn't writable. setup docs, changelog - uv:
self updateneeds an install receipt written by its own installer. Without one it refuses: "If you installed uv with pip, brew, or another package manager, update uv with…". Proving ownership beats guessing it. source - rustup: distributions build it with self-update switched off at compile time. source
- Deno:
deno upgradereplaces its own executable; if it can't write there, it says to update through your package manager. source - Bun:
bun upgradeworks, but its docs send Homebrew and Scoop users to those tools. docs - update-notifier (what many npm CLIs use): only notifies, once a day, and always suggests
npm i -g. It knows no other package manager. source - Building a standalone binary:
bun build --compile(cross-compiles to 8 targets; macOS signing needs theallow-jitentitlement),deno compile(ad-hoc signed on macOS; Windows needs SignTool), and Node's own single-executable apps (node --build-seasince v25.5.0, still "active development"). For scale, Claude Code's Bun binary is about 340 MB raw and 75 MB compressed on Linux x64. bun, deno, node
What we debated
- Detecting the package manager better vs owning the install. Better detection still guesses, and a path it doesn't recognise falls through to npm. Tools that update smoothly own the copy they update and hand every other copy back to its package manager.
- Running the package manager's own update headlessly. It's an accepted pattern (Claude Code does it for Homebrew and WinGet) and gives an "Update now" for existing npm, pnpm, bun and Volta installs, so it's worth doing even before a standalone build exists.
- Dropping npm vs keeping it. Keep it, ideally delivering the same binary (as Claude Code and Biome do), so existing users aren't stranded and there's only one thing to build.
- A tool bundling its own OpenSpec vs updating the user's. A bundled copy is easiest to keep current, but can drift from the
openspecin the user's terminal. Not decided.
Explorations still to run
- Measure start-up of
openspec --versionon Windows and macOS: the npm shim (cmd.exe→ Node) vs running Node directly vs a compiled binary. We found no good published numbers. - Try compiling OpenSpec with
bun build --compileanddeno compile: does everything work (prompts, file writes, skill installs, telemetry)? Size and start-up per platform? - Cost out signing: Apple Developer ID and notarisation, a Windows signing certificate and SmartScreen reputation, and doing both in CI.
- Design the receipt: what it records (version, install path, channel), where it lives, and how
upgradeuses it to decide who owns the copy. - npm delivering the binary through per-platform optional dependencies: install size, and what happens with pnpm and Volta.
- Windows edge cases: replacing a running
.exe(Windows locks it), and how today's pnpm and Volta install paths look on Windows.
Questions to settle: Bun, Deno or Node's single executables? Who pays for and holds the signing identities? Does npm keep shipping JavaScript, or deliver the binary?
Related: #1988 (reporting the installed version and whether there's an update).
I ran explorations 1 and 2 on macOS (M4 Pro, macOS 26.6.2) against the published 1.14.1, with telemetry and the update check off (OPENSPEC_TELEMETRY=0, OPENSPEC_NO_UPDATE_CHECK=1). Median of 30 runs after 5 warmups, spread under 2.5 ms on every row.
Startup
| How it runs | --version |
list --json |
|---|---|---|
| npm launcher, Homebrew Node 25.9 | 55.3 ms | 109.1 ms |
| Homebrew Node 25.9, bin directly | 53.9 ms | 107.8 ms |
| official Node 22.21, bin directly | 28.1 ms | 82.4 ms |
deno compile |
20.6 ms | 66.3 ms |
bun build --compile (patched, see below) |
45.4 ms | 62.9 ms |
| Node 22 single executable (patched) | 52.1 ms | 72.7 ms |
On a Mac the launcher costs almost nothing. The Node build is what matters: Homebrew's Node 25.9 takes 37.9 ms to start with no code at all, the official Node 22.21 build 16.3 ms. I didn't separate the version from the build, but either way about half of today's startup here is Node, not OpenSpec.
Compiling
| Works unmodified? | Size raw / gzip | |
|---|---|---|
| Deno | Yes, with --include schemas |
80.0 / 30.3 MiB |
| Bun | No, see below | 60.6 / 21.9 MiB |
| Node single executable | No, see below | 108.6 / 34.8 MiB |
Bun and the single executable hit two problems:
src/cli/index.tsreadspackage.jsonthroughcreateRequireat runtime, which bundlers can't see. Unpatched, every Bun command fails withCannot find module '../../package.json'.- The schema resolver finds schemas by listing
schemas/withreaddirSyncandstatSync. Bun's embedded files can be read by exact path but not listed, and a Node single executable only exposes them throughsea.getAsset(). Soschemaslists nothing andnew change,statusandinstructionsfail withUnknown schema 'spec-driven'.
With the first one patched, Bun and the single executable pass init --tools claude (output identical to the npm install under diff -r), list, show and validate --all --json, but the schema commands still fail until the resolver can load schemas from a known file list instead of listing a folder. Deno with --include schemas passed everything. Nothing crashed loading the prompt library on any build, though I couldn't test real key presses without a terminal.
Other things worth knowing:
node --build-seafails on Homebrew's Node 25.9 (sentinel NODE_SEA_FUSE_… not found), so building that way in CI needs an official Node.- Deno's
openspec templatesprints paths inside its virtual filesystem, which don't exist on disk. An agent told to read them would fail.instructionsinlines the content, so it's fine. openspec version --jsonfrom any compiled binary reportspackageManager: null,scope: nulland a temp folder. Soupgradecan't work out who owns a compiled copy from where it sits, which backs the receipt idea in exploration 4.
Not covered: Windows, signing beyond ad hoc, and the npm optional dependencies route.
If it helps, I'd like to take the piece you said is worth doing before a standalone build: openspec upgrade [--yes] [--json] for npm, pnpm, bun and Volta installs, returning manual with the exact command when it can't tell, and checking the new version is the one on PATH. Most of the detection already exists in version-check.ts. Is that open for an outside contributor, and do you want a proposal PR first?
Thanks for the write-up. I use OpenSpec on Windows and want to install it without Node, which 1.15.0 now makes possible, so I opened a pull request to add it to the Windows Package Manager community repository: https://github.com/microsoft/winget-pkgs/pull/461616
One question first, because the package identifier is permanent once published and there is no rename:
Is
FissionAI.OpenSpecthe identifier you would want? That is what thePublisher.Packageconvention produces from the repo owner and the app name.
The manifest is metadata only, nothing in this repo needs to change: InstallerType: portable, Commands: openspec, architectures x64 and arm64, pointing at the openspec-windows-*.exe assets on the v1.15.0 release. Hashes come from the published SHA256SUMS and match a real download.
Two things from this issue the manifest touches, in case they help the receipt design:
1. winget is a channel OpenSpec will not own. Under your rules for #1989 this is the "status": "manual" case, with winget upgrade FissionAI.OpenSpec as the command. Autoupdate could follow the Claude Code precedent you already cite, opt-in. Worth having winget in the receipt's package-manager list from the start rather than adding it after the standalone path ships.
2. openspec install and a winget-managed copy would fight. The standalone binary reinstalls itself where it is, and on Windows a winget-installed copy lives in %LOCALAPPDATA%\Microsoft\WinGet\Packages. Replacing it in place works, because the folder is user-writable, but the Add/Remove Programs version stays behind, so winget upgrade keeps offering a version the user already has and can downgrade them. That is an argument for the receipt deciding ownership rather than the code always reinstalling itself.
Unrelated, noticed while checking the 1.15.0 assets: the Windows binaries carry Bun's PE metadata (ProductName: Bun, CompanyName: Oven, version 1.4.3), because binaries.yml cross-compiles everything on Linux and Bun's --windows-title / --windows-publisher / --windows-version flags only work when compiling on Windows. Cosmetic for winget, since the installed entry comes from the manifest, but it is a small fix if you ever build the Windows assets on windows-latest, and it helps anything that reads file properties. Not a request, just a note.
I am happy to maintain the manifest release by release, or to hand it over. If you would rather own it, wiring it into your release workflow is a single step:
- uses: vedantmgoyal9/winget-releaser@main
with:
identifier: FissionAI.OpenSpec
installers-regex: 'openspec-windows-.*\.exe$'
version: ${{ github.event.release.tag_name }}
token: ${{ secrets.WINGET_TOKEN }}
Tell me which you prefer. If the identifier is wrong, say so now and I will rename it before it is merged.
Turning the identifier question into its own issue rather than leaving it buried here: #2208 (docs(install): add a winget install path for Windows).
Short version: winget install FissionAI.OpenSpec is staged in microsoft/winget-pkgs#461616 — portable, x64 + arm64, hashes from the release's SHA256SUMS. Validation is complete on the winget-pkgs side; it is waiting on a moderator to merge. The only thing that needs a decision from you is the identifier, because Publisher.Package is permanent once published and winget cannot rename a package: from Fission-AI and OpenSpec, with hyphens disallowed, that comes out as FissionAI.OpenSpec. If you want something different, say so on #2208 and I will redo the manifest before it publishes.
Drafted with an AI assistant (Pi), reviewed and posted by me.