agent_sync 0.0.1-dev02
agent_sync: ^0.0.1-dev02 copied to clipboard
Thin Dart wrapper for AgentSync shell engine with GitHub-backed SSOT.
AgentSync #
agent_sync is a thin Dart wrapper over the AgentSync shell engine.
The engine remains the single source of truth in this repository (agent/.ai/system/*.sh).
The Dart package does not reimplement sync logic. It runs that engine from GitHub (or local checkout).
Install #
Use as a git dependency (because package lives in a subfolder):
dependencies:
agent_sync: ^0.0.1-dev02
Then run:
dart pub get
Minimal workflow for users #
- Add package to
pubspec.yaml. - Create
.ai/in your project and put:.ai/AGENTS.md.ai/rules/*.md.ai/skills/*/SKILL.md.ai/tools/*.yaml
- Run:
dart run agent_sync:agent_sync sync
Generated files appear in destinations from .ai/tools/*.yaml (for example .codex/*, .claude/*, .github/*, .gemini/*).
CLI #
dart run agent_sync:agent_sync sync --project-dir .
dart run agent_sync:agent_sync sync --project-dir . --only codex,cursor --dry-run
dart run agent_sync:agent_sync check --project-dir .
dart run agent_sync:agent_sync setup-hooks --project-dir .
Useful options:
--repo-urland--repo-ref: point to another fork/branch--cache-dir: where the cloned engine repo is cached--no-update: use existing cache withoutgit fetch(default behavior)--update: refresh cached repository before command execution--local-repo-path: run scripts from a local checkout instead of cloning- local repository auto-detection is used only when repo options are not explicitly provided
Optional project config #
You can customize source paths via agent_sync.yaml in project root:
source:
agents: ".ai/AGENTS.md"
rules: ".ai/rules"
skills: ".ai/skills"
tools: ".ai/tools"
Flat keys are also supported:
agents: ".ai/AGENTS.md"
rules: ".ai/rules"
skills: ".ai/skills"
tools: ".ai/tools"
Dart API #
import 'package:agent_sync/agent_sync.dart';
Future<void> main() async {
final client = AgentSyncClient();
await client.sync(projectDirectory: '.', dryRun: true);
}
Notes #
- Requires
gitandbashavailable inPATH. - Scripts are executed with
AGENTSYNC_REPO_ROOT=<project-dir>. - Source layout is auto-detected for both
.ai/src/*and.ai/*.