快速開始

只需要 Node 22.18 或更新版本,其他都不用裝:不用建置,也沒有相依套件。

sh
npx yokoten install  # 每台電腦一次cd your-projectnpx yokoten init  # 每個專案一次npx yokoten doctor  # 走到第幾關,下一步做什麼

npm 上的第一個版本 10 月 24 日發布。在那之前,請從 clone 下來的儲存庫安裝。

最後一行的 doctor 會告訴你走到第幾關,下一步該做哪一件事。接著用你平常用的 AI agent 打開專案,不用 agent 也可以。

從 clone 下來的儲存庫安裝

sh
git clone https://github.com/yokoten-labs/yokotennode yokoten/bin/yokoten.ts install  # 每台電腦一次cd your-projectnode ~/.local/share/yokoten/bin/yokoten.ts init  # 每個專案一次node ~/.local/share/yokoten/bin/yokoten.ts doctor  # 走到第幾關,下一步做什麼

這樣安裝不會把 yokoten 指令加進 PATH。install 最後會印出一行 alias,把它加進 shell 的設定檔,再開一個新的 shell 就好。

確認裝好了沒

在專案裡執行 doctor。它會列出整條路,並標出下一步:

sh
npx yokoten doctoryokoten 0.1.0, self-test okthe road: stage 1 of 5, safety net  1. safety net    done        rules    done        tool-hook    done        commit-check    done        runtime    next        tests: CI does not run the tests; add a step that runs `npm test` …  2. issues and pull requests    …

這裡有刪減,你看到的步驟會不一樣。

想看守衛怎麼攔,又不想真的執行任何東西?丟給它一個假的工具呼叫就行:

sh
echo '{"tool_name":"Bash","tool_input":{"command":"git push --tags"}}' | node .yokoten/bin/yokoten.ts hookyokoten: git push --tags pushes tags. Only the owner decides when to release. If the owner asked for this, they start the session with YOKOTEN_RELEASE_APPROVAL set.

什麼都不會被推送出去:hook 只是讀這個呼叫。結束代碼 2 代表「已攔下」。

了解更多