| Crates.io | systemprompt-sync |
| lib.rs | systemprompt-sync |
| version | 0.0.11 |
| created_at | 2026-01-21 20:57:19.072477+00 |
| updated_at | 2026-01-25 21:43:39.828283+00 |
| description | Sync services for systemprompt.io - file, database, and crate deployment synchronization |
| homepage | https://systemprompt.io |
| repository | https://github.com/systempromptio/systemprompt-core |
| max_upload_size | |
| id | 2060116 |
| size | 192,166 |
Synchronization services for systemprompt.io - file, database, and crate deployment synchronization between local and cloud environments.
This crate provides bidirectional sync capabilities for:
src/
├── lib.rs # Crate root, public exports, SyncService orchestrator
├── error.rs # SyncError enum with MissingConfig variant
├── api_client.rs # HTTP client for cloud API communication
├── files.rs # FileSyncService - tarball creation/extraction
├── crate_deploy.rs # CrateDeployService - Docker build and deploy
├── database/
│ ├── mod.rs # DatabaseSyncService, export models, import logic
│ └── upsert.rs # Database upsert functions for users, skills, contexts
├── diff/
│ ├── mod.rs # Diff module exports, hash computation functions
│ ├── content.rs # ContentDiffCalculator - compare disk vs DB content
│ └── skills.rs # SkillsDiffCalculator - compare disk vs DB skills
├── export/
│ ├── mod.rs # Export utilities, YAML escape function
│ ├── content.rs # Content markdown generation and file export
│ └── skills.rs # Skill markdown/config generation and file export
├── local/
│ ├── mod.rs # Local sync module exports
│ ├── content_sync.rs # ContentLocalSync - bidirectional content sync
│ └── skills_sync.rs # SkillsLocalSync - bidirectional skills sync
└── models/
├── mod.rs # Model exports
└── local_sync.rs # Sync direction, diff items, and result types
| Module | Purpose |
|---|---|
SyncService |
Top-level orchestrator for file and database sync operations |
SyncApiClient |
HTTP client with direct sync and cloud API endpoints |
FileSyncService |
Creates/extracts gzipped tarballs for file sync |
DatabaseSyncService |
Exports and imports users, skills, contexts via SQL |
CrateDeployService |
Builds release, Docker image, and deploys to Fly.io |
ContentDiffCalculator |
Computes hash-based diffs between disk and database content |
SkillsDiffCalculator |
Computes hash-based diffs between disk and database skills |
ContentLocalSync |
Syncs content to/from disk using ingestion services |
SkillsLocalSync |
Syncs skills to/from disk using ingestion services |
| Direction | Description |
|---|---|
Push |
Local to cloud (upload files, push database) |
Pull |
Cloud to local (download files, pull database) |
ToDisk |
Database to local files |
ToDatabase |
Local files to database |
use systemprompt_sync::{SyncConfig, SyncService, SyncDirection};
let config = SyncConfig::builder(
"tenant-id",
"https://api.systemprompt.io",
"api-token",
"./services",
)
.with_direction(SyncDirection::Push)
.with_dry_run(false)
.build();
let service = SyncService::new(config);
let results = service.sync_all().await?;
The crate uses SyncError for all error conditions:
MissingConfig - Required configuration (e.g., DATABASE_URL) not setApiError - HTTP API failures with status code and messageDatabase - SQL/connection errorsIo - File system errorsUnauthorized - Authentication requiredCommandFailed - Shell command execution failures| Crate | Purpose |
|---|---|
systemprompt-database |
Database pool and provider traits |
systemprompt-content |
Content repository and ingestion |
systemprompt-agent |
Skill repository and ingestion |
systemprompt-identifiers |
Typed identifiers (SkillId, SourceId, etc.) |
systemprompt-logging |
Tracing integration |
Add to your Cargo.toml:
[dependencies]
systemprompt-sync = "0.0.1"
FSL-1.1-ALv2 - See LICENSE for details.