diff --git a/crates/relicario-cli/src/main.rs b/crates/relicario-cli/src/main.rs index 6ca47e6..0495954 100644 --- a/crates/relicario-cli/src/main.rs +++ b/crates/relicario-cli/src/main.rs @@ -1243,7 +1243,15 @@ fn cmd_settings(action: SettingsAction) -> Result<()> { eprintln!("Settings updated."); Ok(()) } -fn cmd_sync() -> Result<()> { bail!("not yet implemented"); } +fn cmd_sync() -> Result<()> { + let root = crate::helpers::vault_dir()?; + let pull = crate::helpers::git_command(&root, &["pull", "--rebase"]).status()?; + if !pull.success() { anyhow::bail!("git pull --rebase failed"); } + let push = crate::helpers::git_command(&root, &["push"]).status()?; + if !push.success() { anyhow::bail!("git push failed"); } + eprintln!("Sync complete."); + Ok(()) +} fn cmd_device(_a: DeviceAction) -> Result<()> { bail!("not yet implemented"); } #[derive(serde::Serialize)]