github / github/copilot-cli

Add a CLI flag to temporarily trust a workspace in non-interactive sessions (e.g. --temporarily-trust-workspace)

オープン
#4,878 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

triage
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

Describe the feature or problem you'd like to solve

Workspace .mcp.json config is only honored once a workspace has been marked "trusted," and the only way to grant that trust today is by starting an interactive session and answering "Yes" to the trust prompt. There is currently no way to trust a workspace from a non-interactive (-p) session, a scripted/CI environment, or any headless context. This was confirmed by a maintainer on #4542: workspace .mcp.json loading was fixed in 1.0.85, but only takes effect if the workspace is already trusted, and there's no CLI-only way to establish that trust. This makes committed, repo-scoped .mcp.json files effectively unusable in automated or headless workflows (CI pipelines, containers, scripted invocations) even though the underlying loading bug is fixed, because there's no non-interactive path to the trust step.

Proposed solution

Add a flag (e.g. --temporarily-trust-workspace, name open to maintainer preference) that grants the current working directory workspace trust for the duration of that single invocation, without requiring the interactive TUI trust prompt.

This would let users and CI systems opt into trusting a specific workspace explicitly and auditably per-invocation, rather than requiring either a persisted trust decision made interactively beforehand, or the --additional-mcp-config workaround that duplicates the already-committed .mcp.json.

Benefits:

  • Unblocks CI/automation and headless use of workspace-scoped .mcp.json
  • Avoids requiring users to persist trust ahead of time via the interactive flow
  • Avoids the --additional-mcp-config duplication workaround
  • Keeps trust explicit and scoped to one invocation, rather than silently trusting all workspaces
Example prompts or workflows
  1. CI pipeline step: copilot --temporarily-trust-workspace --allow-all-tools -p "Run the test suite and summarize failures" — using the repo's committed .mcp.json without a prior interactive trust step.

  2. Docker/headless container: running scripted copilot -p "..." invocations where no TTY is available to answer the interactive trust prompt.

  3. One-off automation script that clones a repo, trusts it for a single non-interactive Copilot invocation, and never persists that trust decision to the user's config.

Additional context

#4542

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、非対話型の -p セッションで workspace の信頼プロンプトがどのように処理されるか、また workspace .mcp.json の読み込みが信頼にどのように依存するかを追跡します。関連するコンテキストについては issue #4542 を確認してください。完了の条件は、文書化された flag によって1回の invocation に対する信頼を付与でき、TTY なしでコミット済みの workspace 設定を読み込め、かつ信頼の決定が永続化されないことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
58/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。