Skip to main content

Crate standard_plugin_cli

Crate standard_plugin_cli 

Source
Expand description

standard-plugin: scaffold, build, check and pack Standard Code plugins (runtime v2, standard:plugin@2.0.0). Also runs as cargo standard-plugin.

Modules§

build
standard-plugin build: cargo builds the crate for wasm32-wasip2 (whose output is already a component), the component is copied into the bundle under the manifest’s module name, and the browser artifact is transpiled when jco is installed.
check
standard-plugin check: everything a host would reject, found before upload, plus warnings for what it would accept but probably should not.
component
What a built component imports and exports.
guide
standard-plugin guide: the SDK’s guides. In a plugin project they come from the SDK its Cargo.lock resolves (that crate’s docs/ directory, found with cargo metadata), so they describe the SDK the plugin builds against. Anywhere else they are the guides of the SDK this CLI was released with.
install
standard-plugin install: checks and packs the plugin, then hands the package to standard plugin install, which uploads it with the signed-in account’s credentials, shows its grants and asks before it installs. This CLI never holds account credentials itself.
pack
standard-plugin pack: the deterministic account package of a plugin directory (standard_plugin_manifest::package): manifest.json at the root and each built half (a UI plugin, its companion daemon, or both) under ui/ and daemon/ with its runtime manifest, component, and the browser artifact when built. The same bundle always packs to the same bytes; the SHA-256 of the tarball, in lowercase hex, is the package’s identity on the account.
project
Finding plugins on disk: a plugin directory holds a crate and its manifest (bundle/standard-plugin.json, or standard-plugin.json beside Cargo.toml); bundle/ receives what build makes.
scaffold
standard-plugin new: a plugin crate (or, for a companion, a UI crate and its daemon) with a manifest whose grants carry reasons.
world
The worlds of standard:plugin@2.0.0, read from the SDK’s WIT package, as sets of import and export names a component can be checked against.

Functions§

run
Runs the CLI on args (the program name first).