usage

Antigravity 1.1.8

工具與目錄
在這頁

新功能 3 項

01

命令列輸出能直接交給程式接手

把命令列工具接進 CI(自動跑測試與部署的流程)時,最怕它只吐一大段人看得懂、程式卻接不住的文字。現在在 -p 後加 --output-format json 或 --output-format stream-json,就能拿到結構化輸出;--help 也找得到。選 stream-json 時,結果會像接力直播:一開始送出 init,每一步送 step_update,最後才送 result,不必等整趟工作結束。每個事件有固定的 step_type;工具呼叫才會附工具名稱、參數與輸出。如果有委派子代理,也帶上對話 ID 與紀錄位置。想固定答案格式,可加 --json-schema,給規格或檔案路徑。輸出的使用量也多了 cache_read_tokens,看得出有多少 token 命中快取(把先前結果暫存再利用)。

官方原文

Print mode (-p / --print) now supports structured, machine-readable output via the --output-format flag (text (default), json, or stream-json), so headless runs in CI, eval harnesses, and scripts can consume the CLI's output programmatically; these flags are now discoverable in --help.

Added the stream-json output format: a strongly-typed NDJSON event stream that emits typed init, step_update, and terminal result events with a stable, closed-vocabulary step_type discriminator, so consumers receive progress incrementally instead of waiting for the whole run to finish.

Added the --json-schema flag to enforce a custom JSON schema on the structured output, accepting either an inline schema string or a path to a schema file; for stream-json the schema applies to the final result event.

Enriched the structured stream with a tool_info object for each tool call (canonical tool name, parameters, and output) and a subagent_info payload for delegated subagents (including conversation_id and log_uri) so consumers can correlate child trajectories.

The JSON usage object emitted by json and stream-json now reports token accounting including cache_read_tokens, so non-interactive consumers can attribute prompt-cache hits.

02

選取文字要不要自動複製,自己決定

你在終端機裡拖曳選取一段結果,原本只是想看清楚,鬆開滑鼠卻可能把內容自動塞進剪貼簿,甚至弄壞特定資料。現在 TUI(終端機裡用文字畫出的互動介面)的 altscreen 呈現模式新增 copyOnSelect,預設開啟:選取後放開滑鼠便會複製。它像影印機自動送紙,省掉按複製,卻不適合每種紙張。若你貼上後發現內容怪掉,打開 /settings,把 copyOnSelect 關閉,就只保留選取、不再自動複製。

官方原文

Added a copyOnSelect setting (default on, toggleable in /settings) that controls whether releasing a mouse text-selection auto-copies it to the system clipboard in the TUI's altscreen rendering mode; disable it to stop the automatic copy on release — useful when the auto-copy is unwanted or corrupts certain payloads.

03

常用串接指令核准一次就夠

你每天都要更新專案,輸入 git fetch && git rebase 後又得重複核准,流程像同一張通行證每天重新蓋章。現在可以把這條完全相同的串接指令存成「永遠允許」規則。下次再跑同一條指令時,不必再等,權限確認不會重跳。它認的是整串命令,不是看到 git 就一概放行;因此常用流程少一步,其他不同命令仍各自檢查。

官方原文

Improved compound-command permissions so an exact chained command (such as git fetch && git rebase) can be saved as an allow-always rule and no longer re-prompts on the next identical run.