Visitar URL original
GitHub - Acelogic/pi-cd: Pi extension that adds /cd <path> to switch the session's working directory without restarting pi, preserving conversation history. · GitHub
Skip to content
AcelogicPublic

About

Pi extension that adds /cd <path> to switch the session's working directory without restarting pi, preserving conversation history.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

pi-cd

A pi extension that adds a /cd <path> command for switching the session's working directory without leaving pi.

pi normally fixes cwd at session creation; built-in bash cd only affects subprocesses. This extension forks the current session into the target directory (via SessionManager.forkFrom + ctx.switchSession), so conversation history is preserved.

Usage

Inside pi:

/cd ~/Developer/some-project
/cd ../sibling
/cd /absolute/path
/cd -            # back to previous directory
/cd              # home ($HOME)

Tab completion offers matching directories.

Install

pi install git:github.com/Acelogic/pi-cd

Update

pi update git:github.com/Acelogic/pi-cd

Then /reload inside pi.

Caveats

  • Switching sessions replays the conversation in the new session — there's a brief reload.
  • Session files live in the session dir determined by pi; a forked session is a new file in that directory (not an edit of the old one). Your original session is preserved and can be resumed via pi --resume.
  • Symlinks are resolved via fs.realpathSync.native to match how pi records cwd.

About

Pi extension that adds /cd <path> to switch the session's working directory without restarting pi, preserving conversation history.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages