命令參考
stitch 命令列介面的全部命令參考
@google/stitch CLI 提供資源動詞(find、get、create、edit、delete、generate、open、url),以及畫布、擷取與設定相關指令。
標記為 工作區 的指令與資源需要先在你的電腦上執行一次
stitch enable loop。
| 指令 | 類別 | 適用範圍 |
|---|---|---|
stitch create | 資源 | 預設 |
stitch delete | 資源 | 預設 |
stitch edit | 資源 | 預設 |
stitch find | 資源 | 預設 |
stitch generate | 資源 | 預設 |
stitch get | 資源 | 預設 |
stitch capture | 操作與畫布 | 預設 |
stitch connect | 操作與畫布 | 工作區 |
stitch open | 操作與畫布 | 預設 |
stitch serve | 操作與畫布 | 預設 |
stitch upload | 操作與畫布 | 預設 |
stitch url | 操作與畫布 | 預設 |
stitch config | 驗證與設定 | 預設 |
stitch disable | 驗證與設定 | 預設 |
stitch enable | 驗證與設定 | 預設 |
stitch github | 驗證與設定 | 工作區 |
stitch login | 驗證與設定 | 預設 |
stitch logout | 驗證與設定 | 預設 |
stitch privacy | 驗證與設定 | 預設 |
stitch status | 驗證與設定 | 預設 |
stitch agent-skills | 進階 | 預設 |
stitch api | 進階 | 工作區 |
stitch mcp | 進階 | 預設 |
stitch cache | 其他 | 工作區 |
stitch download | 其他 | 預設 |
stitch feedback | 其他 | 預設 |
全域旗標
這些旗標適用於任何 stitch 指令:
| 旗標 | 型別 | 說明 |
|---|---|---|
--access-token | string | OAuth 2.0 存取權杖(環境變數:STITCH_ACCESS_TOKEN) |
--api-key | string | 為這次指令執行傳入 API 金鑰(旗標:–api-key,環境變數:STITCH_API_KEY) |
--base-url | string | API 基礎 URL(環境變數:STITCH_BASE_URL) |
--color | enum | 何時輸出 ANSI 色碼:auto、always 或 never(預設:auto) |
--debug | boolean | 顯示偵錯資訊,包括堆疊追蹤 |
--expand | boolean | 在詳細檢視中顯示完整內容(例如 context get、solutions get) |
--fields | string | 以逗號分隔的欄位遮罩 |
--format, -f | enum | 輸出格式:table、markdown、json 或 ndjson(預設:自動偵測) |
--json | boolean | 輸出 JSON |
--no-cache | boolean | 略過本機快取,一律從網路擷取 |
--quiet, -q | boolean | 抑制非必要的輸出與橫幅 |
--schema | boolean | 檢視內部結構:顯示結構定義(寫入)或欄位清單(讀取) |
--trace | boolean | 將原始 HTTP 網路追蹤與 cURL 重現輸出至 stderr |
--workspace, -w | string | 工作區 ID(執行「stitch find workspaces」以列出;環境變數:STITCH_WORKSPACE) |
環境變數
| 變數 | 說明 |
|---|---|
STITCH_API_KEY | 取代 OAuth 登入使用的 API 金鑰(與 --api-key 相同) |
STITCH_ACCESS_TOKEN | OAuth 2.0 存取權杖(與 --access-token 相同) |
STITCH_PROJECT_ID | 預設 Stitch 專案 ID(與 --project 相同) |
STITCH_WORKSPACE | 預設工作區 ID(與 --workspace 相同) |
STITCH_BASE_URL | API 基礎 URL(與 --base-url 相同) |
STITCH_CANVAS_URL | 用於所有產生之畫布連結的 Stitch 網頁主機(預設:https://stitch.google.com) |
STITCH_FORMAT | 預設輸出格式(與 --format 相同) |
STITCH_QUIET | 抑制非必要的輸出與橫幅(與 --quiet 相同) |
STITCH_NO_CACHE | 設為 1 以關閉本機快取 |
STITCH_NO_BROWSER | 絕不啟動瀏覽器;改為印出 URL |
結束代碼
| 代碼 | 意義 |
|---|---|
0 | 成功 |
1 | 操作失敗:網路、驗證或 API 錯誤 |
2 | 用法錯誤:未知的指令或旗標、缺少必要引數,或是無效的值或 JSON 承載內容 |
124 | stitch generate insights --watch 逾時(請參閱 --timeout) |
stitch create
建立 Stitch 資源
stitch create [resource] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 要建立的資源型別 |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--apply | boolean | 自動將建立的設計系統套用至專案中的螢幕(僅限 design-system) |
--autonomy-level | string | 自主層級:CREATE_SUGGESTIONS 或 CREATE_ASSETS(僅限 loop 資源) |
--description | string | 迴圈說明,或脈絡內容(僅限 loop 與 context 資源) |
--dry-run | boolean | 驗證承載內容並預覽變更,而不發出 API 呼叫 |
--interactive, -i | boolean | 從推薦的入門範本中選擇(僅限 loop 資源) |
--name | string | 工作區名稱(僅限 workspace 資源;也接受 --title) |
--objective | string | 迴圈目標陳述(僅限 loop 資源) |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
--provider | string | 來自「stitch find connections」的提供者 ID(例如 slack、linear)(僅限 connection 資源) |
--screen | string | 要套用所建立設計系統的螢幕 ID(以逗號分隔)(僅限 design-system) |
--template, -t | string | 用於建立的範本 ID、標題或從 1 開始的索引(僅限 loop 資源) |
--templates | boolean | 列出推薦的入門範本,而不建立任何項目(僅限 loop 資源) |
--title | string | 專案標題,或脈絡標籤(僅限 project 與 context 資源) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
design-system | 預設 | 套用至已產生螢幕的共用視覺語言。 |
workspace | 工作區 | 與 Stitch 配對的儲存庫,容納其迴圈、洞察與脈絡。 |
context | 工作區 | 附加至工作區的外部素材,讓 Stitch 能推論程式碼以外的更多資訊。 |
skill | 工作區 | 形塑 Stitch 代理程式如何讀取工作區的指示。與「stitch agent-skills」不同,後者會寫入本機 SKILL.md 檔案。 |
loop | 工作區 | 常設指令:一個目標加上 Stitch 持續依循處理的自主層級。 |
webhook | 工作區 | 工作區事件發生時觸發的 HTTP 回呼。 |
connection | 工作區 | 將工作區連結至 Slack 或 MCP 伺服器等外部工具的整合(GitHub 則透過「stitch github install」連結)。 |
範例
stitch create project --title "Checkout Redesign"
stitch create workspace --name "Acme Web App"
stitch create loop --workspace <workspace-id> --template ui-prototyping
stitch create context --workspace <workspace-id> --title "Q3 Metrics" --description "Weekly active users grew 12% quarter over quarter."
stitch create connection --workspace <workspace-id> --provider slack
若要從 DESIGN.md 檔案建立設計系統,請使用 stitch upload design。
stitch delete
依 ID 刪除 Stitch 資源
stitch delete [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 要刪除的資源型別 |
id | false | 要刪除的資源 ID(或 --id) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--dry-run | boolean | 驗證承載內容並預覽刪除,而不發出 API 呼叫 |
--force | boolean | 強制刪除,無需確認 |
--id | string | 要刪除的資源 ID |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
--yes, -y | boolean | 略過確認提示 |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
workspace | 工作區 | 與 Stitch 配對的儲存庫,容納其迴圈、洞察與脈絡。 |
context | 工作區 | 附加至工作區的外部素材,讓 Stitch 能推論程式碼以外的更多資訊。 |
file | 工作區 | 上傳至工作區的個別檔案。 |
skill | 工作區 | 形塑 Stitch 代理程式如何讀取工作區的指示。與「stitch agent-skills」不同,後者會寫入本機 SKILL.md 檔案。 |
loop | 工作區 | 常設指令:一個目標加上 Stitch 持續依循處理的自主層級。 |
webhook | 工作區 | 工作區事件發生時觸發的 HTTP 回呼。 |
connection | 工作區 | 將工作區連結至 Slack 或 MCP 伺服器等外部工具的整合(GitHub 則透過「stitch github install」連結)。 |
範例
stitch delete project <project-id> --force
stitch delete loop <loop-id> --workspace <workspace-id> --force
stitch delete context <context-id> --workspace <workspace-id> --force
在非互動式終端機中,除非傳入 --yes(或 --force),否則 stitch delete 會失敗,因此在指令碼與 CI 中請一併加入。
stitch edit
更新 Stitch 資源的可變更欄位
stitch edit [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 要編輯的目標資源型別 |
id | false | 目標資源 ID(或可重複的 –id <id>) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--add-repo | string | 將儲存庫新增至工作區(URL、owner/repo 簡寫或 ID) |
--design-system | string | 要套用至目標螢幕的設計系統資產 ID |
--device | string | 目標螢幕的裝置型別(DESKTOP 或 MOBILE) |
--dry-run | boolean | 驗證承載內容並預覽變更,而不發出 API 呼叫 |
--model | string | 用於 Stitch 螢幕編輯的模型(GEMINI_3_8_FLASH 或 GEMINI_3_5_FLASH_LITE) |
--objective | string | 新的目標。目標不可變更,因此這會以新的 ID 建立新的迴圈來取代原迴圈(僅限 loop 資源) |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
--prompt | string | 用於 Stitch 螢幕編輯的藝術指導提示詞 |
--remove-repo | string | 從工作區移除儲存庫(URL、owner/repo 簡寫或 ID) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
design-system | 預設 | 套用至已產生螢幕的共用視覺語言。 |
workspace | 工作區 | 與 Stitch 配對的儲存庫,容納其迴圈、洞察與脈絡。 |
context | 工作區 | 附加至工作區的外部素材,讓 Stitch 能推論程式碼以外的更多資訊。 |
file | 工作區 | 上傳至工作區的個別檔案。 |
skill | 工作區 | 形塑 Stitch 代理程式如何讀取工作區的指示。與「stitch agent-skills」不同,後者會寫入本機 SKILL.md 檔案。 |
loop | 工作區 | 常設指令:一個目標加上 Stitch 持續依循處理的自主層級。 |
webhook | 工作區 | 工作區事件發生時觸發的 HTTP 回呼。 |
範例
stitch edit screen <screen-id> --project <project-id> --prompt "Switch to a compact header"
stitch edit screen <screen-id> --project <project-id> --design-system <design-system-id>
stitch edit workspace <workspace-id> --add-repo <owner>/<repo>
stitch edit loop <loop-id> --workspace <workspace-id> --json '{"description":"Focus on mobile schedule views"}'
stitch find
尋找符合篩選條件的 Stitch 資源
stitch find [resource] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 要尋找的資源型別 |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--filter | string | 篩選運算式 |
--insight | string | 依洞察 ID 篩選(或以逗號分隔的洞察 ID) |
--limit | string | 結果數量上限 |
--loop | string | 依迴圈 ID 篩選(或以逗號分隔的迴圈 ID) |
--page-size | string | 向 API 要求的每頁項目數量上限 |
--page-token | string | 用於擷取下一頁結果的權杖 |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
design-system | 預設 | 套用至已產生螢幕的共用視覺語言。 |
workspace | 工作區 | 與 Stitch 配對的儲存庫,容納其迴圈、洞察與脈絡。 |
context | 工作區 | 附加至工作區的外部素材,讓 Stitch 能推論程式碼以外的更多資訊。 |
file | 工作區 | 上傳至工作區的個別檔案。 |
skill | 工作區 | 形塑 Stitch 代理程式如何讀取工作區的指示。與「stitch agent-skills」不同,後者會寫入本機 SKILL.md 檔案。 |
loop | 工作區 | 常設指令:一個目標加上 Stitch 持續依循處理的自主層級。 |
webhook | 工作區 | 工作區事件發生時觸發的 HTTP 回呼。 |
insight | 工作區 | Stitch 依據迴圈挖掘你的程式碼庫時,所發現的特定且錨定於路由的最佳化機會。 |
solution | 工作區 | 回應某項洞察的建議變更。 |
connection | 工作區 | 將工作區連結至 Slack 或 MCP 伺服器等外部工具的整合(GitHub 則透過「stitch github install」連結)。 |
organization | 工作區 | 你的組織設定與 GitHub App 安裝。 |
範例
stitch find projects --limit 10
stitch find screens --project <project-id>
stitch find design-systems
stitch find loops --workspace <workspace-id>
stitch find insights --workspace <workspace-id> --loop <loop-id>
stitch generate
觸發 Stitch 螢幕、變體、洞察或解決方案的生成式建立
stitch generate [resource] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 要產生的資源型別(screen、variants、insights、solutions) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--aspects | string | 要以逗號分隔的變化層面(LAYOUT、COLOR_SCHEME、IMAGES、TEXT_FONT、TEXT_CONTENT) |
--count | string | 要產生的變體數量(1-5) |
--creative-range | string | 變體偏離來源的程度(REFINE、EXPLORE、REIMAGINE) |
--delay | boolean | 延後執行洞察產生 |
--device, -d | string | 目標螢幕的裝置型別(DESKTOP 或 MOBILE) |
--dry-run | boolean | 驗證承載內容並預覽動作,而不呼叫後端 |
--insight | string | 用於產生解決方案的洞察 ID 或以逗號分隔的洞察 ID |
--interval | string | 搭配 –watch 時,輪詢間隔的毫秒數(預設:2000,佇列等待期間最高可達 60000) |
--loop | string | 用於產生洞察的迴圈 ID 或以逗號分隔的迴圈 ID |
--model | string | 產生用模型 ID(GEMINI_3_8_FLASH 或 GEMINI_3_5_FLASH_LITE) |
--new-project | string | 建立可選標題的新 Stitch 專案 |
--notify | boolean | 搭配 –watch 時,在結束時傳送桌面通知 |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
--prompt | string | 用於螢幕或變體產生的藝術指導提示詞 |
--replace-existing | boolean | 產生解決方案時,取代現有未指派的解決方案 |
--screen | string | 用於變體產生的來源螢幕 ID |
--timeout | string | 搭配 –watch 時,放棄前等待的秒數(預設:3600) |
--title | string | 在提示詞中要求的螢幕標題(Stitch 可能另選標題;若如此會顯示警告)。搭配 –new-project 且未指定 –project 時,則改為命名新專案 |
--watch | boolean | 等待洞察產生完成。結束代碼:0 已完成、1 失敗、124 逾時 |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
variant | 預設 | 從現有 Stitch 螢幕產生的設計變體。 |
insight | 工作區 | Stitch 依據迴圈挖掘你的程式碼庫時,所發現的特定且錨定於路由的最佳化機會。 |
solution | 工作區 | 回應某項洞察的建議變更。 |
範例
stitch generate screen --project <project-id> --prompt "Minimalist vinyl music player"
stitch generate screen --new-project "Mobile Onboarding" --prompt "Sign-up step with email verification" --device MOBILE
stitch generate variants --screen <screen-id> --project <project-id> --count 2 --creative-range EXPLORE --prompt "Try warm editorial typography"
stitch generate insights --workspace <workspace-id> --loop <loop-id> --watch
stitch get
依 ID 取得 Stitch 資源,或評估診斷狀態 FSM(流程:stitch status –flow)
stitch get [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 資源型別(或診斷 FSM 用的「status」) |
id | false | 資源 ID |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
design-system | 預設 | 套用至已產生螢幕的共用視覺語言。 |
status | 預設 | 工作區的 11 種狀態導入與診斷狀態機。 |
workspace | 工作區 | 與 Stitch 配對的儲存庫,容納其迴圈、洞察與脈絡。 |
context | 工作區 | 附加至工作區的外部素材,讓 Stitch 能推論程式碼以外的更多資訊。 |
file | 工作區 | 上傳至工作區的個別檔案。 |
skill | 工作區 | 形塑 Stitch 代理程式如何讀取工作區的指示。與「stitch agent-skills」不同,後者會寫入本機 SKILL.md 檔案。 |
loop | 工作區 | 常設指令:一個目標加上 Stitch 持續依循處理的自主層級。 |
webhook | 工作區 | 工作區事件發生時觸發的 HTTP 回呼。 |
insight | 工作區 | Stitch 依據迴圈挖掘你的程式碼庫時,所發現的特定且錨定於路由的最佳化機會。 |
solution | 工作區 | 回應某項洞察的建議變更。 |
connection | 工作區 | 將工作區連結至 Slack 或 MCP 伺服器等外部工具的整合(GitHub 則透過「stitch github install」連結)。 |
organization | 工作區 | 你的組織設定與 GitHub App 安裝。 |
範例
stitch get project <project-id>
stitch get screen <screen-id> --project <project-id>
stitch get design-system <asset-id>
stitch get loop <loop-id> --workspace <workspace-id>
stitch capture
將頁面擷取為供畫布使用的自包含 HTML:stitch capture <url|path> [-o file],或使用 --tab 擷取已開啟的分頁
stitch capture [target] [flags]
stitch capture <subcommand> [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
target | false | 要載入並擷取的 URL,或本機 HTML 檔案的路徑(使用 –tab 時省略) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--allow-redirect | boolean | 即使頁面最後停留在與要求不同的路由,仍儲存該頁面 |
--auth | string | 登入狀態檔案(Playwright storageState JSON) |
--origin | string | 若為檔案:提供其根相對資產的來源(例如 http://localhost:3000) |
--output, -o | string | HTML 的儲存位置(預設:.stitch/captures/<route>.html;「-」會輸出至標準輸出) |
--prepare | string | 擷取前在頁面內執行之 JS 檔案的路徑(登入、預先填入狀態)。以 __stitchWaitFor("#selector") 等待應用程式狀態 |
--settle-timeout | string | 等待載入指示(骨架畫面、aria-busy、轉圈動畫)消失的最長毫秒數(預設:15000) |
--tab | string | 依原樣擷取已開啟的 chrome-devtools 分頁,而不載入 URL(選用分頁 ID) |
--wait-for | string | 擷取前要等待的 CSS 選擇器(確保動態 DOM 已轉譯) |
--wait-until | string | 水合屏障條件:networkidle0(預設)、networkidle2、load、domcontentloaded |
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
capture browser | 預設 | (進階)在 Chrome 中擷取 URL,或使用 –tab 擷取已開啟的分頁。與 stitch capture <url> 相同 |
capture port | 預設 | (進階)透過 HTTP 擷取伺服器端轉譯的 HTML,而不執行 JavaScript |
capture file | 預設 | (進階)讓本機 HTML 檔案或標準輸入成為自包含檔案。與 stitch capture <path> 相同 |
capture routes | 預設 | 列出程式碼庫中找到的應用程式路由 |
範例
stitch capture http://localhost:3000/library
stitch capture --tab --output .stitch/dashboard.html
stitch capture .stitch/page.html --origin http://localhost:3000
stitch capture http://localhost:3000/studio --auth .stitch/storage.json
stitch capture routes
stitch connect
透過提供者 OAuth 流程將工具或整合連線至工作區
需要先透過
stitch enable loop啟用工作區功能。
stitch connect [toolId] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
toolId | false | 工具或提供者 ID(例如 github、slack)。省略,或傳入 –list 以查看可用選項。 |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--all | boolean | 列出所有可用的整合,不限制於前 25 個熱門項目 |
--connected | boolean | 僅顯示已連線的整合 |
--list, -l | boolean | 列出可連線的可用工具與提供者 ID |
--no-browser | boolean | 不要自動啟動瀏覽器 |
--search, -s | string | 依 ID、顯示名稱或說明篩選整合 |
--timeout | string | 等待連線的逾時秒數(預設:120) |
stitch open
在瀏覽器中開啟 Stitch 專案或螢幕(僅限 project | screen)
stitch open [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 目標資源型別(「project」 |
id | false | 專案或螢幕 ID、projects/<p>/screens/<s> 名稱或畫布 URL(預設:此目錄的專案或參考螢幕) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
--url, -print | boolean | 印出 URL 而不開啟(環境變數:STITCH_NO_BROWSER、BROWSER) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
範例
stitch open project <project-id>
stitch open screen <screen-id> --project <project-id>
stitch serve
為 Stitch 專案螢幕啟動本機預覽開發伺服器
stitch serve [flags]
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--dry-run | boolean | 驗證伺服器設定而不進入封鎖等待 |
--port | string | 要接聽的本機連接埠(預設:3000) |
--project, -p | string | 要預覽的 Stitch 專案 ID |
stitch upload
上傳檔案、程式碼庫封存檔或設計資產
stitch upload <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
upload code | 工作區 | 上傳程式碼庫封存檔(.zip 或目錄) |
upload design | 預設 | 將 DESIGN.md 檔案上傳至 Stitch 畫布專案 |
upload file | 工作區 | 將檔案上傳至工作區(.md 與 .txt 檔案會儲存為脈絡) |
upload screen | 預設 | 將 HTML 或圖片檔案上傳為 Stitch 畫布上的螢幕 |
子指令旗標
| 子指令 | 旗標 | 型別 | 說明 |
|---|---|---|---|
upload code | --name, -n | string | 上傳之程式碼庫封存檔的顯示名稱 |
upload code | --description | string | 上傳之程式碼庫的說明 |
upload code | --dry-run | boolean | 預覽變更而不實際執行 |
upload design | --project, -p | string | 目標 Stitch 畫布專案 ID(預設為資訊清單專案 ID) |
upload design | --apply | boolean | 自動將上傳的設計系統套用至專案中的螢幕 |
upload design | --screen | string | 要套用上傳設計系統的螢幕 ID(以逗號分隔) |
upload design | --cwd | string | 目標工作目錄脈絡 |
upload design | --dry-run | boolean | 驗證承載內容並預覽上傳,而不發出 API 呼叫 |
upload file | --name, -n | string | 上傳檔案的顯示名稱 |
upload file | --description | string | 檔案說明 |
upload file | --mime-type, -m | string | 檔案的 MIME 型別(省略時依副檔名推斷) |
upload file | --dry-run | boolean | 預覽變更而不實際執行 |
upload screen | --project, -p | string | 目標 Stitch 畫布專案 ID(預設為已連結的專案) |
upload screen | --title | string | 螢幕標題(預設:檔案名稱) |
upload screen | --route | string | 將此螢幕記錄為資訊清單中此路由的參考螢幕 |
upload screen | --cwd | string | 目標工作目錄脈絡 |
upload screen | --dry-run | boolean | 驗證上傳而不呼叫 Stitch |
範例
stitch upload design DESIGN.md --project <project-id> --apply
stitch upload screen .stitch/checkout.html --route /checkout --title Checkout
stitch upload file ./docs/architecture.pdf --name "Architecture Doc"
stitch upload code .
stitch url
印出專案或螢幕的標準 Stitch 畫布網頁 URL(切勿猜測 URL)
stitch url [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 目標資源型別(「project」 |
id | false | 專案或螢幕 ID、projects/<p>/screens/<s> 名稱或畫布 URL(預設:此目錄的專案或參考螢幕) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
支援的資源
| 資源 | 適用範圍 | 說明 |
|---|---|---|
project | 預設 | 存放已產生螢幕的 Stitch 畫布。 |
screen | 預設 | Stitch 畫布上的單一已產生設計。 |
範例
stitch url project <project-id>
stitch url screen <screen-id> --project <project-id>
stitch config
讀取及寫入 Stitch CLI 設定
stitch config <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
config list | 預設 | 顯示沿完整優先順序鏈解析後的設定(--global 僅顯示全域設定) |
config get | 預設 | 依索引鍵取得單一設定值 |
config set | 預設 | 設定某個設定值(寫入 .stitch.json;--global 會寫入 ~/.stitch.json) |
config unset | 預設 | 移除設定索引鍵(--global 會從 ~/.stitch.json 移除) |
stitch disable
全域停用實驗性功能(例如「stitch disable loop」)
stitch disable [feature] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
feature | false | 要全域停用的實驗性功能(例如 loop) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--dry-run | boolean | 預覽變更而不實際執行 |
stitch enable
全域啟用實驗性功能(例如「stitch enable loop」)
stitch enable [feature] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
feature | false | 要全域啟用的實驗性功能:loop(啟用 api、connect 等工作區指令,以及 workspaces、loops 等資源) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--dry-run | boolean | 預覽變更而不實際執行 |
stitch github
管理 GitHub 帳戶連線、OAuth 授權,以及 GitHub App 組織安裝
需要先透過
stitch enable loop啟用工作區功能。
stitch github <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
github login | 工作區 | 向 GitHub 驗證身分(開啟瀏覽器 OAuth 授權頁面)。別名:github auth。傳入 --reauth 可強制重新驗證 |
github install | 工作區 | 設定 GitHub App 組織安裝與儲存庫存取權限。別名:github configure |
github status | 工作區 | 檢查 GitHub 整合狀態、已連結的組織與可存取的儲存庫 |
github repos | 工作區 | 列出 Stitch GitHub App 可存取、可附加至工作區的 GitHub 儲存庫 |
stitch login
使用 Google OAuth 2.0 PKCE 驗證,或儲存永久 API 金鑰
stitch login [flags]
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--port | string | 本機回送回呼連接埠(預設:8085) |
stitch logout
登出並移除本機 OAuth 憑證與已儲存的 API 金鑰
stitch logout [flags]
stitch privacy
管理及檢視 Stitch 隱私權公告與服務條款確認狀態
stitch privacy <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
privacy status | 預設 | 檢查伺服器上目前的隱私權公告確認狀態 |
privacy accept | 預設 | 在網頁上開啟 Stitch 服務條款,並等待接受 |
privacy show | 預設 | 顯示 Stitch 隱私權公告與服務條款的網頁 URL(--open 會在瀏覽器中開啟) |
stitch status
顯示驗證、畫布憑證與 GitHub 狀態,或以 –flow 評估導入流程
stitch status [flowArg] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
flowArg | false | 要評估的選用流程(design |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--cwd | string | 評估流程時使用的工作目錄 |
--flow | string | 評估導入流程並傳回其目前步驟(design |
--token | boolean | 印出有效的 OAuth Bearer 存取權杖(過期時會自動重新整理) |
stitch agent-skills
安裝及更新本機 Stitch 代理程式技能。工作區技能請使用「stitch find skills」
stitch agent-skills <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
agent-skills add | 預設 | 為目前模式安裝 Stitch 代理程式技能 |
agent-skills list | 預設 | 顯示目前模式,以及 Stitch 技能的安裝位置 |
agent-skills update | 預設 | 將已安裝的 Stitch 技能重新同步至目前模式與 CLI 版本 |
子指令旗標
| 子指令 | 旗標 | 型別 | 說明 |
|---|---|---|---|
add | --project, -p | boolean | 安裝至此專案的 .agents/skills(預設) |
add | --user, -u | boolean | 安裝至 ~/.agents/skills,供所有專案使用(別名:--global、-g) |
add | --dir | string | 此專案內的技能目錄(搭配 -u 時則為個人主目錄內) |
add, list, update | --target | string | 目標用戶端:claude、antigravity 或 all |
add | --overwrite | boolean | 取代非由 CLI 安裝的現有 stitch 資料夾(原始內容會備份) |
update | --overwrite | boolean | 取代本機編輯過的技能檔案(會保留備份) |
add, update | --dry-run | boolean | 預覽變更而不實際執行 |
stitch api
對 Stitch 端點執行直接 REST API 呼叫,或檢視 OpenAPI/Discovery 結構定義
需要先透過
stitch enable loop啟用工作區功能。
stitch api [path] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
path | false | API 端點路徑或 Discovery 方法 ID(例如 /v2alpha/workspaces 或 workspaces.list) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--dryRun | boolean | 驗證承載內容並預覽請求,而不發出 API 呼叫 |
--filter | string | 依關鍵字或條件篩選項目 |
--force | boolean | 強制執行,無需確認 |
--method, -X | string | HTTP 方法(GET、POST、PATCH、PUT、DELETE)(預設:GET) |
--yes, -y | boolean | 略過確認提示 |
stitch mcp
管理及執行 Stitch MCP 伺服器
stitch mcp <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
mcp start | 預設 | 透過 stdio 啟動 Stitch MCP 伺服器。別名:mcp run |
mcp install | 預設 | 在你的 AI 編輯器中註冊 Stitch MCP 伺服器 |
子指令旗標
| 子指令 | 旗標 | 型別 | 說明 |
|---|---|---|---|
install | --target | string | 目標用戶端:antigravity、claude、cursor、vscode 或 all(預設:all) |
install | --dry-run | boolean | 預覽變更而不實際執行 |
stitch cache
檢視及清理洞察、解決方案與其他唯讀資源的本機快取
需要先透過
stitch enable loop啟用工作區功能。
stitch cache <subcommand> [flags]
子指令
| 子指令 | 適用範圍 | 說明 |
|---|---|---|
cache stats | 工作區 | 顯示本機快取內容:項目、大小、資源型別,以及中斷寫入留下的檔案 |
cache prune | 工作區 | 移除中斷快取寫入留下的檔案;搭配 --max-bytes 時,也會淘汰最久未使用的項目 |
除非傳入 --workspace,否則兩個子指令都涵蓋所有工作區的快取。
stitch download
從 Stitch 螢幕下載 HTML 與截圖圖片成品
stitch download [resource] [id] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
resource | false | 目標資源型別(「screen」) |
id | false | 螢幕 ID 或資源名稱 |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--format, -f | enum | 成品或輸出格式:html、png、jpg、jpeg、image、json、table、markdown 或 ndjson |
--html | boolean | 下載螢幕 HTML 承載內容 |
--image, -screenshot | boolean | 下載螢幕擷取圖片(PNG/JPEG) |
--output, -o | string | 輸出檔案或目錄路徑(省略時將原始成品位元組寫入標準輸出) |
--project, -p | string | Stitch 專案 ID(執行「stitch find projects」以列出;環境變數:STITCH_PROJECT_ID) |
範例
stitch download screen <screen-id> --project <project-id>
stitch download screen <screen-id> --project <project-id> --format png
stitch download screen <screen-id> --project <project-id> --html --image --output ./screens
stitch feedback
提交產品意見回饋或建立 Listnr 工單
stitch feedback [message] [flags]
位置引數
| 引數 | 必填 | 說明 |
|---|---|---|
message | false | 意見回饋文字(開頭的選用「submit」會予以忽略) |
指令旗標
也接受所有全域旗標。
| 旗標 | 型別 | 說明 |
|---|---|---|
--description | string | 意見回饋文字說明 |
--dry-run | boolean | 預覽意見回饋承載內容而不提交 |
--product-data, -data | string | 選用的產品中繼資料,格式為 JSON 或 key=value,key2=val2 |
--screenshot | string | 要附加的螢幕擷取圖片檔案路徑 |
--sentiment | string | 情緒評分:positive、negative 或 unspecified |
範例
stitch feedback "Loving the CLI"
stitch feedback --description "Loving the CLI tool" --sentiment positive
原文: https://stitch.withgoogle.com/docs/cli/reference/commands/
本頁翻譯自 Google Stitch 官方文件,原文版權歸 Google LLC 所有。本站為獨立第三方翻譯,與 Google 無關聯。