feat: implement sync-auth MVP - bidirectional credential sync for dev tools#2
feat: implement sync-auth MVP - bidirectional credential sync for dev tools#2
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #1
… tools Implements the core sync-auth library and CLI for syncing authentication credentials for developer tools (gh, glab, claude, codex, gemini, opencode, qwen-coder) through Git repositories. Architecture: - AuthProvider trait for extensible provider system - GitBackend trait for pluggable Git storage backends - SyncEngine for bidirectional pull/push/sync/watch operations - CLI with subcommands: pull, push, sync, watch, status, providers, init, daemon Features: - Shallow clone support for fast initial setup - Conflict resolution (skips expired credentials) - Watch mode with configurable interval - Daemon management (start/stop/restart/setup as systemd service) - TOML config file support with env var overrides - 7 built-in auth providers Name: sync-auth (available on both crates.io and npmjs.com) Fixes #1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rewrite README for sync-auth with full CLI/library documentation - Add Docker sandbox example script - Add GitHub Actions autonomous task solver example workflow - Add changelog fragment for MVP release - Update CONTRIBUTING.md with correct package references Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 7a66ca6.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit or discard them. Uncommitted files: Auto-restart will stop after changes are committed or discarded, or after 2 more iterations. Please wait until working session will end and give your feedback. |
- codex: use ~/.codex/ (CODEX_HOME), validate auth.json - gemini: use ~/.gemini/, validate .env or oauth_creds.json - opencode: use ~/.local/share/opencode/ + ~/.config/opencode/ (XDG) - qwen-coder: use ~/.qwen/ (official path), validate credentials.json - Update README provider table with accurate paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Codex: use CODEX_HOME env var, single ~/.codex/ dir, validate auth.json - Gemini: single ~/.gemini/ dir, validate .env or oauth_creds.json - Opencode: use XDG data dir (~/.local/share/opencode/) for auth, XDG config dir (~/.config/opencode/) for config Paths verified against upstream source code: - openai/codex: codex-rs/core/src/auth/storage.rs - google-gemini/gemini-cli: packages/core/src/config/storage.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🔄 Auto-restart 1/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 2/3Detected uncommitted changes from previous run. Starting new session to review and commit or discard them. Uncommitted files: Auto-restart will stop after changes are committed or discarded, or after 1 more iteration. Please wait until working session will end and give your feedback. |
The actual OAuth credential file in Qwen Code (~/.qwen/) is oauth_creds.json, not credentials.json. Verified against the official QwenLM/qwen-code source (packages/core/src/config/storage.ts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update from credentials.json to oauth_creds.json to match the actual implementation in src/providers/qwen_coder.rs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🔄 Auto-restart 2/3 LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Implements the complete
sync-authMVP as specified in #1 — a Rust library + CLI for bidirectional syncing of authentication credentials for developer tools through a Git repository.Package name:
sync-auth(available on both crates.io and npmjs.com)What's included
Library crate (
sync_auth) with trait-based extensible architecture:AuthProvidertrait — implement to add any tool's credentialsGitBackendtrait — pluggable Git storage backendSyncEngine— orchestrates bidirectional sync operationsSyncConfig— TOML-based configuration with serde defaults7 built-in auth providers (paths verified against upstream source code):
gh(GitHub CLI) —~/.config/gh/glab(GitLab CLI) —~/.config/glab-cli/claude(Claude Code) —~/.claude/,~/.claude.jsoncodex(OpenAI Codex CLI) —~/.codex/($CODEX_HOME), key file:auth.jsongemini(Gemini CLI) —~/.gemini/, key files:oauth_creds.json,.envopencode—~/.local/share/opencode/(XDG data),~/.config/opencode/(XDG config)qwen-coder(Qwen Code) —~/.qwen/, key files:oauth_creds.json,settings.jsonCLI binary with subcommands:
pull,push,sync,watch,status,providers,init,daemonCore features:
--depth 1) for fast initial setupExamples:
Tests: Unit tests + integration tests (14 tests passing)
Architecture decisions
async_traitfor async provider validationProvider path research
Credential paths were verified against upstream source code:
openai/codex→codex-rs/core/src/auth/storage.rsconfirms$CODEX_HOME/auth.jsongoogle-gemini/gemini-cli→packages/core/src/config/storage.tsconfirms~/.gemini/oauth_creds.jsonsst/opencode→packages/opencode/src/auth/service.tsconfirms XDG paths (~/.local/share/opencode/auth.json)QwenLM/qwen-code→packages/core/src/config/storage.tsconfirms~/.qwen/oauth_creds.jsonFixes #1
Test plan
cargo fmt --checkpassescargo clippy --all-targets --all-featurespasses (0 warnings)cargo test --all-featurespasses (14 unit/integration tests + 1 doc test)cargo build --releasecompiles successfullysync-auth providerslists all 7 providerssync-auth initcreates config filesync-auth --repo <url> pullclones and syncs🤖 Generated with Claude Code