pi-sync
Sync pi agent config between hosts over rsync, using your existing ssh config
for routing (so ~/.ssh/config aliases just work).
pi-sync tinfoil # push config + extensions
pi-sync --config laptop # only models.json and settings.json
pi-sync --pull --all tinfoil # fetch the host's config back
pi-sync --dry-run --all a b # preview against two hosts
Install
# the PyPI package is pi-sync-cli; it installs the `pi-sync` command
pipx install pi-sync-cli
pipx install git+ssh://git@github.com/say4n/pi-sync # from source (needs access)
Requires Python 3.10+. uv tool install works in place of pipx install.
What syncs
Only the declarative parts of the agent dir:
| Group | Files |
|---|---|
--config |
models.json, settings.json |
--extensions |
extensions/ |
--auth |
auth.json — secrets, opt-in, warns on push |
--all is --config + --extensions (also the default when no flag is given).
Host-local state is deliberately never touched: sessions/, npm/,
models-store.json (regenerated from the pi.dev catalog), ayu/, bin/,
trust.json.
Flags
| Flag | Effect |
|---|---|
--all / --config / --extensions / --auth |
what to sync |
--pull |
host → local instead of local → host |
--delete |
mirror extensions/ exactly (deletes extras on the destination) |
--dry-run |
report changes, copy nothing |
-x, --exclude PATTERN |
skip matching files (repeatable) |
--local-dir |
default $PI_CODING_AGENT_DIR or ~/.pi/agent |
--remote-dir |
default ~/.pi/agent |
-v / --verbose |
print each rsync command and its output |
Multiple hosts are accepted: pi-sync a b c. Exits non-zero if any host is
unreachable or any transfer fails.
Caveats
settings.jsonis machine-written by pi (lastChangelogVersionbumps, UI toggles), so two hosts pushing it will overwrite each other's local preferences. Sync it when you changepackages, not reflexively.- Extensions that write runtime files inside their own directory (logs,
checkpoints) get those files synced too, and each host's copy is overwritten by
whichever side pushed last — exclude them with
-x '*/logs/*'. - Extension versions are whatever each host has installed; pin them in
settings.json(npm:pi-lens@1.2.3) if you need hosts identical. --authcopies API keys in the clear. PreferOPENCODE_API_KEY(and friends) in the environment where you can.- Remote paths go through the host's shell, so
~expands there as usual.
Development
uv sync
uv run pytest
uv run pi-sync --help
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pi_sync_cli-0.1.0.tar.gz.
File metadata
- Download URL: pi_sync_cli-0.1.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08204ccfdb8fabf81f6722367198ae6c73658b6d3062ca89685888e6e00bf156
|
|
| MD5 |
a4bb03e058c25bf74f4ec325eb384c18
|
|
| BLAKE2b-256 |
be45c02f0eb7cc44a0d93e633fca817090334a9f74220f9a6378e1fe81d638d4
|
File details
Details for the file pi_sync_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pi_sync_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6abcc1f2f98b085a0a267572f240dedd345c66bcacdcb4f9c40c02c8f8b885f4
|
|
| MD5 |
069d868946ce3efda2d74b6e9098f556
|
|
| BLAKE2b-256 |
1e44dd80439e0b9b371f8c18cbbedd75fe87507542cd18d55708a4079a2bdaff
|