Skip to main content

Platform

Enum Platform 

Source
pub enum Platform {
Show 14 variants Claude, Copilot, Cursor, Windsurf, Gemini, Opencode, Codex, Pi, Crush, Amp, Zed, Openhands, Hermes, Devin,
}
Expand description

The target AI coding assistant platform for artifact installation.

Serializes to its lowercase name ("claude", "codex", …) — the same token the --platform flag accepts — so the platforms list in config.json stays human-readable and round-trips with the CLI.

Variants§

§

Claude

§

Copilot

§

Cursor

§

Windsurf

§

Gemini

§

Opencode

§

Codex

§

Pi

§

Crush

§

Amp

§

Zed

§

Openhands

§

Hermes

§

Devin

Implementations§

Source§

impl Platform

Source

pub const ALL: [Platform; 14]

Every platform variant, for exhaustive cross-platform operations such as the system survey (cmx doctor).

Keep this in sync with the enum; the all_contains_every_variant test guards against a variant being added without being listed here.

Source

pub fn install_subpath( self, kind: ArtifactKind, scope: InstallScope, ) -> Option<PathBuf>

The install directory for the given artifact kind and scope.

The returned path is relative — to the project root for InstallScope::Local, or to $HOME for InstallScope::Global. It already includes the kind-specific leaf directory (e.g. agents, skills), so callers do not append a subdirectory.

Returns None for unsupported (platform, kind) combinations (see supports). Callers should gate on supports or ensure_supports before calling this, so None indicates a programming error at the call site.

Source

pub fn supports(self, kind: ArtifactKind) -> bool

Whether this platform supports installing the given artifact kind.

Skills-only tools (Pi, Crush, Amp, Zed, OpenHands, Hermes) have no file-droppable agent concept; (platform, Agent) is unsupported for them. Derived from spec — a None agent_format means skills-only.

Source

pub fn agent_extension(self) -> &'static str

The file extension for an installed agent on this platform.

Most platforms store agents as markdown (md); codex uses TOML (toml) and the source markdown is transformed during install.

Source

pub fn transforms_agent_to_toml(self) -> bool

Whether installing an agent for this platform requires transforming the source markdown into codex’s TOML subagent format.

Source

pub fn slug(self) -> &'static str

Slug used to construct platform-specific lock file names.

Claude returns an empty string (lock file stays cmx-lock.json for backward compatibility). All other platforms return a non-empty slug.

Source

pub fn manifest_dir(self) -> Option<&'static str>

The directory name for this platform’s plugin manifest (used by cmf).

Returns Some only for platforms that receive generated manifest copies (Copilot, Cursor, Windsurf, Gemini). Returns None for Claude (which is the canonical manifest source, not a target) and for all .agents-standard tools (opencode, codex, pi, Crush, Amp, Zed, OpenHands, Hermes), which have no plugin-manifest format.

Use targets to iterate only the Some platforms.

Source

pub fn targets() -> Vec<Platform>

All platforms that receive generated plugin manifests.

Derived from ALL by filtering for platforms where manifest_dir is Some. The .agents-standard tools (opencode, codex, pi, Crush, Amp, Zed, OpenHands, Hermes) are excluded: none of them define a plugin/marketplace manifest format.

Source

pub fn manifest_targets() -> Vec<(Platform, &'static str)>

All manifest-target platforms paired with their manifest directory name.

Each tuple (platform, dir) is guaranteed to have a non-empty dir string — callers never need to handle an Option. Use this instead of targets() when the manifest directory name is needed alongside the platform, to avoid unwrapping manifest_dir() at each call site.

Trait Implementations§

Source§

impl Clone for Platform

Source§

fn clone(&self) -> Platform

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 Copy for Platform

Source§

impl Debug for Platform

Source§

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

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

impl Default for Platform

Source§

fn default() -> Platform

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

impl<'de> Deserialize<'de> for Platform

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 Display for Platform

Source§

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

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

impl Eq for Platform

Source§

impl Hash for Platform

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Platform

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Platform

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 Platform

Source§

impl ValueEnum for Platform

Source§

fn value_variants<'a>() -> &'a [Self]

All possible argument values, in display order.
Source§

fn to_possible_value<'a>(&self) -> Option<PossibleValue>

The canonical argument value. Read more
Source§

fn from_str(input: &str, ignore_case: bool) -> Result<Self, String>

Parse an argument into Self.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.