Skip to main content

Self-contained AI config sync for Codex, Cursor, and Gemini.

Project description

ai-sync

ai-sync synchronizes shared AI tooling artifacts into a project-local setup for Codex, Cursor, and Gemini.

The current workflow is:

  1. Install ai-sync once on the machine.
  2. Write a project .ai-sync.yaml or .ai-sync.local.yaml.
  3. Run ai-sync plan.
  4. Run ai-sync apply [planfile].

License: PolyForm Noncommercial 1.0.0.

Install

End users

pipx install ai-sync

Local development

poetry sync --with dev

Poetry is configured to create an in-project .venv/, which is what the just tasks use.

Optional task runner:

brew install just
just install
just test

Machine bootstrap

install is the only machine-level setup step. It writes ~/.ai-sync/config.toml for auth/bootstrap settings such as the 1Password account identifier used by the CLI.

ai-sync install --op-account-identifier example.1password.com

The --op-account-identifier value must be a 1Password sign-in address such as example.1password.com or a 1Password user ID from op account list.

You can also authenticate with OP_SERVICE_ACCOUNT_TOKEN.

Project workflow

1. Write .ai-sync.yaml or .ai-sync.local.yaml

Projects declare their config sources explicitly and select resources by fully scoped ids.

Example:

sources:
  company:
    source: github.com/acme/company-ai-sync
    version: v1.2.0
  frontend:
    source: ../frontend-ai-sync

agents:
  - company/senior-software-engineer

skills:
  - company/code-review
  - frontend/react-review

commands:
  - company/session-summary.md

rules:
  - company/commit-conventions

mcp-servers:
  - company/context7

settings:
  mode: normal
  subagents: true

Notes:

  • .ai-sync.yaml is the shared project manifest.
  • .ai-sync.local.yaml is an optional local override. If it exists, ai-sync ignores .ai-sync.yaml entirely and uses the local file as the only project manifest.
  • Remote sources must be pinned with version.
  • Local path sources are allowed, but they are less portable than pinned remote sources.
  • If your local SSH setup needs a different Git host than the shared manifest uses, prefer a local Git URL rewrite over checking machine-specific hosts into .ai-sync.yaml. For example:
git config url."git@example-git-host:example-org/".insteadOf "git@github.com:example-org/"
  • Every selected resource must be scoped as <sourceAlias>/<resourceId>.

2. Run plan

plan resolves sources under the project, validates the selection, computes planned actions, and saves a plan artifact.

ai-sync plan

By default, the saved plan goes to .ai-sync/last-plan.yaml.

You can also choose an explicit output path:

ai-sync plan --out my-plan.yaml

3. Run apply

Use a reviewed plan:

ai-sync apply .ai-sync/last-plan.yaml

Or let ai-sync compute a fresh plan and execute it immediately:

ai-sync apply

The reviewed path is:

  1. ai-sync plan
  2. review the output / saved plan
  3. ai-sync apply <planfile>

Source repo layout

A source repo is a catalog of reusable artifacts:

<source>/
├── prompts/
├── skills/
├── commands/
├── rules/
├── mcp-servers/
│   └── <server-id>/
│       └── server.yaml
├── requirements.yaml
└── env.yaml

Resource ids

  • Agents come from prompts/<name>.md and are referenced as <alias>/<name>.
  • Skills come from skills/<name>/SKILL.md and are referenced as <alias>/<name>.
  • Commands come from commands/**/<name>.<ext> and are referenced as <alias>/<relative-path>.
  • Rules come from rules/<name>.md and are referenced as <alias>/<name>.
  • MCP servers come from mcp-servers/<server-id>/server.yaml and are referenced as <alias>/<server-id>.

Secrets

Secrets stay as references in source repos and project config. ai-sync resolves them locally and can generate a project-local .env.ai-sync file when needed.

Example env.yaml:

CONTEXT7_API_KEY:
  value: op://Example Vault/AI Tools/CONTEXT7_API_KEY
EXA_API_KEY:
  value: op://Example Vault/AI Tools/EXA_API_KEY
PUBLIC_CLIENT_ID:
  value: abc123
GITHUB_PAT:
  scope: local
  description: Personal GitHub PAT

Rules:

  • plan artifacts never store plaintext secret values
  • plans show secret-backed outputs in redacted form
  • apply fails if required secret values cannot be resolved

Project-local outputs

ai-sync manages project-local files such as:

  • AGENTS.generated.md
  • .codex/*
  • .cursor/*
  • .gemini/*
  • .env.ai-sync
  • .ai-sync/state/
  • .ai-sync/sources/
  • .ai-sync/last-plan.yaml

It does not modify machine-global client config under ~/.codex, ~/.cursor, or ~/.gemini.

When rules are selected, ai-sync writes the merged content to AGENTS.generated.md and maintains a small managed link block in AGENTS.md instead of replacing the whole file.

You should usually cover these paths and .ai-sync.local.yaml with .gitignore, but ai-sync no longer blocks plan or apply when they are not ignored.

Reliability rules

  • Remote sources must be pinned.
  • If two selected resources would write the same non-composable output, planning fails.
  • Saved plans are invalidated when the project config or resolved source fingerprints change.

Commands

ai-sync install
ai-sync plan
ai-sync apply [planfile]
ai-sync doctor
ai-sync uninstall [--apply]

Testing

python -m pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_sync-1.1.1.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_sync-1.1.1-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

Details for the file ai_sync-1.1.1.tar.gz.

File metadata

  • Download URL: ai_sync-1.1.1.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_sync-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8f4edb924196ab6798ddd07bd810af0d6ee4b861517123d2a3ed4b3fee0a76f5
MD5 e5814982db48c9ce873d4b7ddae34e71
BLAKE2b-256 ce0f97043fa8136197eb25bb2cf40217d4e62e4e7ae1874ad1e4d030803f7765

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_sync-1.1.1.tar.gz:

Publisher: release.yml on Ephasme/ai-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_sync-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ai_sync-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 57.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_sync-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 677a2f6d69fc8249d3d605c1f0b005862a3853df1fdf55b43dc6e58917b244e8
MD5 2705d5c1d528a5b8c937d3dfd2e90cd7
BLAKE2b-256 d139f3a69848d858ea6984ad8265fc5f0c5724d55ed613ded2da98b0ae7c8ef5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_sync-1.1.1-py3-none-any.whl:

Publisher: release.yml on Ephasme/ai-sync

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page