update-app
Skill5 starsChanged 12 days agoMITView on GitHub
自分の Mac の /Applications/tanacode.app を、手元のソースからビルドした版に入れ替える手順。ビルドと入れ替え・pty ホストの形(PROTOCOL)が変わったかの確認・起動し直しの案内まで。ソースから入れたアプリを更新するときに使います。
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- tymrtn/tomorrowkit-for-mindstheir own version, first seen Aug 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- tymrtn/tomorrowkit-for-minds★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- claude-code-eventsSkill
- releaseSkill
- securitySkill
The file
Files
自分の Mac のアプリの更新
npm run install-app で、ソースからビルドしたアプリに /Applications/tanacode.app を入れ替える手順書。作業はリポジトリの一番上のフォルダで行います。
決まり
- アプリの終了・起動は、ユーザーに頼みます。エージェントは tanacode を終了・起動しません。
- ユーザーの動いている pty ホストや、その中の
claudeのプロセスを勝手に止めません。止める必要が出たときは、AskUserQuestion で確かめます(推奨の選択肢を先頭に置き、ラベルの末尾に「(推奨)」)。 /Applications/tanacode.appの中のファイルをcpなどで上書きしません。動いているアプリや pty ホストのファイルを上書きすると、macOS が署名の確認でプロセスを止めることがあるためです。入れ替えは必ずnpm run install-appで。- git の操作は、最新にするための
git pullまで。コミット・プッシュはしません。
仕組み
npm run install-appは、npm run distでビルドしてからnode scripts/install-app.mjsを実行します。npm run dist:electron-vite buildとscripts/electron-builder.mjs --mac(署名の証明書を選んで electron-builder に渡すラッパー)で、その Mac に合わせたアプリを作ります。Apple Silicon ではdist/mac-arm64/tanacode.app、Intel ではdist/mac/tanacode.app(署名は CONTRIBUTING.md の「署名」)。scripts/install-app.mjs: 動いているアプリの上に上書きせず、次の順で入れ替えます。- 前回の途中で止まったときの残り(
/Applications/.tanacode.app.incoming・/Applications/.tanacode.app.outgoing)の削除 dittoで、新しいアプリを/Applications/.tanacode.app.incomingにコピー(シンボリックリンクや拡張属性ごと)- 今の
/Applications/tanacode.appの名前を.tanacode.app.outgoingに付け替え .tanacode.app.incomingの名前を/Applications/tanacode.appに付け替え.tanacode.app.outgoingの削除
- 前回の途中で止まったときの残り(
- 古いファイルが消えても、動いているアプリと pty ホスト・Claude Code はそのまま動き続けます。次に起動したときから新しい版。
- アプリを起動し直すと、新しい版が、pty ホストの中で動いていた Claude Code をそのまま引き継ぎます。
- ただし、アプリと pty ホストのやりとりの形(
src/main/pty-host-protocol.tsのPROTOCOL)が違うと、起動した新しい版は古いホストを Claude Code ごと止めて、ホストを起動し直します(src/main/pty-host-client.tsのconnect)。止まったセッションは、選ぶとclaude --resumeで会話を再開します。途中のターンは中断されます。
1. ソースの準備
今のブランチと、手元の変更を確かめます。
git branch --show-current git status --shortinstall-appは、今の作業ツリーをそのままビルドします。develop 以外のブランチにいる、または手元に変更があるときは、AskUserQuestion で確かめます。- 選択肢の例: 「今の作業ツリーのままビルド」「develop の最新にしてからビルド」。手元に変更があるときは前者を先頭に「(推奨)」(勝手に退避・破棄はしません)。
develop の最新にするときは、次を実行します。
git switch develop git pull --ff-only npm installnpm installのあとにgit status --shortでpackage-lock.jsonが変わっていたら、ユーザーに伝えます(コミットはしません)。
2. PROTOCOL が変わるかの確認(入れ替えの前に)
入れ替えると古いアプリの中身が消えるので、必ず install-app の前に確かめます。
今入っているアプリの版と
PROTOCOLを見ます。PROTOCOLはビルドしたコードのPROTOCOL = <数>の形でapp.asarに入っています。/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" /Applications/tanacode.app/Contents/Info.plist grep -aoE "PROTOCOL = [0-9]+" /Applications/tanacode.app/Contents/Resources/app.asar | sort -uソースの
PROTOCOLを見ます。sed -nE 's/^export const PROTOCOL = ([0-9]+);.*/\1/p' src/main/pty-host-protocol.ts- 1 と 2 の数を比べます。
/Applications/tanacode.appが無い: 初めてのインストール。PROTOCOL の心配は無し- 同じ: 変更無し
- 違う: この版では、起動し直すと古いホストが Claude Code ごと止まります
- 1 の
grepの出力が無い(ビルドの形が変わったなど): 版の数から判断します。git log --oneline -- src/main/pty-host-protocol.tsでPROTOCOLを上げたコミットと、その後のタグ(git tag --contains <コミット>)を見て、入っている版より新しければ「違う」と扱います
- 補足: 前回
install-appしたあとに起動し直していなければ、動いているホストは入っているアプリよりさらに古いことがあります。心当たりをユーザーに聞き、分からなければgit log -p -- src/main/pty-host-protocol.tsでPROTOCOLの変わった履歴を見せます。
3. ビルドと入れ替え
実行します。ビルドに数分かかり、メモリを約 4GB 使います。
npm run install-app最後に「/Applications/tanacode.app に入れました。…」と出れば成功。
入れ替わったか確かめます。
/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" /Applications/tanacode.app/Contents/Info.plist grep -aoE "PROTOCOL = [0-9]+" /Applications/tanacode.app/Contents/Resources/app.asar | sort -u ls -d /Applications/.tanacode.app.* 2>/dev/null確かめること
- 版が
package.jsonのversionと同じ PROTOCOLがソースと同じlsの出力が無い(途中の残りが無い)
- 版が
失敗したとき
症状 対処 JavaScript heap out of memoryNODE_OPTIONS=--max-old-space-size=6144 npm run install-appでやり直し「dist/… がありません。先に npm run dist でビルドしてください」 ビルドが失敗しています。その前のエラーを読んで対処 /Applicationsへの書き込みでEACCES・EPERM権限が足りません。ユーザーに伝え、どうするか AskUserQuestion で確かめます(sudo は使いません) 途中で止まり、 /Applications/tanacode.appが無いnpm run install-appをもう一度実行すると入ります。ビルドをやり直したくなければnode scripts/install-app.mjsだけでも可
4. 起動し直しの案内
2 の結果で分けます。
- PROTOCOL が同じ: ユーザーに次を頼みます。
- tanacode の終了。終了のダイアログでは「動かしたまま終了」を選んでもらいます
- tanacode の起動し直し。新しい版が、動いていた Claude Code をそのまま引き継ぎます
- PROTOCOL が違う: 起動し直すと、動いている Claude Code がすべて止まります。先にこのことを伝え、AskUserQuestion で進め方を確かめます。
- 選択肢の例: 「作業中のセッションが一区切りしてから起動し直す (推奨)」「今すぐ起動し直す」
- 起動し直すときは、ユーザーに次を頼みます。
- tanacode の終了。終了のダイアログは「Claude Code も止めて終了」「動かしたまま終了」のどちらでもかまいません(新しい版の起動のときに、古いホストは止まります)
- tanacode の起動し直し
- 止まったセッションは、選ぶと会話を再開します
- ホストの入れ替えで困ったときは、userData の
~/Library/Application Support/tanacode/pty-host.logを見ます。
エージェントは、アプリ・pty ホスト・claude のプロセスを kill などで止めません。
最後の報告
ユーザーに、次をまとめて伝えます。
- 入れた版(
CFBundleShortVersionString)と、ビルドしたブランチ・コミット(git rev-parse --short HEAD) - PROTOCOL が変わったかどうかと、起動し直すときの注意
- ユーザーにしてもらうこと(終了のダイアログでの選択と、起動し直し)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

