<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kiro CLI on Book of Kiro</title><link>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/</link><description>Recent content in Kiro CLI on Book of Kiro</description><generator>Hugo</generator><language>zh-TW</language><atom:link href="https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/index.xml" rel="self" type="application/rss+xml"/><item><title>開始使用</title><link>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/getting-started/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/getting-started/</guid><description>&lt;h1 id="kiro-cli-安裝與介紹">&lt;strong>Kiro CLI 安裝與介紹&lt;/strong>&lt;a class="anchor" href="#kiro-cli-%e5%ae%89%e8%a3%9d%e8%88%87%e4%bb%8b%e7%b4%b9">#&lt;/a>&lt;/h1>
&lt;p>Kiro CLI 是 Kiro 平台的命令列元件，提供高度互動式的終端機程式設計體驗。它支援自訂 Agent、複雜程式碼庫功能建構、工作流程自動化和精確的錯誤分析。&lt;/p>
&lt;h2 id="安裝-kiro-cli">&lt;strong>安裝 Kiro CLI&lt;/strong>&lt;a class="anchor" href="#%e5%ae%89%e8%a3%9d-kiro-cli">#&lt;/a>&lt;/h2>
&lt;p>在 macOS 和 Linux 系統上安裝：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>curl -fsSL https://cli.kiro.dev/install | bash&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="kiro-cli-的功能介紹">&lt;strong>Kiro CLI 的功能介紹&lt;/strong>&lt;a class="anchor" href="#kiro-cli-%e7%9a%84%e5%8a%9f%e8%83%bd%e4%bb%8b%e7%b4%b9">#&lt;/a>&lt;/h2>
&lt;h3 id="-開始聊天">&lt;strong>💬 開始聊天&lt;/strong>&lt;a class="anchor" href="#-%e9%96%8b%e5%a7%8b%e8%81%8a%e5%a4%a9">#&lt;/a>&lt;/h3>
&lt;p>登入後，直接使用 &lt;code>kiro-cli&lt;/code> 指令即可開始聊天（&lt;code>kiro-cli&lt;/code> 是 &lt;code>kiro-cli chat&lt;/code> 指令的縮寫）。&lt;/p>
&lt;p>您可以使用 &lt;code>kiro-cli chat --help&lt;/code> 來查看額外的參數。&lt;/p>
&lt;p>進入聊天後，您可以使用 &lt;code>/help&lt;/code> 查看工作階段中的指令。下文中所有以 &lt;code>/&lt;/code> 開頭的指令都是在工作階段中執行的。&lt;/p>
&lt;h3 id="-引用檔案或資料夾">&lt;strong>📁 引用檔案或資料夾&lt;/strong>&lt;a class="anchor" href="#-%e5%bc%95%e7%94%a8%e6%aa%94%e6%a1%88%e6%88%96%e8%b3%87%e6%96%99%e5%a4%be">#&lt;/a>&lt;/h3>
&lt;p>在聊天視窗中，檔案名稱會有自動補全的效果，您可以按下 Tab 來進行路徑自動補全。&lt;/p>
&lt;p>只要告訴 Agent 需要讀取的檔案路徑，Agent 就會自動讀取檔案或資料夾中的資訊。&lt;/p>
&lt;p>除了手動引用，您還可以使用自訂智慧代理來設定 Agent 預設讀取的檔案。&lt;/p>
&lt;h3 id="-打斷-agent">&lt;strong>⏹️ 打斷 Agent&lt;/strong>&lt;a class="anchor" href="#-%e6%89%93%e6%96%b7-agent">#&lt;/a>&lt;/h3>
&lt;p>在 Agent 工作的過程中可以隨時使用 Ctrl+C 或者 Ctrl+D 來打斷 Agent 的工作。&lt;/p>
&lt;h3 id="-儲存工作階段和載入工作階段">&lt;strong>💾 儲存工作階段和載入工作階段&lt;/strong>&lt;a class="anchor" href="#-%e5%84%b2%e5%ad%98%e5%b7%a5%e4%bd%9c%e9%9a%8e%e6%ae%b5%e5%92%8c%e8%bc%89%e5%85%a5%e5%b7%a5%e4%bd%9c%e9%9a%8e%e6%ae%b5">#&lt;/a>&lt;/h3>
&lt;p>使用 &lt;code>/save xxx&lt;/code> 來儲存工作階段，使用 &lt;code>/load xxx.json&lt;/code> 來載入工作階段。&lt;/p></description></item><item><title>自訂智慧代理</title><link>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/custom-agents/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/custom-agents/</guid><description>&lt;h1 id="自訂智慧代理">&lt;strong>自訂智慧代理&lt;/strong>&lt;a class="anchor" href="#%e8%87%aa%e8%a8%82%e6%99%ba%e6%85%a7%e4%bb%a3%e7%90%86">#&lt;/a>&lt;/h1>
&lt;p>Kiro CLI 支援建立自訂智慧代理，讓您可以根據特定需求設定專門的開發助手。透過 JSON 設定檔，您可以定制 Agent 的行為、權限和預設上下文。&lt;/p>
&lt;h2 id="設定檔位置">&lt;strong>設定檔位置&lt;/strong>&lt;a class="anchor" href="#%e8%a8%ad%e5%ae%9a%e6%aa%94%e4%bd%8d%e7%bd%ae">#&lt;/a>&lt;/h2>
&lt;p>Kiro CLI 會把智慧代理的設定檔儲存在 &lt;code>~/.kiro/agents/*.json&lt;/code> 路徑中，您可以建立不同的 JSON 設定檔，從而建立自訂的智慧代理出來。&lt;/p>
&lt;p>完整設定可以參考&lt;a href="https://kiro.dev/docs/cli/custom-agents/">官方文件&lt;/a>&lt;/p>
&lt;h2 id="-自動上下文">&lt;strong>📚 自動上下文&lt;/strong>&lt;a class="anchor" href="#-%e8%87%aa%e5%8b%95%e4%b8%8a%e4%b8%8b%e6%96%87">#&lt;/a>&lt;/h2>
&lt;p>在自訂智慧代理的設定檔中，可以設定 resource 欄位，設定一些檔案路徑，這些路徑的檔案會被自動包含在聊天中。&lt;/p>
&lt;h3 id="預設設定">&lt;strong>預設設定&lt;/strong>&lt;a class="anchor" href="#%e9%a0%90%e8%a8%ad%e8%a8%ad%e5%ae%9a">#&lt;/a>&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">&amp;#34;resources&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://README.md&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://AGENTS.md&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://AmazonQ.md&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://.amazonq/rules/**/*.md&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://.kiro/steering/**/*.md&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;file://~/.kiro/steering/**/*.md&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>所以每次和 CLI 聊天時，它都會自動包含 README 檔案，對已有的專案有所了解。&lt;/p>
&lt;p>詳見&lt;a href="https://kiro.dev/docs/cli/steering/">官方文件&lt;/a>&lt;/p>
&lt;h2 id="-工具管理">&lt;strong>🔧 工具管理&lt;/strong>&lt;a class="anchor" href="#-%e5%b7%a5%e5%85%b7%e7%ae%a1%e7%90%86">#&lt;/a>&lt;/h2>
&lt;h3 id="-停用不需要的工具">&lt;strong>🚫 停用不需要的工具&lt;/strong>&lt;a class="anchor" href="#-%e5%81%9c%e7%94%a8%e4%b8%8d%e9%9c%80%e8%a6%81%e7%9a%84%e5%b7%a5%e5%85%b7">#&lt;/a>&lt;/h3>
&lt;p>自訂智慧代理的設定檔中，可以設定 tools 欄位，包含了啟用哪些 tools。如果您有不想使用的 tools，可以從列表中刪除。&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">&amp;#34;tools&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;fs_read&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;fs_write&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;execute_bash&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;@git&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;@rust-analyzer/check_code&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>比如，如果不希望 AI 修改本地檔案，可以停用 fs_write 工具和 execute_bash 工具。&lt;/p>
&lt;p>詳見&lt;a href="https://kiro.dev/docs/cli/custom-agents/configuration-reference/#tools-field">官方文件&lt;/a>&lt;/p>
&lt;h3 id="-信任工具的執行">&lt;strong>✅ 信任工具的執行&lt;/strong>&lt;a class="anchor" href="#-%e4%bf%a1%e4%bb%bb%e5%b7%a5%e5%85%b7%e7%9a%84%e5%9f%b7%e8%a1%8c">#&lt;/a>&lt;/h3>
&lt;p>自訂智慧代理的設定檔中，可以設定 allowedTools 欄位，包含了信任哪些 tools&lt;/p></description></item><item><title>常見問題</title><link>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/faq/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/faq/</guid><description>&lt;h1 id="kiro-cli-常見問題">&lt;strong>Kiro CLI 常見問題&lt;/strong>&lt;a class="anchor" href="#kiro-cli-%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c">#&lt;/a>&lt;/h1>
&lt;h2 id="基本使用問題">&lt;strong>基本使用問題&lt;/strong>&lt;a class="anchor" href="#%e5%9f%ba%e6%9c%ac%e4%bd%bf%e7%94%a8%e5%95%8f%e9%a1%8c">#&lt;/a>&lt;/h2>
&lt;h3 id="kiro-cli-如何查看我是付費版還是免費版">&lt;strong>Kiro CLI 如何查看我是付費版還是免費版？&lt;/strong>&lt;a class="anchor" href="#kiro-cli-%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8b%e6%88%91%e6%98%af%e4%bb%98%e8%b2%bb%e7%89%88%e9%82%84%e6%98%af%e5%85%8d%e8%b2%bb%e7%89%88">#&lt;/a>&lt;/h3>
&lt;p>登入後使用 &lt;code>kiro-cli whoami&lt;/code> 查看。Builder ID 是免費版，IAM Identity Center 是付費版&lt;/p>
&lt;h3 id="kiro-cli-如何登出">&lt;strong>Kiro CLI 如何登出？&lt;/strong>&lt;a class="anchor" href="#kiro-cli-%e5%a6%82%e4%bd%95%e7%99%bb%e5%87%ba">#&lt;/a>&lt;/h3>
&lt;p>使用 &lt;code>kiro-cli logout&lt;/code> 指令進行登出。&lt;/p>
&lt;h3 id="在-windows-上透過-wsl-的方式來使用-kiro-cli消耗多少資源">&lt;strong>在 Windows 上透過 WSL 的方式來使用 Kiro CLI，消耗多少資源？&lt;/strong>&lt;a class="anchor" href="#%e5%9c%a8-windows-%e4%b8%8a%e9%80%8f%e9%81%8e-wsl-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%be%86%e4%bd%bf%e7%94%a8-kiro-cli%e6%b6%88%e8%80%97%e5%a4%9a%e5%b0%91%e8%b3%87%e6%ba%90">#&lt;/a>&lt;/h3>
&lt;p>Windows 上透過 WSL 的方式來使用 Kiro CLI 使用的資源非常有限。在 Windows 上安裝 WSL 並且安裝 Kiro CLI 之後的記憶體開銷很小。&lt;/p>
&lt;p>&lt;img src="https://kiro-community.github.io/book-of-kiro/images/q_dev/wsl_resource_1.png" alt="" />
&lt;img src="https://kiro-community.github.io/book-of-kiro/images/q_dev/wsl_resource_2.png" alt="" />&lt;/p>
&lt;h3 id="有非互動式模式嗎">&lt;strong>有非互動式模式嗎？&lt;/strong>&lt;a class="anchor" href="#%e6%9c%89%e9%9d%9e%e4%ba%92%e5%8b%95%e5%bc%8f%e6%a8%a1%e5%bc%8f%e5%97%8e">#&lt;/a>&lt;/h3>
&lt;p>有。使用指令：&lt;code>kiro-cli chat --no-interactive --trust-all-tools&lt;/code>&lt;/p>
&lt;h3 id="可以在容器中用嗎">&lt;strong>可以在容器中用嗎？&lt;/strong>&lt;a class="anchor" href="#%e5%8f%af%e4%bb%a5%e5%9c%a8%e5%ae%b9%e5%99%a8%e4%b8%ad%e7%94%a8%e5%97%8e">#&lt;/a>&lt;/h3>
&lt;p>可以。參考 &lt;a href="https://github.com/DiscreteTom/auto-q/">auto-q 專案&lt;/a>&lt;/p>
&lt;h3 id="可以在-cicd-流水線裡用嗎">&lt;strong>可以在 CI/CD 流水線裡用嗎？&lt;/strong>&lt;a class="anchor" href="#%e5%8f%af%e4%bb%a5%e5%9c%a8-cicd-%e6%b5%81%e6%b0%b4%e7%b7%9a%e8%a3%a1%e7%94%a8%e5%97%8e">#&lt;/a>&lt;/h3>
&lt;p>請參考&lt;a href="https://aws.amazon.com/cn/blogs/china/using-amazon-q-developer-to-build-an-enterprise-automated-code-review-process/">相關部落格&lt;/a>在 GitLab 中進行設定，GitHub 等其他儲存庫可參考部落格中的流程。&lt;/p>
&lt;p>需要注意：由於 Amazon Q Developer CLI 升級到了 Kiro CLI，所以部落格中的檔案路徑 &lt;code>~/.local/share/amazon-q/&lt;/code> 應為 &lt;code>~/.local/share/kiro-cli&lt;/code>&lt;/p></description></item><item><title>疑難排解</title><link>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/troubleshooting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://kiro-community.github.io/book-of-kiro/zh-tw/kiro-cli/troubleshooting/</guid><description>&lt;h1 id="cli-疑難排解">&lt;strong>CLI 疑難排解&lt;/strong>&lt;a class="anchor" href="#cli-%e7%96%91%e9%9b%a3%e6%8e%92%e8%a7%a3">#&lt;/a>&lt;/h1>
&lt;h2 id="cli-常見錯誤及解決方案">&lt;strong>CLI 常見錯誤及解決方案&lt;/strong>&lt;a class="anchor" href="#cli-%e5%b8%b8%e8%a6%8b%e9%8c%af%e8%aa%a4%e5%8f%8a%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%a1%88">#&lt;/a>&lt;/h2>
&lt;h3 id="如何使用-githubgoogle-登入">&lt;strong>如何使用 GitHub/Google 登入&lt;/strong>&lt;a class="anchor" href="#%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-githubgoogle-%e7%99%bb%e5%85%a5">#&lt;/a>&lt;/h3>
&lt;p>執行 &lt;code>kiro-cli login&lt;/code> 後即可選擇是否透過 GitHub 或 Google 登入，並彈出系統瀏覽器完成登入過程。&lt;/p>
&lt;p>如果您使用沒有圖形介面的系統環境，執行 &lt;code>kiro-cli login&lt;/code> 則只會顯示 Builder ID 登入方式或企業登入方式，您可以選擇 Builder ID 使用電子郵件註冊登入&lt;/p>
&lt;h3 id="執行-mcp-tool-時報錯">&lt;strong>執行 MCP Tool 時報錯&lt;/strong>&lt;a class="anchor" href="#%e5%9f%b7%e8%a1%8c-mcp-tool-%e6%99%82%e5%a0%b1%e9%8c%af">#&lt;/a>&lt;/h3>
&lt;p>報錯：Improperly formed request 或 An unexpected error occurred&lt;/p>
&lt;p>通常是 MCP Tool 的描述格式不規範，特別是 &lt;code>input_schema&lt;/code> 欄位，需要嚴格保證為合法的 JSON Schema&lt;/p>
&lt;p>可以使用 &lt;code>/tools schema&lt;/code> 子指令查看 MCP Tool 的描述，確認 &lt;code>input_schema&lt;/code> 欄位是否合法&lt;/p>
&lt;h3 id="使用蘋果原生-terminal-時當機">&lt;strong>使用蘋果原生 Terminal 時當機&lt;/strong>&lt;a class="anchor" href="#%e4%bd%bf%e7%94%a8%e8%98%8b%e6%9e%9c%e5%8e%9f%e7%94%9f-terminal-%e6%99%82%e7%95%b6%e6%a9%9f">#&lt;/a>&lt;/h3>
&lt;p>建議使用 iTerm2 作為 Terminal 來使用 Kiro CLI。&lt;/p>
&lt;p>如果需要排查當機原因，可以嘗試使用&lt;a href="https://gist.github.com/DiscreteTom/601bdd428ccb4079eb5e01fb914769fd">此腳本&lt;/a>收集 Terminal 日誌後交給 Kiro CLI 來排查&lt;/p></description></item></channel></rss>