ag-sync syncs Codex agent assets between a local repo and the live ~/.codex runtime directories.
It is intentionally narrower than skillz: this project only handles native file assets for agents and automations. Skills are out of scope for now.
ag-sync init
ag-sync sync
ag-sync import
ag-sync sync --watchcd /path/to/ag-sync-repo
ag-sync initinit creates ag-sync.json, ensures local agents/ and automations/ directories exist, and imports the current live assets from ~/.codex/agents and ~/.codex/automations.
After that, edit the local files and push them back to the live runtime with:
ag-sync syncIf the live runtime gains new files that are not yet in the repo, pull them back into the first configured source root with:
ag-sync importTo keep the live runtime updated while you edit:
ag-sync sync --watchag-sync reads ag-sync.json from the current working directory.
{
"version": "1.0",
"agentDestDir": [
{
"path": "~/.codex/agents",
"deleteExistingFromDest": true
}
],
"agentSourceDir": [
{
"path": "./agents"
}
],
"automationDestDir": [
{
"path": "~/.codex/automations",
"deleteExistingFromDest": true
}
],
"automationSourceDir": [
{
"path": "./automations"
}
],
"denyList": []
}agentSourceDirandautomationSourceDirare ordered overlays. Later directories win when the same relative path appears more than once.deleteExistingFromDestclears the destination root before the merged snapshot is copied.agentDestDirandautomationDestDirmust not overlap or nest inside each other.denyListapplies glob patterns across both asset families.- Sync is one-way from source directories into destination directories.
importis non-destructive: it only copies destination files whose relative paths are missing from the merged source snapshot.importwrites into the first configured source root for each asset family.importfails before writing if the same new relative path exists in multiple destination roots or if the target source tree has a file-vs-directory collision.
pnpm install
pnpm build
pnpm test
pnpm precommitGitHub Actions runs the same pnpm precommit gate on pushes and pull requests and fails if the command rewrites tracked files.