# Agentsync

> A fast, portable CLI tool for synchronizing AI agent configurations across multiple AI coding assistants using symbolic links.

- **Type:** MCP server
- **Install:** `agentstack add mcp-dallay-agentsync`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dallay](https://agentstack.voostack.com/s/dallay)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dallay](https://github.com/dallay)
- **Source:** https://github.com/dallay/agentsync
- **Website:** https://dallay.github.io/agentsync/

## Install

```sh
agentstack add mcp-dallay-agentsync
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# AgentSync

[](https://github.com/dallay/agentsync/actions/workflows/ci.yml)
[](https://github.com/dallay/agentsync/actions/workflows/release.yml)
[](https://github.com/dallay/agentsync/actions/workflows/catalog-e2e.yml)
[](https://opensource.org/licenses/MIT)
[](https://github.com/dallay/agentsync/releases)
[](https://codecov.io/gh/dallay/agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)
[](https://sonarcloud.io/summary/new_code?id=dallay_agentsync)

A fast, portable CLI tool for synchronizing AI agent configurations and MCP servers across multiple
AI coding assistants using symbolic links.

**How AgentSync works at a glance:** many AI tools expect different config locations, so AgentSync turns `.agents/` into one source of truth and syncs it everywhere.

```mermaid
flowchart LR
    subgraph Problem[Problem: fragmented AI tool setup]
        Claude[Claude Code]
        Gemini[Gemini CLI]
        Cursor[Cursor]
        Copilot[GitHub Copilot]
        Codex[OpenAI Codex]
        OpenCode[OpenCode]
    end

    Chaos[Scattered config filesDuplication and drift]
    Source[.agents/Single source of truth]
    Sync[AgentSyncRust CLI + npm wrapper]
    Output[Symlinks + MCP configfor each assistant]
    Result[Update onceSync everywhere]

    Claude --> Chaos
    Gemini --> Chaos
    Cursor --> Chaos
    Copilot --> Chaos
    Codex --> Chaos
    OpenCode --> Chaos

    Chaos -->|replace with| Source
    Source --> Sync
    Sync --> Output
    Output --> Result

    classDef tools fill:#fff7ed,stroke:#f97316,color:#7c2d12,stroke-width:1px;
    classDef pain fill:#fef2f2,stroke:#ef4444,color:#7f1d1d,stroke-width:1px;
    classDef core fill:#eff6ff,stroke:#2563eb,color:#1e3a8a,stroke-width:1px;
    classDef success fill:#ecfdf5,stroke:#22c55e,color:#14532d,stroke-width:1px;

    class Claude,Gemini,Cursor,Copilot,Codex,OpenCode tools;
    class Chaos pain;
    class Source,Sync,Output core;
    class Result success;
```

### Typical workflow

```mermaid
flowchart LR
    Init[agentsync initCreate or migrate config] --> Apply[agentsync applyCreate or refresh symlinks]
    Apply --> Status[agentsync statusInspect sync state]
    Status --> Skill[agentsync skill ...Manage installed skills]

    classDef action fill:#f8fafc,stroke:#475569,color:#0f172a,stroke-width:1px;
    class Init,Apply,Status,Skill action;
```

## Why AgentSync?

Different AI coding tools expect configuration files in various locations:

| Tool               | Instructions                      | Commands             | Skills             |
|--------------------|-----------------------------------|----------------------|--------------------|
| **Claude Code**    | `CLAUDE.md`                       | `.claude/commands/`  | `.claude/skills/`  |
| **GitHub Copilot** | `.github/copilot-instructions.md` | -                    | -                  |
| **Gemini CLI**     | `GEMINI.md`                       | `.gemini/commands/`  | `.gemini/skills/`  |
| **Cursor**         | `.cursor/rules/agentsync.mdc`     | -                    | `.cursor/skills/`  |
| **VS Code**        | -                                 | -                    | -                  |
| **OpenCode**       | `AGENTS.md`                       | `.opencode/command/` | `.opencode/skills/` |
| **OpenAI Codex**   | `AGENTS.md`                       | -                    | `.codex/skills/`   |

AgentSync maintains a **single source of truth** in `.agents/` and creates symlinks to all required
locations.

## Features

- 🔗 **Symlinks over copies** - Changes propagate instantly
- 📝 **TOML configuration** - Human-readable, easy to maintain
- 📋 **Gitignore management** - Automatically updates `.gitignore`
- 🛡️ **Safe** - Automatically backs up existing files before replacing them
- 🖥️ **Cross-platform** - Linux, macOS, Windows
- 🚀 **CI-friendly** - Gracefully skips when binary unavailable
- ⚡ **Fast** - Single static binary, no runtime dependencies
- 🧩 **Curated skills** - Install from the [dallay/agents-skills](https://github.com/dallay/agents-skills) collection or external providers

### Catalog validation

AgentSync ships a full catalog installation E2E check that validates every skill entry can still be
resolved, installed, and registered correctly.

- GitHub Actions workflow: `Catalog E2E`
- Manual run: Actions → **Catalog E2E** → **Run workflow**
- Scheduled run: every Monday at 08:00 UTC
- Local run:

```bash
git clone https://github.com/dallay/agents-skills ../agents-skills
export AGENTSYNC_LOCAL_SKILLS_REPO="$(pwd)/../agents-skills"
RUN_E2E=1 cargo test --test test_catalog_integration -- --ignored --nocapture
```

If you already keep `agents-skills` as a sibling checkout next to this repository, you can skip the
environment variable and let the test auto-discover that sibling path instead.

This check is intentionally separate from normal CI because it depends on external networks and
third-party skill repositories.

## Installation

### Node.js Package Managers (Recommended)

If you have Node.js (>=18) installed, the easiest way to install AgentSync is through a package manager.

#### Global Installation

```bash
# Using npm
npm install -g @dallay/agentsync

# Using pnpm
pnpm add -g @dallay/agentsync

# Using yarn (Classic v1)
yarn global add @dallay/agentsync

# Using bun
bun i -g @dallay/agentsync
```

#### One-off Execution

If you want to run AgentSync without a permanent global installation:

```bash
# Using npx (npm)
npx @dallay/agentsync apply

# Using dlx (pnpm)
pnpm dlx @dallay/agentsync apply

# Using dlx (yarn v2+)
yarn dlx @dallay/agentsync apply

# Using bunx (bun)
bunx @dallay/agentsync apply
```

#### Local Installation (Dev Dependency)

```bash
# Using npm
npm install --save-dev @dallay/agentsync

# Using pnpm
pnpm add -D @dallay/agentsync

# Using yarn
yarn add -D @dallay/agentsync

# Using bun
bun add -d @dallay/agentsync
```

### From crates.io (Rust)

If you have Rust installed, you can install AgentSync directly from [crates.io](https://crates.io/crates/agentsync):

```bash
cargo install agentsync
```

### From GitHub Releases (Pre-built Binaries)

Visit the [GitHub Releases](https://github.com/dallay/agentsync/releases) page to find the latest version number and correct platform identifier for your system.

To install via terminal, you can use the following script (be sure to replace the `` placeholder with a real tag, e.g., `1.28.0`):

```bash
# Define version and platform
VERSION=""
# Detect architecture (macOS)
PLATFORM=$([ "$(uname -m)" = "arm64" ] && echo "aarch64-apple-darwin" || echo "x86_64-apple-darwin")
# Or specify manually for Linux, e.g., x86_64-unknown-linux-gnu
# PLATFORM="x86_64-unknown-linux-gnu"
TARBALL="agentsync-${VERSION}-${PLATFORM}.tar.gz"

# Download binary and checksum
curl -LO "https://github.com/dallay/agentsync/releases/download/v${VERSION}/${TARBALL}"
curl -LO "https://github.com/dallay/agentsync/releases/download/v${VERSION}/${TARBALL}.sha256"

# Verify integrity
if command -v sha256sum >/dev/null; then
  sha256sum --check "${TARBALL}.sha256"
else
  shasum -a 256 --check "${TARBALL}.sha256"
fi

if [ $? -ne 0 ]; then
  echo "Error: Checksum verification failed!"
  exit 1
fi

# Extract and install
tar xzf "${TARBALL}"
sudo mv agentsync-*/agentsync /usr/local/bin/
```

### From Source (Requires Rust 1.89+)

Install directly from the GitHub repository (requires Node.js 22.22.0+ and Rust 1.89+):

```bash
cargo install --git https://github.com/dallay/agentsync
```

Or clone and build manually:

```bash
git clone https://github.com/dallay/agentsync
cd agentsync
cargo build --release

# The binary will be available at ./target/release/agentsync

```

## Quick Start

### New Projects

1. **Initialize configuration** in your project:

```bash
cd your-project
agentsync init
```

This creates `.agents/agentsync.toml` with a default configuration.

### Existing Projects with Agent Files

If you already have agent configuration files scattered across your project (like `CLAUDE.md`, `.cursor/`, or `.github/copilot-instructions.md`), use the interactive wizard:

```bash
cd your-project
agentsync init --wizard
```

The wizard will scan for existing files, let you select which to migrate, and set up everything automatically.

---

1. **Edit the configuration** to match your needs (see [Configuration](#configuration))

2. **Apply the configuration**:

```bash
agentsync apply
```

1. **Add to your project setup** (e.g., `package.json`):

```json
{
  "scripts": {
    "prepare": "agentsync apply || true"
  }
}
```

### Team workflow note

AgentSync defaults to managed `.gitignore` mode (`[gitignore].enabled = true`), which is the recommended starting point for most teams. If your team intentionally wants to commit AgentSync-managed destinations instead, treat `[gitignore].enabled = false` as an explicit opt-out workflow. See the canonical guide: 

If you run AgentSync from Windows and need native symlink prerequisites, WSL guidance, or recovery steps, use the dedicated setup guide: 

If your team wants `agentsync apply` to run after branch switches, merges, or rebases, use the Git hook automation guide for Lefthook, Husky, simple-git-hooks, and native hook examples: 

## Usage

```bash
# Initialize a new configuration
agentsync init

# Initialize with interactive wizard (for existing projects with agent files)
agentsync init --wizard

# Apply configuration (create symlinks)
agentsync apply

# Clean existing symlinks before applying
agentsync apply --clean

# Remove all managed symlinks
agentsync clean

# Use a custom config file
agentsync apply --config /path/to/config.toml

# Dry run (show what would be done without making changes)
agentsync apply --dry-run

# Skip gitignore reconciliation for this run only
agentsync apply --no-gitignore

# Filter by agent
agentsync apply --agents claude,copilot

# Verbose output
agentsync apply --verbose

# Show status of managed symlinks
agentsync status

# Run diagnostic and health check
agentsync doctor [--project-root ]

# Manage skills
agentsync skill install 
agentsync skill update 
agentsync skill uninstall 
```

### Status

Verify the state of AgentSync-managed targets. Useful for local verification and CI.

```bash
agentsync status [--project-root ] [--json]
```

- `--project-root `: Optional. Path to the project root to locate the agentsync config.
- `--json`: Output machine-readable JSON (pretty-printed).

`status` is sync-type aware:

- `symlink` targets are checked as one managed destination symlink.
- `symlink-contents` targets are checked as destination directories whose managed child entries are the symlinks.
- An existing empty `.agents/commands/` source directory is valid, so an empty destination like `.claude/commands/` is not reported as missing or "not a symlink" just because it currently has `0` managed entries.

Exit codes: 0 = no problems, 1 = problems detected (CI-friendly)

## Configuration

Configuration is stored in `.agents/agentsync.toml`:

```toml
# Source directory (relative to this config file)
source_dir = "."

# Optional: compress AGENTS.md and point symlinks to the compressed file
# compress_agents_md = false

# Default agents to run when --agents is not specified.
# If empty, all enabled agents will be processed.
default_agents = ["claude", "copilot"]

# Gitignore management
[gitignore]
enabled = true
marker = "AI Agent Symlinks"
# Additional entries to add to .gitignore (target destinations are added automatically)
entries = []

# Agent definitions
[agents.claude]
enabled = true
description = "Claude Code - Anthropic's AI coding assistant"

[agents.claude.targets.instructions]
source = "AGENTS.md"
destination = "CLAUDE.md"
type = "symlink"

[agents.claude.targets.commands]
source = "commands"
destination = ".claude/commands"
type = "symlink-contents"
pattern = "*.agent.md"
```

### MCP Support (Model Context Protocol)

AgentSync can automatically generate MCP configuration files for supported agents (Claude Code,
GitHub Copilot, OpenAI Codex CLI, Gemini CLI, Cursor, VS Code, OpenCode).

This allows you to define MCP servers once in `agentsync.toml` and have them synchronized to all
agent-specific config files.

```toml
[mcp]
enabled = true

# Strategy for existing files: "merge" (default) or "overwrite"
# "merge" preserves existing servers but overwrites conflicts with TOML config
merge_strategy = "merge"

# Define servers once
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "."]

