pi-ext-clear

pi extension: /clear — clear the terminal and start a new session

Packages

Package details

extension

Install pi-ext-clear from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-ext-clear
Package
pi-ext-clear
Version
1.0.1
Published
Sep 4, 2026
Downloads
296/mo · 16/wk
Author
lu-zhengda
License
MIT
Types
extension
Size
2.2 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "extensions"
  ]
}

Security note

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

README

/clear — pi extension

Clear the terminal and start a new session with one command.

Install

pi install npm:pi-ext-clear

(or restart pi, or run /reload, after installing)

Usage

In pi's TUI, type:

/clear

What it does:

  • Clears the terminal screen (and scrollback where the terminal supports \x1b[3J — kitty, iTerm2, WezTerm).
  • Starts a new session, like the built-in /new.

How it works

Uses ctx.ui.custom() only to reach pi's real terminal sink so it never writes raw ANSI past the TUI's renderer, then calls ctx.newSession().

Source

https://github.com/lu-zhengda/pi-extensions/tree/main/clear