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§
Implementations§
Source§impl Platform
impl Platform
Sourcepub const ALL: [Platform; 14]
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.
Sourcepub fn install_subpath(
self,
kind: ArtifactKind,
scope: InstallScope,
) -> Option<PathBuf>
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.
Sourcepub fn supports(self, kind: ArtifactKind) -> bool
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.
Sourcepub fn agent_extension(self) -> &'static str
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.
Sourcepub fn transforms_agent_to_toml(self) -> bool
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.
Sourcepub fn slug(self) -> &'static str
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.
Sourcepub fn manifest_dir(self) -> Option<&'static str>
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.
Sourcepub fn targets() -> Vec<Platform>
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.
Sourcepub fn manifest_targets() -> Vec<(Platform, &'static str)>
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.