Skip to content

Support non-interactive mode for mcs pack update #323

@bguidolim

Description

@bguidolim

Problem

mcs pack update may prompt for interactive trust approval when packs contain new or modified scripts (PackTrustManager.promptForTrust). This makes it impossible to run from within Claude Code or any non-interactive environment (CI, automation, hooks).

Currently the SessionStart update hook can detect available updates but cannot apply pack updates — it must direct users to a separate terminal.

Proposal

Add a flag (e.g., --skip-untrusted) to mcs pack update that enables non-interactive operation:

  • Packs with no new/modified scripts → update normally (no trust prompt needed)
  • Packs with new/modified scripts → skip the update and report which packs were skipped and why

This allows Claude Code (and other automation) to handle the common case (no script changes) automatically, while safely deferring trust-sensitive updates to the user.

Alternative considered

A --trust / --yes flag that auto-approves trust — rejected because it bypasses a security boundary. Users should explicitly review new scripts.

Affected code

  • Sources/mcs/Sync/PackUpdater.swiftupdateGitPack() calls trustManager.promptForTrust()
  • Sources/mcs/ExternalPack/PackTrustManager.swiftpromptForTrust() uses interactive askYesNo
  • Sources/mcs/Commands/PackCommand.swiftUpdatePack subcommand
  • Sources/mcs/Core/UpdateChecker.swiftbuildContextString() hook directive (could run the update directly if non-interactive mode existed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions