Expand description
sync-auth — Bidirectional auth credential sync for dev tools via Git repositories.
This library provides a trait-based, extensible system for syncing authentication credentials for developer tools (GitHub CLI, GitLab CLI, Claude Code, Codex, Gemini CLI, etc.) through a Git repository backend.
§Architecture
AuthProvidertrait: implement to add support for any dev tool’s credentials- [
GitBackend] trait: implement to customize how credentials are stored/fetched SyncEngine: orchestrates bidirectional sync between local and remote- Built-in providers for common tools via
providersmodule
§Example
use sync_auth::{SyncEngine, SyncConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = SyncConfig {
repo_url: "https://github.com/user/my-credentials.git".to_string(),
local_path: "/tmp/sync-auth-repo".into(),
providers: vec!["gh".to_string(), "claude".to_string()],
..Default::default()
};
let engine = SyncEngine::new(config)?;
engine.pull().await?;
Ok(())
}Modules§
- backend
- Git backend for credential storage and retrieval.
- providers
- Built-in auth providers for common dev tools.
Structs§
- Credential
File - Credential file entry describing a single file to sync.
- Sync
Config - Configuration for the sync engine.
- Sync
Engine - The sync engine coordinates pulling credentials from a Git repo to local filesystem and pushing local credentials to the repo.
Enums§
- Sync
Error - Errors that can occur during sync operations.
- Validation
Result - Result of validating a credential.
Constants§
- VERSION
- Package version (matches Cargo.toml version).
Traits§
- Auth
Provider - Trait for auth credential providers.