Skip to main content

Source

Struct Source 

Source
#[non_exhaustive]
pub struct Source {
Show 17 fields pub source: Option<SourceKind>, pub url: Option<String>, pub repo: Option<String>, pub git_ref: Option<String>, pub sha: Option<String>, pub path: Option<String>, pub skip_lfs: Option<bool>, pub package: Option<String>, pub version: Option<String>, pub registry: Option<String>, pub headers: Option<BTreeMap<String, String>>, pub headers_helper: Option<String>, pub host_pattern: Option<String>, pub path_pattern: Option<String>, pub name: Option<String>, pub plugins: Option<Vec<InlinePlugin>>, pub extra: Extra,
}
Expand description

A marketplace or plugin source: source names the kind, and the other fields are the ones that kind takes (github: repo, ref, path; npm: package; and so on). One struct for every kind, so a kind this crate doesn’t know still parses.

Used by extraKnownMarketplaces, strictKnownMarketplaces, blockedMarketplaces and an inline marketplace’s plugins.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§source: Option<SourceKind>

Identifies the marketplace source type.

  • Values: string
  • Default: unset

Docs: source.

§url: Option<String>

Direct URL to marketplace.json file.

  • Values: string
  • Default: unset

Docs: url.

§repo: Option<String>

GitHub repository in owner/repo format.

  • Values: string
  • Default: unset

Docs: repo.

§git_ref: Option<String>

Git branch or tag to use (e.g., “main”, “v1.0.0”). Defaults to repository default branch.

  • Values: string
  • Default: unset

Docs: ref.

§sha: Option<String>

A plugin source’s exact commit SHA, which pins the plugin.

  • Values: string, a full commit SHA
  • Default: unset

Docs: sha.

§path: Option<String>

Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json).

  • Values: string
  • Default: unset

Docs: path.

§skip_lfs: Option<bool>

Skip Git LFS downloads when Claude Code clones or updates the marketplace repository. LFS pointer files remain as pointers instead of downloading their content. Use this when the repository contains large LFS objects unrelated to plugin content.

  • Values: Boolean
  • Default: unset

Docs: skipLfs.

§package: Option<String>

NPM package containing marketplace.json.

  • Values: string
  • Default: unset

Docs: package.

§version: Option<String>

An npm plugin source’s package version.

  • Values: string
  • Default: unset

Docs: version.

§registry: Option<String>

An npm plugin source’s registry URL.

  • Values: string, a URL
  • Default: unset

Docs: registry.

§headers: Option<BTreeMap<String, String>>

A url source’s extra request headers, for authenticated access.

  • Values: object mapping header names to values
  • Default: unset

Docs: headers.

§headers_helper: Option<String>

A url source’s command that prints headers whose values are too short-lived to list in headers. Claude Code runs it before each fetch of the marketplace and each plugin download from its origin, reusing its output for up to 60 seconds. Requires Claude Code v2.1.238 or later.

  • Values: string, a command
  • Default: unset

Docs: headersHelper.

§host_pattern: Option<String>

Git host pattern to trust for repositories in source specifications.

  • Values: string
  • Default: unset

Docs: hostPattern.

§path_pattern: Option<String>

A pathPattern source (in strictKnownMarketplaces and blockedMarketplaces): a regular expression matched against local marketplace paths.

  • Values: string, a regular expression
  • Default: unset

Docs: pathPattern.

§name: Option<String>

Name of the inline marketplace.

  • Values: string
  • Default: unset

Docs: name.

§plugins: Option<Vec<InlinePlugin>>

Plugins declared inline. Each must reference an external source such as GitHub or npm. You still need to enable each plugin separately in enabledPlugins.

  • Values: array of object
  • Default: unset

Docs: plugins.

§extra: Extra

Keys Claude Code accepts here that this crate doesn’t model (newer or undocumented ones), kept as written so the document round-trips.

Implementations§

Source§

impl Source

Source

pub fn new(kind: SourceKind) -> Self

A source of kind kind with no other field set.

Trait Implementations§

Source§

impl Clone for Source

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Source

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Source

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Source

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Source

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Source

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Source

Auto Trait Implementations§

§

impl Forget for Source

§

impl Freeze for Source

§

impl Move for Source

§

impl RefUnwindSafe for Source

§

impl Send for Source

§

impl Sync for Source

§

impl Unpin for Source

§

impl UnsafeUnpin for Source

§

impl UnwindSafe for Source

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.