[mcp_servers.git]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-git", "--repository", "."]

# Optional fields:
# env = { "KEY" = "VALUE" }
# disabled = false
```

#### Supported Agents (canonical)

AgentSync supports the following agents and will synchronize corresponding files/locations. This list is canonical — keep it in sync with `src/mcp.rs` (authoritative).

- **Claude Code** — `.mcp.json` (agent id: `claude`)
- **GitHub Copilot** — `.vscode/mcp.json` (agent id: `copilot`)
- **OpenAI Codex CLI** — `.codex/config.toml` (agent id: `codex`) — TOML format with `[mcp_servers.]` tables. AgentSync maps `headers` to Codex `http_headers`.
- **Gemini CLI** — `.gemini/settings.json` (agent id: `gemini`) — AgentSync will add `trust: true` when generating Gemini configs.
- **Cursor** — `.cursor/mcp.json` (agent id: `cursor`)
- **VS Code** — `.vscode/mcp.json` (agent id: `vscode`)
- **OpenCode** — `opencode.json` (agent id: `opencode`)

AgentSync also supports 32+ agents (7 native MCP agents and 25+ configurable agents) including Windsurf, Cline, Amazon Q, Aider, RooCode, Trae, and more. See the [full list in the documentation](https://dallay.github.io/agentsync/reference/configuration/).

See the [MCP Integration Guide](https://dallay.github.io/agentsync/guides/mcp/) for formatter details and merge behavior.

#### Merge Behavior

When `merge_strategy = "merge"`:

1. AgentSync reads the existing config file (if it exists).
2. It adds servers defined in `agentsync.toml`.
3. **Conflict Resolution**: If a server name exists in both, the definition in `agentsync.toml` **wins** and overwrites the existing one.
4. Existing servers NOT in `agentsync.toml` are preserved.

### Target Types

| Type               | Description                                                   |
|--------------------|---------------------------------------------------------------|
| `symlink`          | Create a symlink to the source file/directory                 |
| `symlink-contents` | Create symlinks for each item in the source directory         |
| `nested-glob`      | Recursively discover files and create symlinks for each match |
| `module-map`       | Map centrally-managed source files to module directories      |

The `symlink-contents` type optionally supports a `pattern` field (glob pattern like `*.md`) to
filter which items to link. AgentSync treats the destination as a managed directory container, so
`agentsync status` validates the child links inside that directory instead of expecting the
directory itself to be a symlink.

#### Nested Glob Target (`nested-glob`)

The `nested-glob` type discovers files matching a recursive glob pattern and creates a symlink
for each discovered file.  This is ideal for **monorepos and multi-module projects** where
different subdirectories contain their own `AGENTS.md` files.

```toml
[agents.claude.targets.nested]
# Root directory to se

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dallay](https://github.com/dallay)
- **Source:** [dallay/agentsync](https://github.com/dallay/agentsync)
- **License:** MIT
- **Homepage:** https://dallay.github.io/agentsync/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-dallay-agentsync
- Seller: https://agentstack.voostack.com/s/dallay
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
