Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat: the Windows installer asks before sharing usage analytics
leepokai942c266725f0
diff --git a/apps/desktop/resources/installer.nsh b/apps/desktop/resources/installer.nshindex f1520a46..3084b53a 100644--- a/apps/desktop/resources/installer.nsh+++ b/apps/desktop/resources/installer.nsh@@ -1,3 +1,20 @@+; A new install says what usage analytics Codync shares and lets the user turn them off before+; anything is sent (docs/features/analytics.md). Updates and silent installs keep the setting.+!macro customInstall+ ${ifNot} ${isUpdated}+ MessageBox MB_YESNO|MB_ICONQUESTION "Codync sends usage analytics to PostHog to find bugs sooner: which features are used (with the app version, the platform and a bot's agent and model), crash and error reports, and an approximate location from your IP address, linked to your Codync account or a random ID. Never your messages, code, files or anything your agents produce.$\n$\nPrivacy policy: https://www.codync.dev/privacy$\n$\nShare usage analytics from this computer? You can change this later in Settings > General." /SD IDYES IDYES codyncAnalyticsChosen+ nsExec::Exec '"$INSTDIR\resources\codync-host.exe" analytics off'+ Pop $0+ ${if} $0 != 0+ MessageBox MB_OK|MB_ICONEXCLAMATION "Codync couldn't save this choice. Turn off Share usage analytics in Settings > General." /SD IDOK+ ${endIf}+ ; ponytail: a reinstall over an app whose host-prefs.json still says analytics on can report one+ ; host_setup_failed if the host never starts. Not patched from here: an installer that spawns+ ; PowerShell to edit files is what antivirus heuristics flag. Fix it in the app if it matters.+ codyncAnalyticsChosen:+ ${endIf}+!macroend+; Removing Codync takes its background host with it (the sign-in entry and the running host).; An update reinstalls over the old version, and the new app starts the host again itself.!macro customUnInstalldiff --git a/docs/features/analytics.md b/docs/features/analytics.mdindex 74e61778..12735cbc 100644--- a/docs/features/analytics.md+++ b/docs/features/analytics.md@@ -6,7 +6,8 @@ every device; *Share usage analytics* in Settings turns it off. It exists to spolives in `web/app/privacy/page.tsx`: keep it true. The info button beside the switch (terminalUI: *About usage analytics…*) shows the same promise in the app, in one text per client(desktop `views/settings/AnalyticsSheet.tsx`, `CodyncUI/AnalyticsSheet.swift`, Android-`AnalyticsSheet.kt`, `host/src/tui/view/analytics.rs`): change all four with the policy.+`AnalyticsSheet.kt`, `host/src/tui/view/analytics.rs`), and the Windows installer sums it up+(`apps/desktop/resources/installer.nsh`): change all five with the policy.## Rules@@ -17,7 +18,17 @@ UI: *About usage analytics…*) shows the same promise in the app, in one text p- **Setting per device.** The computer's owner decides for that computer (host kv`analytics_enabled`, on unless `0`); each iPhone decides for itself (`UserDefaults``analyticsEnabled`, on unless `false`; each Android phone in its `codync-analytics` preferences). Turning it off drops anything still queued. A- device that said no to the earlier opt-in question stays off.+ device that said no to the earlier opt-in question stays off. `codync-host analytics on|off`+ sets the computer's choice from the command line: through the running host, or saved for its+ next start.+- **The Windows installer asks.** An install run by hand (not an update, not a silent `/S` one)+ shows what is shared, links the privacy policy and asks before anything is sent+ (`resources/installer.nsh`): *No* runs `codync-host analytics off`; *Yes* leaves the setting+ as it is (on for a new computer), so the first launch can still report `host_setup_failed`.+ Known gap: a reinstall answered *No* over an app that last saw analytics on can still report+ one `host_setup_failed` if the host never starts (the app's `host-prefs.json` copy is stale).+ Open source code signing (SignPath) requires this for a signed installer; the Mac and Linux+ packages have no install step that could ask.- **Identity.** Every device gets a person profile. Signed in to a Codync account: the Clerkuser id. Otherwise a random install id (the host id on a computer, a UUID on the iPhone).The first signed-in event sends `$identify` with `$anon_distinct_id` so earlier events joindiff --git a/host/src/analytics.rs b/host/src/analytics.rsindex b2173d5a..3688210a 100644--- a/host/src/analytics.rs+++ b/host/src/analytics.rs@@ -232,12 +232,17 @@ impl Analytics {}pub fn set_enabled(&self, store: &Store, on: bool) -> Result<()> {- store.kv_set(KV_ENABLED, if on { "1" } else { "0" })?;+ save_choice(store, on)?;*self.enabled.locked() = on;Ok(())}}+/// Saves the owner's choice; a host that isn't running reads it when it starts (`Analytics::load`).+pub fn save_choice(store: &Store, on: bool) -> Result<()> {+ store.kv_set(KV_ENABLED, if on { "1" } else { "0" })+}+/// A phone's platform as the catalog names it.fn platform(p: &str) -> &'static str {match p {@@ -383,6 +388,8 @@ mod tests {assert!(Analytics::load(&store).state());Analytics::load(&store).set_enabled(&store, false).unwrap();assert!(!Analytics::load(&store).state(), "an off stays off");+ save_choice(&store, true).unwrap();+ assert!(Analytics::load(&store).state(), "a choice saved before the host starts counts");}#[test]diff --git a/host/src/analytics_cli.rs b/host/src/analytics_cli.rsnew file mode 100644index 00000000..fb139ae6--- /dev/null+++ b/host/src/analytics_cli.rs@@ -0,0 +1,44 @@+//! `codync-host analytics on|off`: the computer owner's usage analytics choice from the command+//! line. The Windows installer asks with it (docs/features/analytics.md).++use crate::local_api::{NotRunning, local_call};+use anyhow::{Context, Result};+use serde_json::json;++#[derive(clap::Args)]+pub struct AnalyticsArgs {+ /// Whether this computer shares usage analytics.+ #[arg(value_enum)]+ sharing: Sharing,+ #[arg(long, default_value_t = crate::service::DEFAULT_PORT)]+ port: u16,+}++#[derive(Clone, Copy, clap::ValueEnum)]+enum Sharing {+ On,+ Off,+}++pub async fn run(args: AnalyticsArgs) -> Result<()> {+ let on = matches!(args.sharing, Sharing::On);+ let state = if on { "on" } else { "off" };+ // A running host keeps the setting in memory, so it has to hear the change.+ match local_call(args.port, "setAnalytics", json!({ "enabled": on })).await {+ Ok(_) => println!("Usage analytics {state}."),+ Err(e) if e.is::<NotRunning>() => {+ let port = args.port;+ tokio::task::spawn_blocking(move || {+ // Held while saving, so no host starts on the old setting meanwhile.+ let _lock = crate::service::lock_host()+ .with_context(|| format!("codync-host is running here, but not on port {port}: pass its --port"))?;+ let (store, _, _) = crate::open_store()?;+ crate::analytics::save_choice(&store, on)+ })+ .await??;+ println!("Usage analytics {state} from codync-host's next start.");+ }+ Err(e) => return Err(e),+ }+ Ok(())+}diff --git a/host/src/local_api.rs b/host/src/local_api.rsindex eed1e6c6..72248208 100644--- a/host/src/local_api.rs+++ b/host/src/local_api.rs@@ -7,6 +7,18 @@ use std::time::Duration;pub(crate) const NOT_RUNNING: &str ="codync-host isn't running here. Start it with `codync-host install` (or `serve`).";+/// `local_call` found no host to ask: no token yet, or nothing answering on the port.+#[derive(Debug)]+pub(crate) struct NotRunning;++impl std::fmt::Display for NotRunning {+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ f.write_str(NOT_RUNNING)+ }+}++impl std::error::Error for NotRunning {}+/// Calls `method` on the running host.pub(crate) async fn local_call(port: u16, method: &str, body: serde_json::Value) -> Result<serde_json::Value> {local_call_for(port, method, body, Duration::from_secs(20)).await@@ -19,7 +31,7 @@ pub(crate) async fn local_call_for(body: serde_json::Value,timeout: Duration,) -> Result<serde_json::Value> {- let not_running = || anyhow::anyhow!(NOT_RUNNING);+ let not_running = || anyhow::Error::new(NotRunning);let token = std::fs::read_to_string(service::data_dir().join("token")).map_err(|_| not_running())?;let res = http().post(format!("http://127.0.0.1:{port}/api/{method}"))diff --git a/host/src/main.rs b/host/src/main.rsindex fea92fde..eb24f515 100644--- a/host/src/main.rs+++ b/host/src/main.rs@@ -2,6 +2,7 @@mod agent;mod analytics;+mod analytics_cli;mod api;mod background;mod chat;@@ -119,6 +120,8 @@ enum Sub {},/// Show or change the Codync cloud (reach this computer from anywhere).Cloud(cloud_cli::CloudArgs),+ /// Turn this computer's usage analytics on or off, as Settings does (the Windows installer asks with it).+ Analytics(analytics_cli::AnalyticsArgs),/// Your other computers: create a network, invite them, see who is around.Network(network_cli::NetworkArgs),/// Import bots from another app's export file (`--skill` prints the skill that writes one in Grok Bot).@@ -371,6 +374,7 @@ async fn main() -> Result<()> {},Sub::Access { port, action } => pair_cli::access(port, action.unwrap_or(pair_cli::AccessAction::List)).await,Sub::Cloud(args) => cloud_cli::run(args).await,+ Sub::Analytics(args) => analytics_cli::run(args).await,Sub::Network(args) => network_cli::run(args).await,Sub::Install { port } => {open_store()?;diff --git a/host/tests/analytics_cli_e2e.rs b/host/tests/analytics_cli_e2e.rsnew file mode 100644index 00000000..9b740919--- /dev/null+++ b/host/tests/analytics_cli_e2e.rs@@ -0,0 +1,46 @@+//! `codync-host analytics on|off` against a real host: the running host hears the change, a+//! stopped one reads it when it starts, and a host running on another port is never written behind.++#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]++mod common;++use common::host::Host;+use serde_json::json;+use std::path::Path;++/// `codync-host analytics <sharing> --port <port>` on `home`'s data: its stderr when it fails.+fn analytics(home: &Path, sharing: &str, port: &str) -> Result<(), String> {+ let out = std::process::Command::new(env!("CARGO_BIN_EXE_codync-host"))+ .args(["analytics", sharing, "--port", port])+ .env("CODYNC_HOME", home)+ .output()+ .expect("run codync-host analytics");+ if out.status.success() { Ok(()) } else { Err(String::from_utf8_lossy(&out.stderr).into_owned()) }+}++/// A port nothing answers on.+fn free_port() -> String {+ std::net::TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port().to_string()+}++async fn sharing(host: &Host) -> bool {+ host.call("hello", json!({})).await["analytics"].as_bool().unwrap()+}++#[tokio::test]+async fn analytics_command_reaches_the_running_host_or_its_next_start() {+ let mut host = Host::start().await;+ let port = host.base.rsplit(':').next().unwrap().to_owned();+ assert!(sharing(&host).await, "on by default");++ analytics(&host.home, "off", &port).unwrap();+ assert!(!sharing(&host).await, "the running host heard it");++ let refused = analytics(&host.home, "on", &free_port()).unwrap_err();+ assert!(refused.contains("pass its --port"), "{refused}");+ assert!(!sharing(&host).await, "nothing saved behind the running host");++ host.restart(|home| analytics(home, "on", &free_port()).unwrap()).await;+ assert!(sharing(&host).await, "saved while stopped, read at start");+}diff --git a/web/app/privacy/page.tsx b/web/app/privacy/page.tsxindex e4c4f6eb..eae819ba 100644--- a/web/app/privacy/page.tsx+++ b/web/app/privacy/page.tsx@@ -9,7 +9,7 @@ export default function Privacy() {<main className="flex-1 flex flex-col items-center px-6 py-16"><article className="max-w-2xl w-full space-y-6"><h1 className="text-3xl font-bold text-white">Privacy Policy</h1>- <p className="text-neutral-400 text-sm">Last updated: November 2, 2026</p>+ <p className="text-neutral-400 text-sm">Last updated: November 3, 2026</p><Section title="Overview">Codync is an independent open-source project by leepokai ("we", "us"). It lets you message the AI agents that run on your own computer. It is built so that your files, conversations and credentials stay on your devices.@@ -42,7 +42,7 @@ export default function Privacy() {<Section title="Data we collect"><p className="mb-2">- Usage analytics; the registration of each computer that uses our relay (its name, platform, device type, Codync version, public keys and when it was last online), with the public keys of the devices allowed to use it; and the account data described under Codync account. Analytics are on by default; turn them off on each phone and each computer in Settings (Share usage analytics), and that device stops sending right away.+ Usage analytics; the registration of each computer that uses our relay (its name, platform, device type, Codync version, public keys and when it was last online), with the public keys of the devices allowed to use it; and the account data described under Codync account. Analytics are on by default (the Windows installer asks first); turn them off on each phone and each computer in Settings (Share usage analytics), and that device stops sending right away.</p><ul className="list-disc pl-5 space-y-2"><li><strong>What we record:</strong> which features you use, such as opening the app and its screens, setting up and pairing a device (and whether you allow notifications), creating or deleting a bot, sending a message (with the number of attachments, not the files), starting a routine or a voice call, and installing a connector from the catalog. Each event carries the app version, the platform and the agent and model a bot uses.</li>diff --git a/web/content/docs/getting-started.mdx b/web/content/docs/getting-started.mdxindex 3e1e8de3..047066d8 100644--- a/web/content/docs/getting-started.mdx+++ b/web/content/docs/getting-started.mdx@@ -22,7 +22,7 @@ Open Codync. The app includes the host and sets it up as a background service th### Windows-Download [codync-windows-x64.exe](https://github.com/leepokai/Codync/releases/latest/download/codync-windows-x64.exe) and run it. It installs for your user only, and the host starts each time you sign in to Windows. The installer isn't code-signed yet, so SmartScreen asks you to confirm once: choose **More info**, then **Run anyway**.+Download [codync-windows-x64.exe](https://github.com/leepokai/Codync/releases/latest/download/codync-windows-x64.exe) and run it. It installs for your user only, and the host starts each time you sign in to Windows. It asks whether to share usage analytics from this computer ([what's shared](/docs/privacy#usage-analytics)). The installer isn't code-signed yet, so SmartScreen asks you to confirm once: choose **More info**, then **Run anyway**.Codync shows a tray icon. Left-click it to open the chat window, right-click it for the menu. Remote screen isn't available on Windows yet.diff --git a/web/content/docs/privacy.mdx b/web/content/docs/privacy.mdxindex f355cd50..d3b919bf 100644--- a/web/content/docs/privacy.mdx+++ b/web/content/docs/privacy.mdx@@ -57,7 +57,7 @@ Your provider key stays on your computer, encrypted. It's never sent to the rela## Usage analytics-Codync records which features you use, to spot bugs sooner and see where people get stuck. Analytics are **on by default**, and nothing asks first. They go to PostHog (US).+Codync records which features you use, to spot bugs sooner and see where people get stuck. Analytics are **on by default**. The Windows installer asks first; nothing else does. They go to PostHog (US).**What's recorded:** opening the app and its screens, setting up and pairing (and whether you allow notifications), creating or deleting a bot, sending a message (with the number of attachments, never the files), running a routine or a voice call, and installing a connector. Each event carries the app version, the platform, and the agent and model the bot uses.@@ -78,6 +78,8 @@ Each phone and each computer has its own switch, **Share usage analytics**. Turn- **iPhone:** the **Settings** tab, **Share usage analytics**.- **Desktop app:** **Settings → General**, under **Privacy**. This switch belongs to the computer's host, so it also covers the terminal UI on that computer.- **Terminal UI:** press `^k` and choose **Share usage analytics**.+- **Windows installer:** it asks whether to share usage analytics from the computer (not when Codync updates itself). **No** turns off the same switch the desktop app shows.+- **Command line:** `codync-host analytics off` (`on` turns it back on).The info button next to the switch (**About usage analytics…** in the terminal UI) lists the same details. What you do from the phone on a computer, such as sending a message, is recorded by that computer. To stop all of it, turn the switch off on both.