omp packages

pi-auto-update0.1.6

Automatically update installed Pi packages and Pi itself when a Pi session starts.

GitHub Actions Published 19 days ago MIT ~779 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Pi Auto Update

Join dotfield.xyz on Discord

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing Buy Me A Coffee

Keep installed Pi packages and Pi itself current automatically at process startup.

What this is

Pi Auto Update is a TypeScript Pi package that runs Pi's own update commands once when a new Pi process starts. It updates installed package extensions first, then checks Pi itself, without replacing Pi's built-in updater.

Features

  • Runs pi update --extensions before pi update.
  • Waits for each update step to finish before starting the next one.
  • Automatically runs once per Pi process, not again after /reload, /new, /resume, or /fork.
  • Skips automatic updates when PI_OFFLINE=1 or PI_AUTO_UPDATE=0.
  • On Windows, defers extension updates when an active Pi runtime may hold package files open.
  • Provides /auto-update-now for an explicit update check.
  • Reports failures in the Pi UI without aborting session startup.

Install

Install the published npm package with Pi:

pi install npm:pi-auto-update

Pin a specific version when you want reproducible installs:

pi install npm:pi-auto-update@0.1.4

Install into the current project instead of your user Pi settings:

pi install npm:pi-auto-update -l

Or install from GitHub:

pi install git:github.com/eiei114/pi-auto-update

Try it without permanently installing:

pi -e npm:pi-auto-update

Quick start

After installation, restart Pi. On process startup, Pi Auto Update runs:

pi update --extensions
pi update

Run both checks manually at any time:

/auto-update-now

On Windows, npm cannot replace an extension package while an active Pi runtime (including the pi-intercom broker) is using files inside that package. When that runtime is detected, the extension step is deferred and the Pi update still runs. If npm reports EBUSY (-4082 or 4294963214), close Pi runtimes and run pi update --extensions from a shell.

Try the local checkout without permanently installing it:

pi -e .

Package contents

Path Purpose
extensions/auto-update.ts Startup update hook and /auto-update-now command
docs/release.md Trusted Publishing and release flow
README.md GitHub and npm package entrypoint
CHANGELOG.md Versioned release notes
LICENSE MIT license

Development

npm install
npm run ci
npm pack --dry-run
PI_AUTO_UPDATE=0 pi -e .

Run only the installed-package smoke when changing package metadata or startup loading behavior:

npm run test:installed-smoke

The smoke test packs the local package, installs the tarball into a temporary Pi agent directory, loads it through Pi's package resource loader with PI_OFFLINE=1, and asserts startup/reload handling does not invoke pi update or touch the user's real Pi settings.

Release

This package is set up for npm Trusted Publishing, so no NPM_TOKEN is required.

npm version patch
git push

See docs/release.md for setup details.

Docs

Security

Installing this package opts the machine into automatic code updates from Pi and every package source configured in Pi. Review and trust those sources before installing this extension.

Pi packages can execute code with your local permissions. For vulnerability reporting, see SECURITY.md.

Links

License

MIT