Skip to content

Honour PI_CODING_AGENT_DIR for the Pi theme and skills - #19621

Closed
ancientastronauttheorist wants to merge 4 commits into
omacom:quattrofrom
ancientastronauttheorist:pi-agent-dir
Closed

ancientastronauttheorist wants to merge 4 commits into
omacom:quattrofrom
ancientastronauttheorist:pi-agent-dir

Conversation

@ancientastronauttheorist

Copy link
Copy Markdown

What changes

Fixes #13691. When PI_CODING_AGENT_DIR points pi at a different config directory, Omarchy still wrote pi's theme and skill links into ~/.pi/agent, which pi never reads. Other Omarchy code already follows the variable (omarchy-agent-instructions, the omarchy-agent-usage-* collectors). These two places didn't:

  • omarchy-theme-set-pi writes the theme and the --activate setting into ${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}, expanding a leading ~ the way pi does.
  • omarchy-agent-skills-link links pi's skills into the same directory.

The theme half is #13693 by @manuaudio, which was verified and marked ready before it was closed to tidy the queue. Its three commits are cherry-picked here unchanged, keeping their authors. Only the test/cli context needed resolving, because a nearby claude-theme assertion has changed since. The skills half replaces #13836, which was closed in the belief that quattro already covered it. It doesn't: line 23 of omarchy-agent-skills-link hardcoded ~/.pi/agent/skills.

#16783, a larger refactor of skill linking into a registry, also makes pi's skills follow PI_CODING_AGENT_DIR. If it lands first, the last commit here can be dropped. The theme fix stands either way.

This leaves out omarchy-upgrade-to-quattro's one-time skill linking. It runs during the upgrade, and getting the variable into that environment is a separate question (see the bot's note on #13691).

Verification

  • ./test/cli passes, including the pi theme cases from Sync the Pi theme into PI_CODING_AGENT_DIR when it is set #13693: configured directory, ordinary sync and --activate, a leading ~, and the default directory left alone.
  • test/shell.d/provision-user-test.sh passes with a new case. With PI_CODING_AGENT_DIR="~/pi-work", pi's skills are linked into $HOME/pi-work/skills and ~/.pi isn't created. The case fails on quattro's omarchy-agent-skills-link (not ok - pi's skills are linked into PI_CODING_AGENT_DIR) and passes with this change.
  • The test now unsets PI_CODING_AGENT_DIR first, as agent-integrate-herdr-test.sh does, so a caller's own value can't send links outside the temporary home.
  • Not checked: a live pi session (1.6.0) loading the theme or skills from a moved directory. pi has no non-interactive way to list what it loaded, so I didn't drive the TUI. The paths match what pi --help documents for PI_CODING_AGENT_DIR ("Config directory (default: ~/.pi/agent)").

Screenshots

No visible change: it only changes where the pi theme file and skill links are written.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gr84VuXNHLdS8Sn11pRKL1

manuaudio and others added 4 commits November 20, 2026 21:18
omarchy-theme-set-pi always wrote to ~/.pi/agent, so on a machine that points pi elsewhere with PI_CODING_AGENT_DIR the theme and its settings landed where pi never looks. It now follows that variable, as the Claude and Hermes theme syncs follow CLAUDE_CONFIG_DIR and HERMES_HOME.

Fixes omacom#13691

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 01490dc)
pi resolves PI_CODING_AGENT_DIR through its own tilde expansion, so a value like ~/.config/pi set somewhere a shell never expands it is one pi reads from $HOME/.config/pi. The script took it literally: a theme switch found no such directory and skipped the sync, and the install-time --activate created a ~ directory under the working directory and themed that instead.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8559e78)
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

Pi theme files, activation settings, and skill links now follow PI_CODING_AGENT_DIR, including a leading ~.

  • Pi themes follow the configured agent directory.
  • Pi's Omarchy skill links follow the configured agent directory.

Reviews (1) · Last reviewed commit: "Link Pi's skills into PI_CODING_AGENT_DI..." · Reviewed by Greptile

@ancientastronauttheorist

Copy link
Copy Markdown
Author

Closing: I opened this too quickly. #13693 belongs to its author, and #16783 already covers the skills half. Sorry for the noise.

Filed by Claude Opus 5.5 via Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-theme-set-pi themes ~/.pi/agent even when PI_CODING_AGENT_DIR points elsewhere

3 participants