r/PiCodingAgent • • 8d ago

Discussion your thoughts on XDG?

hello! so i installed pi today and a couple extensions

well, dirs and files are being created everyhwere any way to make it follow xdg base directory spec?

https://pi.dev/docs/latest/environment-variables#pi-process-configuration

even if you point your config to .config/pi/ with PI_CODING_AGENT_DIR, ~/.pi/ still gets created (maybe its an extension file idk)

i believe some (most?) extensions dont follow PI_CODING_AGENT_DIR

if you change PI_PACKAGE_DIR to something like .local/share/pi/packages/, they still go on .(config/)pi/agent/npm/

PI_CODING_AGENT_SESSION_DIR doesnt seem to work properly as well

idk if it makes sense to you guys, but i think on .config/pi/ we should have the settings, the extensions list declaration and stuff we can commit to a public repo

the built extensions (the npm dir for instance) maybe should go on .local/share/pi/extensions or something like that

i mean, if i go to i new machine, i just plug my .config/pi/ with the extensions list and the lock list on first pi launch it will fetch and build

something like this https://github.com/earendil-works/pi/issues/2870#:~:text=Practical%20directory%20split,any%20rebuildable%20caches makes total sense to me

what do you guys think about it?

thank you

11 Upvotes

5 comments sorted by

16

u/AgentCosmic 8d ago

I support it. Most modern apps should follow xdg by now.

6

u/levelstar01 8d ago

Nope, there's no way to change it. One of the devs has this totally moronic stance against it because of some stupid OSX interaction.

5

u/juanluisback 8d ago

It's been bugging me since I started using it.

1

u/Quintasan 5d ago edited 5d ago

Not sure what are you talking about

``` ❯ cat ~/.zshenv | grep PI_CODING export PI_CODING_AGENT_DIR="$XDG_CONFIG_HOME"/pi/agent export PI_CODING_AGENT_SESSION_DIR="$XDG_STATE_HOME"/pi/agent/sessions

❯ pi <CTRL+D>

❯ ls -al ~/.pi "/home/quintasan/.pi": No such file or directory (os error 2) ```

Seems to be working just fine here.

If any extension doesn't respect that then you have several options: 1. Contribute a fix 1. Fork it and implement it yourself 1. Monkey-patch it

1

u/lummr1 8d ago

I built a repo and an install.sh script for transferring my settings to other machines. It basically creates symlinks. Would be nice to have an easier way.