Skip to content

Development Guide

AgentSync is a mono-repo project that combines a high-performance Rust core with a TypeScript distribution layer. This guide covers the development workflow for both stacks.

  • 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.

The core logic is written in Rust for speed, safety, and easy distribution as a single binary.

  • Version: Rust 1.89+ (Edition 2024)
  • Primary Tool: cargo
Terminal window
cargo build # Build debug binary
cargo test # Run all unit and integration tests
cargo run -- apply # Run the CLI locally with arguments
cargo clippy # Run linting
cargo fmt # Format code

We use thiserror for defining custom, recoverable errors in the core logic and anyhow for high-level error handling in the CLI entry points.


The JS workspace acts as a wrapper to provide an easy installation path via pnpm/npm. It manages platform-specific binary downloads and provides a programmatic API.

  • Node.js: v24.14.0+ (recommended for development)
  • Package Manager: pnpm 10+
  • Location: npm/agentsync/
Terminal window
pnpm install # Install dependencies
pnpm run typecheck # Verify TypeScript types
pnpm run build # Compile TypeScript to JS
pnpm run test # Run tests (uses vitest)

We use a Makefile at the repository root to orchestrate tasks across both stacks. This is the recommended way to run full verification.

CommandDescription
make installInstall all dependencies (JS and Rust).
make allBuild both the Rust binary and JS package.
make verify-allRun the full suite: linting, tests, and documentation build.
make rust-testRun only Rust tests.
make js-testRun only JavaScript tests.
make fmtFormat all code across the repo.

The agentsync.toml file is the shared configuration format. The Rust core parses this file to determine sync targets, while the JS wrapper handles the distribution of the compiled Rust binary that performs the actual work.

  • Config Schema: Defined in src/config.rs.
  • MCP Formats: Handled in src/mcp.rs, supporting JSON (Claude, Cursor, VS Code) and TOML (Codex).