feat: `update` command to self-update from GitHub releases
まだ誰も着手していません。
評価
調査の方向性
The issue describes adding an update command using the self_update crate. Start by examining the existing CLI command structure in src/main.rs and the clap configuration. Look at the GitHub release asset naming patterns and the self_update crate documentation. The work involves detecting the install source (via std::env::current_exe() or a compile-time constant), matching the correct asset for the platform (including musl), verifying SHA256 checksums, and implementing the proposed flags. Tests should cover asset selection, install source detection, and checksum verification.
索引モデルが issue の本文から書いたものです。
説明
Suggested by @FluffyDiscord in #96: a claude-code-sync update that checks GitHub releases and installs the latest version, or one you pass in.
Every release already ships per-platform archives with a .sha256 next to each (Linux gnu and musl, macOS x86_64 and arm64, Windows), so the downloads and the checksums are already in place.
Proposed CLI
claude-code-sync update # install the latest release
claude-code-sync update --version 0.3.1 # install a specific version (downgrades allowed, for rollback)
claude-code-sync update --check # report current vs latest, change nothing
claude-code-sync update --yes # skip the confirmation prompt (scripts)
Show the version change before swapping and ask for confirmation unless --yes is given.
Only self-replace a binary that came from a GitHub release
The README documents cargo install --git / --path, the crate is published to crates.io, and there is a Docker image. Overwriting a binary that one of those put in place breaks it:
| Install source | Behaviour |
|---|---|
| GitHub release archive | Download, verify, replace in place |
cargo install (~/.cargo/bin) |
Don't touch it: overwriting makes ~/.cargo/.crates.toml wrong. Print cargo install --locked claude-code-sync |
| Container | Refuse and say to pull a newer image |
Package manager (/nix/store, Homebrew prefix, …) |
Refuse and point at that package manager |
The binary's own path (std::env::current_exe()) is a good-enough way to detect this. A compile-time INSTALL_SOURCE set by the release workflow is sturdier, and probably worth having: release-workflow builds set it to github-release, and every other build defaults to "unknown", which refuses with instructions.
Implementation notes
- Use the
self_updatecrate's GitHub backend rather than writing our own: it picks the asset, extracts it and swaps the binary. On Windows a running.execan't be overwritten; it has to be renamed aside and swapped in, whichself_updatehandles throughself-replace. - Always verify
.sha256before swapping. This only catches corrupted or truncated downloads, not a compromised release, since the checksum is hosted in the same place as the archive. Signing (minisign or GitHub artifact attestations) can come later. - Pick the Linux build that matches what's running: a musl binary updates to the
-muslasset. Matching only on OS and CPU would install the glibc build on Alpine, where it may not run. - No automatic update checks. Checking on every
syncwould be network traffic this tool doesn't do today, so keep checking explicit (update --check). - Asset names to match:
claude-code-sync-{linux-x86_64[-musl],macos-{x86_64,aarch64}}.tar.gz,claude-code-sync-windows-x86_64.exe.zip.
Tests
- Choosing the asset for each target triple, musl included
- Detecting the install source, including refusing for cargo and unknown sources
- A checksum mismatch aborts and leaves the current binary untouched
--checkmakes no changes
Should be a small, standalone PR, kept separate from #96.
- 主要言語
- Rust
- スター
- 104
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
perfectra1n/claude-code-sync のほかの issue
-
Cover Claude Code's plugin-directory v2 state (installs don't propagate)対応中かも @jrevillard が 48 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
perfectra1n/claude-code-sync#102 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
perfectra1n/claude-code-sync#116 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
perfectra1n/claude-code-sync#112 ·
-
Dependency Dashboardオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
perfectra1n/claude-code-sync の issue をすべて見る
似ている issue
-
Find/Replace panel: "Previous/Next occurrence" labels overlap and overflow their buttons (French)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
obi1kenobi/cargo-semver-checks#1839 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`対応中かも @iliqiliev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ajeetdsouza/zoxide#1381 ·
メンテナーはふだん 5 日以内に返信
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
kornia/kornia-rs#1416 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信