[Feature Request] Support extraKnownMarketplaces in headless/print mode for CI/CD workflows
Summary
The extraKnownMarketplaces setting in project-level .claude/settings.json does not work in headless/print mode (-p), making it impossible to use for CI/CD automation.
Current Behavior
According to the documentation:
"When team members trust the repository folder, Claude Code automatically installs these marketplaces and any plugins specified in the enabledPlugins field."
However, in print mode (-p), the trust dialog is skipped (as documented), which means:
- The
extraKnownMarketplacesprocessing never triggers - Project-defined marketplaces are completely invisible to plugin commands
claude plugin marketplace listonly shows user-level marketplaces from~/.claude/plugins/known_marketplaces.json
Evidence
Detailed investigation with reproduction steps: https://gist.github.com/alexey-pelykh/566a4e5160b305db703d543312a1e686
Key findings:
claude plugin marketplace listignores projectextraKnownMarketplaces--setting-sources user,project,localflag has no effect on plugin subcommands- Manually setting
hasTrustDialogAccepted: truein~/.claude.jsondoesn't trigger auto-installation - The auto-install logic is tied to the interactive trust dialog event handler
Proposed Solution
Add a CLI flag to enable processing of project settings in headless mode, for example:
claude -p --trust-project-settings "prompt"
Or support a flag specifically for plugin subcommands:
claude plugin --trust-project-settings marketplace list
This would:
- Process
extraKnownMarketplacesfrom project.claude/settings.json - Auto-install defined marketplaces (as happens in interactive mode)
- Process
enabledPluginsif present
Use Case
Teams want to:
- Define plugin marketplaces in their repository's
.claude/settings.json - Have CI/CD workflows automatically use those marketplaces
- Ensure consistent plugin availability across team members and automation
Current Workarounds
- Use
claude plugin marketplace add ./explicitly in CI - Pre-populate
~/.claude/plugins/known_marketplaces.json - Use GitHub Action's
plugin_marketplacesinput
These workarounds defeat the purpose of having repository-level configuration.
Environment
- Claude Code version: 2.0.58
- Platform: Linux (GitHub Actions), macOS
Related
This is related to the trust dialog behavior documented in the -p flag help:
"The workspace trust dialog is skipped when Claude is run with the -p mode. Only use this flag in directories you trust."
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