Expand description
Core plugin operations (install, uninstall, enable, disable, update)
This module provides pure library functions that can be used by both:
- CLI commands (
claude plugin install/uninstall/enable/disable/update) - Interactive UI (ManagePlugins.tsx)
Functions in this module:
- Do NOT call process::exit()
- Do NOT write to console
- Return result objects indicating success/failure with messages
- Can throw errors for unexpected failures
Structs§
- Cache
Plugin Options - Cache plugin options
- Cache
Plugin Result - Cache plugin result
- Installed
Plugins V2 - Installed plugins data (V2 format)
- Loaded
Plugin - Loaded plugin structure
- Plugin
Info - Plugin info from marketplace lookup
- Plugin
Installation Entry - Installation entry in installed_plugins_v2.json
- Plugin
Operation Result - Result of a plugin operation
- Plugin
Update Result - Result of a plugin update operation
- Settings
Json - Settings JSON structure
Enums§
- Install
Resolution Result - Resolution result for install
- Installable
Scope - Installation scope type
- Plugin
Scope - Plugin scope (broader, includes ‘managed’)
- Setting
Source - Setting source mapping
Constants§
- VALID_
INSTALLABLE_ SCOPES - Valid installable scopes (excludes ‘managed’ which can only be installed from managed-settings.json)
- VALID_
UPDATE_ SCOPES - Valid scopes for update operations (includes ‘managed’ since managed plugins can be updated)
Functions§
- assert_
installable_ scope - Assert that a scope is a valid installable scope at runtime
- disable_
all_ plugins_ op - Disable all enabled plugins
- disable_
plugin_ op - Disable a plugin
- enable_
plugin_ op - Enable a plugin
- get_
plugin_ installation_ from_ v2 - Get the most relevant installation for a plugin from V2 data. For project/local scoped plugins, prioritizes installations matching the current project. Priority order: local (matching project) > project (matching project) > user > first available
- get_
project_ path_ for_ scope - Get the project path for scopes that are project-specific. Returns the original cwd for ‘project’ and ‘local’ scopes, None otherwise.
- install_
plugin_ op - Install a plugin (settings-first).
- is_
installable_ scope - Type guard to check if a scope is an installable scope (not ‘managed’)
- is_
plugin_ enabled_ at_ project_ scope - Is this plugin enabled (value === true) in .claude/settings.json?
- scope_
to_ setting_ source - Convert installable scope to setting source
- set_
plugin_ enabled_ op - Set plugin enabled/disabled status (settings-first).
- uninstall_
plugin_ op - Uninstall a plugin
- update_
plugin_ op - Update a plugin to the latest version.