pi-zellij
v0.4.0
Published
Pi package with zellij-powered terminal integrations
Maintainers
Readme
pi-zellij
Pi package with zellij-powered terminal integrations for Pi.
Why
Pi works well in the terminal, but pane orchestration is better handled by a terminal multiplexer. pi-zellij adds zellij-native split workflows for Pi.
It includes split and tab commands, generic tool launchers, settings-driven floating app shortcuts, zoxide jumps, review workflows, and split-based task handoff.
Usage
Install with pi:
pi install npm:pi-zellijOr with the installer:
npx pi-zellijIf pi is already running, use:
/reloadRequirements
zellijmust be installed- pane, tab, and floating commands must be run from inside an active zellij session
zoxideis required for the zoxide commands
Feature overview
Pane and tab workflows
/zv,/zj,/zt- start a fresh Pi session in a new right pane, lower pane, or tab
/zo <command...>,/zoh <command...>- run any shell command in a new right pane or lower pane
/zz <query>,/zzh <query>- jump to a zoxide match or direct directory path and start Pi there
Floating tools
pi-zellij.commandsinsettings.json- registers floating app shortcuts such as
/zhforhxor/zgforlazygit
- registers floating app shortcuts such as
Review and handoff workflows
/zcv,/zch- open continuation sessions in a split, optionally in a new git worktree
/review <target>,/review-diff [focus-or-pr-url]- expand bundled review prompts in the current pane
/zrv,/zrh, plus review flags- open review-focused Pi sessions in a split
/skill:code-review- loads the bundled structured review skill for files, directories, diffs, and PRs
Bundled extensions and resources
Extensions:
zv-splitzv-openzv-zoxidezv-reviewzv-continue
Other bundled resources:
code-reviewskill/reviewprompt template/review-diffprompt template
Commands
Split and tab commands
/zv- opens a new pane to the right
- starts a fresh
pisession in the samecwd
/zj- opens a new pane below
- starts a fresh
pisession in the samecwd
/zt- opens a new zellij tab
- starts a fresh
pisession in the samecwd
All three commands also accept optional initial prompt text.
Examples:
/zv Review the auth flow in this repo
/zt Investigate flaky tests in this repoTool split commands
/zo <command...>- opens a new pane to the right
- runs the given shell command in the same
cwd
/zoh <command...>- opens a new pane below
- runs the given shell command in the same
cwd
Examples:
/zo hx
/zo npm test
/zoh npm run dev
/zo watch -n 1 git status --shortCommands are executed via sh -lc in the current project directory.
Configured floating commands
You can register your own floating app shortcuts in Pi's main settings file under pi-zellij.commands.
Supported locations:
~/.pi/agent/settings.jsonfor global commands.pi/settings.jsonfor project-local commands
During the rename from pi-zv to pi-zellij, legacy pi-zv.commands is still accepted for compatibility. If both keys exist, pi-zellij.commands wins.
Simple form:
{
"pi-zellij": {
"commands": {
"zh": "hx",
"zg": "lazygit"
}
}
}Each configured command opens in a floating zellij pane using a default 90% by 90% popup with 5% margins.
Examples:
/zh
/zgFor commands that should accept extra arguments, use the object form.
Helix and lazygit example:
{
"pi-zellij": {
"commands": {
"zh": {
"run": "hx",
"acceptArgs": true,
"description": "Open Helix in a floating pane"
},
"zg": {
"run": "lazygit",
"description": "Open lazygit in a floating pane"
}
}
}
}Then you can use:
/zh
/zh src/auth.ts
/zgConfigured command names cannot reuse built-in Pi commands such as /settings, /model, or /reload, and they also cannot replace pi-zellij's own slash commands such as /zv, /zj, /zt, /zz, or /zcv.
If the same command exists in both global and project settings, the project setting wins. After changing settings, run /reload in Pi.
Zoxide jump commands
/zz <query>- resolves the query with
zoxide query - opens a new pane to the right
- starts a fresh pi session in the matched directory
- resolves the query with
/zzh <query>- resolves the query with
zoxide query - opens a new pane below
- starts a fresh pi session in the matched directory
- resolves the query with
Example:
/zz monoIf the argument is already a valid directory path, /zz and /zzh use it directly instead of querying zoxide.
Continuation and worktree helpers
/zcv- opens a new pane to the right
- creates a related handoff session in the current checkout
/zch- opens a new pane below
- creates a related handoff session in the current checkout
/zcv <note>//zch <note>- same as above, but adds a focus note to the handoff context
/zcv -c <branch>//zch -c <branch>- creates a new branch worktree from the current
HEAD, then opens a new pane there
- creates a new branch worktree from the current
/zcv -c <branch> --from <ref>//zch -c <branch> --from <ref>- creates a new branch worktree from an explicit base ref such as
mainororigin/main
- creates a new branch worktree from an explicit base ref such as
/zcv -c <branch> [--from <ref>] <note...>//zch -c <branch> [--from <ref>] <note...>- same as above, but also adds a focus note to the worktree handoff
Examples:
/zcv
/zcv focus on tests
/zcv -c fix/notify-bug
/zcv -c fix/notify-bug --from main
/zcv -c fix/notify-bug --from main review the existing changes first
/zch -c feature/review-ui focus on edge casesReview helpers
pi-zellij also bundles a reusable code-review skill plus prompt templates for in-place review:
/review <target>- prompt template for reviewing a file, directory, or GitHub pull request URL in the current pane
/review-diff [focus-or-pr-url]- prompt template for reviewing the current git diff in the current pane, or a GitHub pull request URL via
gh
- prompt template for reviewing the current git diff in the current pane, or a GitHub pull request URL via
Split review commands:
/zrv- with no arguments, reviews the current git diff in a new right pane
/zrh- with no arguments, reviews the current git diff in a new lower pane
/zrv [--bugs|--refactor|--tests] <target>or/zrv --diff [focus]- opens a new pane to the right
- starts a fresh pi review session in the same
cwd
/zrh [--bugs|--refactor|--tests] <target>or/zrh --diff [focus]- opens a new pane below
- starts a fresh pi review session in the same
cwd
--diff is the default, so /zrv and /zrh usually do not need the flag.
There are no /review-v or /review-h aliases in pi-zellij, so it can coexist more cleanly with other Pi packages.
Examples:
/zrv
/zrh
/zrv src/auth.ts
/zrv --bugs src/auth.ts
/zrh --refactor src/auth/
/zrv --diff
/zrh --diff focus on token refresh and retries
/zrv https://github.com/owner/repo/pull/123If the target is a GitHub pull request URL, the review workflow switches to PR review and instructs pi to inspect the pull request with gh pr view and gh pr diff.
