跳到主內容

Theme / 0.3.2

ThinkRail

圍繞 pi 代理的代理式 IDE

基礎觀念

專案與工作區:worktree 切出來的平行宇宙

🟢 入門|ThinkRail 的核心隔離模型:一個專案 = 一個 git repo,一件工作 = 一個 git worktree 工作區(自己的分支、自己的目錄)。代理平行作業不踩線,做完合併好的、刪掉其餘的;收納進 Shelf 的是已完成而不是被刪除。

一句話心法

官網首頁的口號直接寫進標題:

Agents deserve worktrees, not your working tree.

Every workspace is a real git worktree — its own branch, its own cwd.

三層結構

層 是什麼 關鍵行為
專案 (Project) 你打開的 git repo thinkrail ~/code/my-repo;也可開多個專案
工作區 (Workspace) 從 repo 切出的 git worktree 自己的分支+自己的工作目錄;可附加既有 worktree
預設工作區 直接在專案資料夾裡做 規格書原文:Working directly in the project folder (the Default workspace) is an explicit choice, never the default——明確選擇才用,絕非預設

每個工作區的東西都綁定該工作區:編輯器分頁、檔案樹、終端機、文件、對話。切工作區=換一個平行宇宙。

為什麼要這樣隔離

規格書的問題定義第一條就是 Parallel agents collide——多代理在同一份 checkout 互踩。worktree 之後的官方使用想像(README):

Agents work in parallel without touching your checkout; merge the good branch, delete the rest.

部落格《Introducing ThinkRail》也把這列為設計根基:

Every working session operates on a separate Git branch that merges with the original repository only after the work is finished and reviewed.

Settled Shelf:做完的工作自己收納

README 原文:

Finished and dormant workspaces settle onto a per-project shelf on their own — when their pull request merges or closes, or after a quiet week — and come back the moment you work in them.

白話:工作區的 PR 一合併/關閉,或靜置一週沒動,就自動收進該專案的架上;你一回來工作,它立刻回來。 Shelf 不是刪除,是「先收著」。

Topbar:分支與 PR 的儀表板

工作區頂欄隨時顯示作用分支對 origin 與其 PR 的狀態,下一步一鍵可達(README):

  • 發布 / 推送 / 開 PR——PR 描述可以來自「計畫、commits、你的 PR template,或代理寫的草稿」
  • PR 開了之後:顯示 CI checks 與 review decision;可標 ready、把失敗的 checks 或分岔的分支交給代理處理、用 repo 上次用的方式合併、重開 PR,或刪除遠端分支

操作入口

  • 新工作區:⌘K 面板 → New workspace,或快捷鍵 ⌘N(見命令面板)
  • 工作區命令:面板裡的 workspace.settle / unsettle(手動收納/取回)、workspace.markRead / markUnread、workspace.copyPath、workspace.reveal、在外部 IDE 開啟(workspace.openIn.<editor>)

延伸閱讀