Skip to content

Add GitHub private-repo sync (token-based) for notes, chats and diagrams - #2

Open
nigussolomon wants to merge 1 commit into
mainfrom
codex/implement-automatic-sync-to-github-with-token
Open

nigussolomon wants to merge 1 commit into
mainfrom
codex/implement-automatic-sync-to-github-with-token

Conversation

@nigussolomon

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple, token-based mechanism to sync selected items (notes, chats, diagrams) to a user-owned private GitHub repository.
  • Allow creating the private repo automatically and pushing the current local InkCaliber content for a specific item on-demand.

Description

  • Added a Tauri command sync_to_github (apps/inkcaliber-desk/src-tauri/src/lib.rs) that verifies the PAT by resolving the GitHub user, ensures a private repo exists (creates it if necessary), initializes/updates a local git repo under Documents/InkCaliber, commits, and pushes using token-based auth headers.
  • Added a frontend service apps/inkcaliber-desk/src/services/github-sync.ts that prompts for a Personal Access Token and repo name on first use, stores the config in localStorage, invokes the backend sync_to_github command, and clears stored config on auth failures.
  • Wired the UI sync indicator in the active editors to trigger per-item syncs by calling the service with the correct item path (notes/<name>.json, chat/<provider>/<name>.json, diagrams/<session>/<branch>.excalidraw).
  • Performed small TS cleanups to remove unused imports/refs so the frontend build succeeds.

Testing

  • Built the frontend with cd apps/inkcaliber-desk && npm run build, which completed successfully.
  • Attempted to run cd apps/inkcaliber-desk/src-tauri && cargo check, which failed to resolve crates due to blocked access to crates.io in the current environment (network restriction), so Rust binary validation could not be completed.
  • Verified the TypeScript changes and removal of unused symbols to resolve initial tsc errors and allow the frontend build to finish.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant