pi-exit-when-done

Exit this session, or suspend, shutdown, or reboot once every running Pi/OMP session finishes.

Packages

Package details

extension

Install pi-exit-when-done from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-exit-when-done
Package
pi-exit-when-done
Version
0.2.0
Published
Sep 27, 2026
Downloads
365/mo · 6/wk
Author
thejorgg
License
MIT
Types
extension
Size
18.7 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-exit-when-done

Tiny Pi / Oh My Pi extension for performing an action after agent runs finish.

Commands

/exit-when-done
/exit-when-done exit
/exit-when-done suspend
/exit-when-done shutdown
/exit-when-done reboot
/exit-when-done cancel

With no argument:

  • if nothing is armed, it arms exit
  • if anything is already armed, it cancels it

exit closes only this session. suspend, shutdown, and reboot are shared by every session of this user: the action runs once, after every session that is currently in an agent run has finished. A session that is sitting idle does not hold it up. Arming one while nothing is running still waits for the next agent run, then runs only if no other session is in a run at that point.

Shared state lives in a per-user folder under the OS temp directory (os.tmpdir()), so it works on Linux, macOS, and Windows. The selected action is one-shot.

Install with Pi

pi install git:github.com/USER/pi-exit-when-done

Install with Oh My Pi

omp plugin install github:USER/pi-exit-when-done

Suspend, shutdown, and reboot use systemctl. They run from the session that notices every running session has finished, including when the last busy session quits.