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

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 |
.github/agents/ |
- |
| Gemini CLI | GEMINI.md |
.gemini/commands/ |
.gemini/skills/ |
| Cursor | AGENTS.md |
.cursor/commands/ |
.cursor/skills/ |
| VS Code | AGENTS.md (or .vscode/*) |
.vscode/ |
- |
| OpenCode | AGENTS.md |
.opencode/command/ |
.opencode/skill/ |
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 - 🖥️ Cross-platform - Linux, macOS, Windows
- 🚀 CI-friendly - Gracefully skips when binary unavailable
- ⚡ Fast - Single static binary, no runtime dependencies
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
# Using npm
# Using pnpm
# Using yarn (Classic v1)
# Using bun
One-off Execution
If you want to run AgentSync without a permanent global installation:
# Using npx (npm)
# Using dlx (pnpm)
# Using dlx (yarn v2+)
# Using bunx (bun)
Local Installation (Dev Dependency)
# Using npm
# Using pnpm
# Using yarn
# Using bun
From crates.io (Rust)
If you have Rust installed, you can install AgentSync directly from crates.io:
From GitHub Releases (Pre-built Binaries)
Download the latest release for your platform from the GitHub Releases page:
# macOS (Apple Silicon)
# macOS (Intel)
# Linux (x86_64)
# Linux (ARM64)
From Source (Requires Rust 1.89+)
Install directly from the GitHub repository:
Or clone and build manually:
# The binary will be available at ./target/release/agentsync
Quick Start
- Initialize configuration in your project:
This creates .agents/agentsync.toml with a default configuration.
-
Edit the configuration to match your needs (see Configuration)
-
Apply the configuration:
- Add to your project setup (e.g.,
package.json):
Usage
# Initialize a new configuration
# Apply configuration (create symlinks)
# Clean existing symlinks before applying
# Remove all managed symlinks
# Use a custom config file
# Dry run (show what would be done without making changes)
# Filter by agent
# Disable gitignore updates
# Verbose output
# Show version
# Manage skills
Status
Verify the state of symlinks managed by AgentSync. Useful for local verification and CI.
--project-root <path>: Optional. Path to the project root to locate the agentsync config.--json: Output machine-readable JSON (pretty-printed).
Exit codes: 0 = no problems, 1 = problems detected (CI-friendly)
Configuration
Configuration is stored in .agents/agentsync.toml:
# Source directory (relative to this config file)
= "."
# Gitignore management
[]
= true
= "AI Agent Symlinks"
= [
"CLAUDE.md",
"GEMINI.md",
".github/copilot-instructions.md",
]
# Agent definitions
[]
= true
= "Claude Code - Anthropic's AI coding assistant"
[]
= "AGENTS.md"
= "CLAUDE.md"
= "symlink"
[]
= "command"
= ".claude/commands"
= "symlink-contents"
= "*.agent.md"
MCP Support (Model Context Protocol)
AgentSync can automatically generate MCP configuration files for supported agents (Claude Code, GitHub Copilot, 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.
[]
= true
# Strategy for existing files: "merge" (default) or "overwrite"
# "merge" preserves existing servers but overwrites conflicts with TOML config
= "merge"
# Define servers once
[]
= "npx"
= ["-y", "@modelcontextprotocol/server-filesystem", "."]
[]
= "npx"
= ["-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 —
.copilot/mcp-config.json(agent id:copilot) - Gemini CLI —
.gemini/settings.json(agent id:gemini) — AgentSync will addtrust: truewhen generating Gemini configs. - Cursor —
.cursor/mcp.json(agent id:cursor) - VS Code —
.vscode/mcp.json(agent id:vscode) - OpenCode —
opencode.json(agent id:opencode)
See website/docs/src/content/docs/guides/mcp.mdx for formatter details and merge behavior.
Merge Behavior
When merge_strategy = "merge":
- AgentSync reads the existing config file (if it exists).
- It adds servers defined in
agentsync.toml. - Conflict Resolution: If a server name exists in both, the definition in
agentsync.tomlwins and overwrites the existing one. - Existing servers NOT in
agentsync.tomlare preserved.
Target Types
| Type | Description |
|---|---|
symlink |
Create a symlink to the source file/directory |
symlink-contents |
Create symlinks for each file in the source directory |
The symlink-contents type optionally supports a pattern field (glob pattern like *.md) to
filter which files to link.
Project Structure
.agents/
├── agentsync.toml # Configuration file
├── AGENTS.md # Main agent instructions (single source)
├── .mcp.json # MCP server configurations
├── command/ # Agent commands
│ ├── review.agent.md
│ └── test.agent.md
├── skills/ # Shared knowledge/skills
│ └── kotlin/
│ └── SKILL.md
└── prompts/ # Reusable prompts
└── code-review.prompt.md
After running agentsync apply:
project-root/
├── CLAUDE.md → .agents/AGENTS.md
├── GEMINI.md → .agents/AGENTS.md
├── AGENTS.md → .agents/AGENTS.md
├── .mcp.json → .agents/.mcp.json
├── .claude/
│ └── commands/ → symlinks to .agents/command/*.agent.md
├── .gemini/
│ └── commands/ → symlinks to .agents/command/*.agent.md
└── .github/
├── copilot-instructions.md → .agents/AGENTS.md
└── agents/ → symlinks to .agents/command/*.agent.md
CI/CD Integration
AgentSync gracefully handles CI environments where the binary isn't available:
The symlinks are primarily for local development. CI builds typically don't need them.
Installing in CI
If you need agentsync in CI, add it to your workflow:
- name: Install agentsync
run: |
curl -LO https://github.com/dallay/agentsync/releases/latest/download/agentsync-x86_64-unknown-linux-gnu.tar.gz
tar xzf agentsync-x86_64-unknown-linux-gnu.tar.gz
sudo mv agentsync-*/agentsync /usr/local/bin/
Getting Started (Development)
This project is a monorepo containing a Rust core and a JavaScript/TypeScript wrapper.
Repository Structure
src/: Core logic and CLI implementation in Rust.npm/agentsync/: TypeScript wrapper used for NPM distribution.website/docs/: Documentation site built with Starlight.tests/: Integration tests for the CLI.
Prerequisites
Setup
-
Install JavaScript dependencies:
-
Build the Rust binary:
Common Commands
This project uses a Makefile to orchestrate common tasks.
-
Run Rust tests:
-
Run JavaScript tests:
-
Build all components:
-
Format the code:
Troubleshooting
PNPM_NO_MATURE_MATCHING_VERSION
If pnpm install fails with this error, it's likely due to a strict package release age policy. You can try installing with --ignore-scripts or wait for the package to "mature" in the registry.
Lefthook installation failure
If pnpm install fails during the lefthook setup, you can try:
Symlink creation fails on Windows
Ensure you have Developer Mode enabled or run your terminal as Administrator, as Windows requires special permissions for creating symbolic links.
Inspiration
- Ruler - Similar concept but copies files instead of using symlinks
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
License
MIT License - see LICENSE for details.